﻿
/*COMMON ELEMENTS*/
/*---------------*/

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  font-size: 14pt;
}

a {
  text-decoration: none;
}

button {
  height: 25px;
  border-radius: 4px;
  background-color: #cceeff;
}

li {
  margin-top: 4px;
}

.small-button {
  background-color: white;
  border: none;
  width: fit-content;
  color: blue;
  font-size: 1em;
}

  .small-button:hover {
    background-color: #f0f0f0;
  }


/*JAVASCRIPT REPLACEMENT FOR dialog() FUNCTION */

/* Modal Container */
.global-alert-dialog {
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  /* Mobile-first sizing & centering */
  width: min(90vw, 420px);
  max-height: 85vh;
  margin: auto; /* Centers the dialog vertically and horizontally in all modern mobile viewports */
  overflow-y: auto; /* Adds a scrollbar inside the modal if the error text is huge on landscape */

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

  /* Background Dimmer */
  .global-alert-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px); /* Safari support */
  }

/* Message Text */
.global-alert-message {
  margin: 0 0 20px 0;
  font-size: 15px;
  color: #333;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word; /* Prevents long un-broken error strings from blowing out mobile width */
}

/* Action Area */
.global-alert-actions {
  text-align: right;
}

/* OK Button - minimum 44px touch target for mobile UX standards */
.global-alert-btn {
  background-color: #007bff;
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  min-height: 44px;
  min-width: 70px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  touch-action: manipulation; /* Removes the 300ms tap delay on older mobile webviews */
  transition: background-color 0.15s ease-in-out;
}

  .global-alert-btn:hover {
    background-color: #0056b3;
  }

  .global-alert-btn:focus-visible {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
  }

/*JAVASCRIPT REPLACEMENT FOR confirm() DIALOG*/
.global-btn-secondary {
  background-color: #6c757d;
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  min-height: 44px;
  min-width: 70px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
  margin-right: 8px;
}

  .global-btn-secondary:hover {
    background-color: #5a6268;
  }






/*JAVASCRIPT CUSTOM MODAL DIALOG*/
/*-----------------------*/

.jsdlg-label {
  display: inline-block;
  margin-bottom: 6px;
}

.jsdlg-buttons-div {
  margin-top: 6px;
}

/*MAIN TITLE*/
/*----------*/
.app-title-span {
  color: #c7923e;
  font-size: 1.8em;
}


/*==============================*/
/*THE NEW CSS GRID LAYOUT MASTER*/
/*==============================*/

/*DESKTOP STYLES (Default 2-Column Grid)*/
/*--------------------------------------*/

.app-layout {
  display: grid;
  /*grid-template-columns: 300px 1fr;*/
  grid-template-columns: 350px 1fr;
  /*grid-template-rows: 40px 1fr;*/
  grid-template-rows: minmax(40px, auto) 1fr;
  height: 100vh;
  width: 100%;
}

/* All three of these now share the dark background to lock in the inverted "L" */
.layout-corner-spacer,
.layout-search-bar {
  background-color: #2c2f33;
  color: #ffffff;
}

.layout-corner-spacer {
  grid-column: 1;
  grid-row: 1;
}

.layout-header {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  align-items: center;
  padding-left: 1rem;
}

/* Desktop Search: Blends into the top right frame */
.layout-search-bar {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  align-self: center;
  padding-right: 1rem;
}

.layout-sidebar {
  grid-column: 1;
  grid-row: 2;
  background-color: #2c2f33;
  color: #ffffff;
  padding: 12px;
  overflow-y: auto;
}

.layout-content {
  grid-column: 2;
  grid-row: 2;
  color: #586e75;
  padding: 8px;
  overflow-y: auto;
}

/*MOBILE STYLES (Pure Grid Overrides)*/
/*-----------------------------------*/

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto 1fr;
    height: auto;
  }

  .layout-corner-spacer {
    display: none;
  }

  .layout-header {
    grid-column: 1;
    grid-row: 1;
    padding: 12px;
  }

  .layout-search-bar {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
    padding: 0 12px 12px 12px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
  }

  .layout-sidebar {
    grid-column: 1;
    grid-row: 3;
  }

  .layout-content {
    grid-column: 1;
    grid-row: 4;
  }
}


/*==============*/
/* MENU ELEMENTS*/
/*==============*/

a.menu-item {
  color: #c7923e;
  font-size: 1.1em;
}

.interest-grp-div {
  color: #c7923e !important;
  font-size: 1.1em;
  padding-top: 12px;
  padding-bottom: 6px;
}

.category-tree-div {
  background-color: #9a9a82;
  width: fit-content;
  margin-bottom: 6px;
}

.category-tree-explain-div {
  font-size: 0.9em;
  line-height: 0.9em;
  color: #e5e5e5; 
}


/*THE LOGOUT MENU BUTTON*/
/* Button menu item override (for secure actions like logout) */
button.menu-item-btn {
  /* 1. Neutralize global button rules (height: 25px, background, border, etc.) */
  height: auto;
  min-height: 0;
  background: transparent;
  background-color: transparent;
  border: none;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* 2. Match a.menu-item typography & color exactly */
  color: #c7923e;
  font-family: inherit;
  font-size: 1.1em;
  font-weight: normal;
  line-height: inherit;
  /* 3. Kill extra spacing to sit flush with the other items */
  display: inline; /* matches the inline nature of the other <a> tags inside .menu-item */
  width: auto;
  text-align: left;
  cursor: pointer;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* 4. Kill underline on all states */
  text-decoration: none;
}

  /* Ensure no underline ever triggers on hover, active, or focus */
  button.menu-item-btn:hover,
  button.menu-item-btn:focus,
  button.menu-item-btn:active {
    text-decoration: none;
    outline: none;
    color: #c7923e;
  }





/*Mobile First (Default): Single Column Stack*/
/*-------------------------------------------*/

.layout-header {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 8px 16px;
  gap: 0; /* Kill grid gap between title and nav on mobile */
  background-color: #2c2f33;
}

.top-nav {
  display: block;
  margin: 0 !important; /* Eliminate any unexpected margin */
  padding: 0 !important; /* Eliminate any unexpected padding */
}

  .top-nav a {
    display: block;
    margin: 0 !important; /* Force zero top/bottom margin */
    padding: 2px 0; /* Minimal touch padding */
    line-height: 1.1; /* Tight line height prevents box-height expansion */
    text-decoration: none;
  }




/*Desktop Layout (768px and wider): Horizontal Row*/
/*------------------------------------------------*/

/*@media (min-width: 768px) {
  .layout-header {
    grid-template-columns: auto 1fr;
    gap: 20px;*/ /* Restore space between Title and Nav */
/*background-color: #2c2f33;
  }

  .top-nav {
    text-align: left;
  }

    .top-nav a {
      display: inline-block;
      vertical-align: middle;
      padding: 0;
      padding-inline: 12px;
    }

      .top-nav a:last-child {
        padding-right: 0;
      }
}*/

@media (min-width: 768px) {
  /* 1. Turn header into a 2-column grid and center items vertically */
  .layout-header {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 24px;
  }

    /* 2. Lock text line-heights to eliminate baseline dropping */
    .layout-header .app-title-span,
    .top-nav {
      line-height: 1;
      margin: 0;
    }

      /* 3. Convert navigation links into a horizontal row */
      .top-nav a {
        display: inline-block;
        vertical-align: middle;
        line-height: 1;
        padding: 0 12px;
      }

        /* 4. Flush the right edge of the last link */
        .top-nav a:last-child {
          padding-right: 0;
        }

        .top-nav a:first-child {
          padding-left: 0;
        }
}
}











/* ==========================================================================
   MASTER HOME PAGE GRID
   ========================================================================== */
.home-grid-layout {
  display: grid;
  grid-template-columns: 1fr; /* Single vertical column layout */
  gap: 24px; /* Consistent padding spaces between home blocks */
  min-height: 800px;
}
.whats-new-content {
margin-bottom: 16px;
}


/* ==========================================================================
   MASTER LAYOUT & CONTAINER SAFEGUARDS (GRID OVERFLOW SHIELD)
   ========================================================================== */

/* Prevent CSS Grid parents and items from stretching past mobile screen width */
.app-layout,
.layout-content,
.home-grid-layout,
.home-hero-section,
.hero-text-block,
.hero-image-block,
.home-section {
  min-width: 0; /* Essential override for min-width: auto in CSS Grid */
  max-width: 100%;
  box-sizing: border-box;
}

/* Force headings and content text to break across lines on small viewports */
h1, h2, h3, p, li,
.home-title,
.section-heading {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}


/* ==========================================================================
   HERO BANNER GRID (MOBILE FIRST)
   ========================================================================== */

/* Base State: Single-column vertical stack for mobile screens */
.home-hero-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.hero-text-block {
  grid-column: 1;
}

.hero-image-block {
  grid-column: 1; /* Explicitly forces image under text in Column 1 on mobile */
  width: 100%;
  max-width: 400px;
  justify-self: center;
}

.hero-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Desktop State: Switch to 2 columns on screens wider than 768px */
@media screen and (min-width: 769px) {
  .home-hero-section {
    grid-template-columns: 3fr 2fr; /* Text left, Image right */
  }

  .hero-image-block {
    grid-column: 2; /* Moves image to right column on desktop */
    max-width: none;
  }
}


/* ==========================================================================
   FILM CARDS GRID (MOBILE SAFE)
   ========================================================================== */

.film-grid {
  display: grid;
  /* 280px minimum size ensures cards fit on mobile viewports without forcing horizontal scroll */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.view-film-link {
  font-size: 0.9em;  
}




/* ==========================================================================
   TYPOGRAPHY & ACCENTS
   ========================================================================== */
.home-title {
  color: #c7923e;
  font-size: 3rem;
  margin: 0 0 12px 0;
}

.section-heading {
  color: #586e75;
  font-size: 2rem;
  margin: 0 0 8px 0;
  border-bottom: 1px solid #d4d9d6; /* Optional underline divider decoration */
  padding-bottom: 4px;
}

.home-link,
.interest-link {
  color: #0066cc;
  text-decoration: underline;
}

  .home-link:hover,
  .interest-link:hover {
    color: #004499;
  }


/*------------*/
/* FILM CARDS */
/*------------*/

.film-card {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  background: #fff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.film-card-review-date {
  font-size: smaller;
  margin-top: 3px;
}

.film-card-review-name {
  margin-top: 8px;
  margin-bottom: 3px;
  color: #d8a42c;
  display: block;
}

.film-card-h4 {
  margin-top: 0px !important;
  margin-bottom: 0px !important;
}

.film-card-p {
  margin-top: 0px !important;
  margin-bottom: 12px !important;
}

.card-header {
  margin-top: 12px;
  margin-bottom: 8px;
}

.card-header3 {
  margin-top: 0px;
  margin-bottom: 0px;
}

.review-div {
  padding-top: 6px;
  padding: 4px;
  border: 1px solid #a0a0a0;
  width: 80%;
  margin-top: 6px;
  margin-bottom: 6px;
  white-space: pre-line;
}

.interest-group-div {
  margin-bottom: 3px;
}

.cluster-films-list {
  margin-top: 8px;
  margin-bottom: 3px;
  list-style-type: disc;
}

.film-card-img {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: auto;
}





/* ==========================================================================
   FORMS
   ========================================================================== */
/* ==========================================================================
   MINIMALIST FORM GRID SYSTEM & FIELD RESET
   ========================================================================== */
/* 1. Global Box-Sizing & Alignment Shield for Forms */
.form-grid *,
.form-grid *::before,
.form-grid *::after {
  box-sizing: border-box;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 16px;
  max-width: 650px;
}

/* 2. Primary 2-Column Row Layout (Desktop) */
.form-row {
  display: grid;
  grid-template-columns: minmax(100px, 200px) 1fr;
  column-gap: 24px;
  align-items: center; /* Centers labels perfectly on the horizontal axis of text boxes */
}

.form-label {
  color: #586e75;
  font-weight: bold;
  margin: 0;
  line-height: 1.3;
}

/* 3. Standalone Utility Field Locks (Guarantees Uniform 36px Heights Globally) */
.form-input,
.form-grid select,
.form-inline-btn,
.form-submit-btn {
  display: block;
  width: auto;
  height: 36px;
  padding: 6px 10px;
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #000;
}

/* 4. Textarea & Nested Structural Overrides */
.form-row:has(textarea),
.form-row:has(.form-group) {
  align-items: start; /* Snap labels to the top line for tall fields or address blocks */
}

.form-grid textarea.form-textarea {
  height: auto;
  min-height: 90px;
  resize: vertical;
}

.form-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* 5. Inline Sub-Grid Elements (e.g., Title Textbox + Get Title Button) */
.form-input-inline-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  width: 100%;
  max-width: 500px;
}

.form-inline-btn {
  width: auto;
  white-space: nowrap;
  cursor: pointer;
}

/* 6. Layout Action Buttons Positioning */
.actions-row {
  grid-template-columns: 1fr;
}

.form-actions {
  margin-left: 224px; /* Matches 200px Label max + 24px column gap */
}


/* ==========================================================================
   MOBILE & SIZING UTILITIES
   ========================================================================== */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    row-gap: 4px;
    align-items: start;
  }

  .form-actions {
    margin-left: 0;
  }
}

/* Input Width Constraints */
.input-short {
  max-width: 120px;
}

.input-medium {
  max-width: 250px;
}

.input-long {
  max-width: 450px;
}

.form-grid a:not([class]) {
  justify-self: start;
  width: fit-content;
}

/* =====================*/
/* INTEREST GROUPS PAGE */
/* =====================*/

div.interest-group-properties {
  border: 1px solid grey;
  width: 70%;
  margin-bottom: 12px;
  padding: 3px;
}

h2.interest-group-properties {
  margin-top: 3px;
  margin-bottom: 8px;
  font-size: 1.2em;
}




/* ======== */
/* MY FILMS */
/* ======== */
.image-button {
  border: 2px solid #d4d9d6;
  border-radius: 3px;
  padding: 3px;
  vertical-align: middle;
}

.myfilms-top-div {
  border: 1px solid #d4d9d6;
  width: 85%;
  padding: 3px;
}

.myfilms-div {
  border-left: 1px solid #d4d9d6;
  border-right: 1px solid #d4d9d6;
  border-bottom: 1px solid #d4d9d6;
  width: 85%;
  padding: 3px;
}

/*REVIEW FORM*/
/*===========*/


/* Target the dialog container itself */
#dlg_edit_review {
  width: 85%;
  max-width: 600px;
  /* FIX: Explicitly force the dialog to shrink wrap tight around the content */
  height: fit-content;
  max-height: 85vh;
  padding: 24px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
}

  /* Add vertical breathing room between your form sections */
  #dlg_edit_review h2,
  #dlg_edit_review div {
    margin-bottom: 16px;
  }

/* Force the textarea to scale perfectly inside its wrapper */
#tb_review {
  width: 100%;
  min-height: 150px;
  box-sizing: border-box;
  resize: vertical;
}

/* Push the buttons to the right using standard text alignment */
#dlg_edit_review div:last-child {
  text-align: right;
  margin-bottom: 0;
}

/* Style the buttons inside the button container */
#dlg_edit_review button {
  padding: 6px 16px;
  margin-left: 8px;
}



/*COMMENT FORM*/
/*===========*/


/* Target the dialog container itself */
#dlg_edit_comment {
  width: 85%;
  max-width: 600px;
  /* FIX: Explicitly force the dialog to shrink wrap tight around the content */
  height: fit-content;
  max-height: 85vh;
  padding: 24px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
}

  /* Add vertical breathing room between your form sections */
  #dlg_edit_comment h2,
  #dlg_edit_comment div {
    margin-bottom: 16px;
  }

/* Force the textarea to scale perfectly inside its wrapper */
#tb_comment {
  width: 100%;
  min-height: 150px;
  box-sizing: border-box;
  resize: vertical;
}

/* Push the buttons to the right using standard text alignment */
#dlg_edit_review div:last-child {
  text-align: right;
  margin-bottom: 0;
}

/* Style the buttons inside the button container */
#dlg_edit_comment button {
  padding: 6px 16px;
  margin-left: 8px;
}




/*VIEW A FILM*/
/*===========*/

.video-container {
  width: 100%;
  max-width: 640px; /* Keeps your desktop limit */
  aspect-ratio: 4 / 3; /* Mainnains the shape */
  margin: 0; /* Forces the container to align to the left */
}

.vid-player {
  width: 100%;
  height: 100%;
  border: 0;
}

.commentor-name {
  display: block;
  color: #d8a42c;
  font-size: 1em;
  padding-bottom: 6px;
  padding-top: 24px;
}

.div-review-container {
  margin-top: 6px;
  margin-bottom: 16px;
}

.comment-textarea {
  display: block;
  box-sizing: border-box;
  field-sizing: content;
  min-height: 100px;
  min-width: 50%;
}

.comment-span {
  display: block;
  padding: 6px;
  color: #586e75;
  margin-left: 24px;
  background-color: lightcyan;
  width: 75%;
  white-space: pre-line;
}

.comment-buttons-div {
  margin-left: 24px;
}

.comment-edit-div {
  margin-left: 24px;
  width: 70%;
  display: none;
}

.film-description {
  margin-top: 6px;
}

.view-film-add-comment-div {
  display: none;
}

.view-a-film-h2 {
  margin-bottom: 0px;
}



/*ERROR PAGE*/
/*==========*/

.div-error-page {
  padding-top: 25px;
  padding-left: 25px;
}


/* NOT FOUND PAGE*/
.not-found-img {
  width: 40%;
  height: auto;
}


/*REMOVE ME DIALOG*/
.dlg-remove-me {
  max-width: 480px;
}


/*TERMS OF SERVICE*/
.last-updated {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 24px;
  display: block;
}

/*FILM DIRECTORY*/
.film-directory{
  list-style-type: none;
}
.film-directory ul{
  padding-left: 21px;
}
.film-directory a {
  background-color: #E6DFDF;
  border-radius: 3px;
  padding-left: 3px;
  padding-right: 3px;
}


/*TEST JIG*/
/*========*/
.test-jig {
  display: block;
}



