/* styles.css - CLEANED & STABILIZED v250 - Added contact page styles */

a {
    text-decoration: none;
    color: #4A5E6D;
}
a:hover {
    color: #6B8E23;
}

body {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 10pt;
    color: #333;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: linear-gradient(135deg, #F5DEB3, #E2D6C4);
    min-height: 100vh;
}

/* ==================== UNIFORM BOX STYLE FOR ALL BOXES (top + bottom) ==================== */
.search-container,
.top-controls,
#filters-box,
#column1,
#column2,
#column3 {
    background: white;
    border-radius: 20px;
    border: 2px solid #263F3B;
    box-shadow: 0 20px 55px rgba(63, 42, 30, 0.25);
    overflow: hidden;
}

/* ==================== WHITE CARD DESIGN (Search / Alphabet / Filters) ==================== */
.search-container,
.top-controls,
#filters-box {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 55px rgba(63, 42, 30, 0.25);
    overflow: hidden;
    max-width: 1160px;
    margin-left: auto;
    margin-right: auto;
    border: 3px solid #263F3B;
}

/* 1. SEARCH AREA – moderate space below header */
.search-container {
    padding: 12px 28px 14px 28px;
    margin-top: 25px;
    margin-bottom: 22px;
}

/* 2. ALPHABET BAR */
.top-controls {
    padding: 24px 35px;
    margin-bottom: 22px;
}

/* 3. FILTERS BOX */
#filters-box {
    padding: 28px 35px;
    margin-bottom: 22px;
}

/* Bottom result columns – now match the top cards exactly */
#column1, #column2, #column3 {
    padding: 22px;
}

/* ==================== ALPHABET BAR ==================== */
#alphabet-bar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 3px;
    padding: 4px 0;
    min-height: 36px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: thin;
}

#alphabet-bar a,
#alphabet-bar span,
#alphabet-bar .letter {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    min-width: 29px;
    padding: 3px 5px;
    font-size: 13px;
    color: #4A5E6D;
    background-color: transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

#alphabet-bar a:hover,
#alphabet-bar .letter:hover {
    background-color: #f5deb3;
    color: #6B8E23;
}

#alphabet-bar .letter.active,
#alphabet-bar a.active {
    background-color: #D2B48C;
    color: #3f2a1e;
    font-weight: bold;
}

/* ==================== COLUMN 2 – FULL-LINE HARMONIOUS COLORS ==================== */
#column2 {
    overflow-x: hidden;
}

.study-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 6px;
    border-radius: 8px;
    padding: 6px 10px;
}

.study-date {
    width: 100px;
    flex-shrink: 0;
}

.study-title {
    flex: 1;
    padding-left: 10px;
    color: #333;
    cursor: pointer;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.study-source {
    font-size: 0.9em;
    color: #666;
}

/* ==================== EVERYTHING ELSE ==================== */
.search-container strong {
    font-size: 14px;
    color: #263F3B;
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
}

/* Search container column widths – widened Project column */
.search-container td:nth-child(1) { width: 34%; }   /* Project – made wider */
.search-container td:nth-child(2) { width: 20%; }   /* Search Terms */
.search-container td:nth-child(3) { width: 12%; }   /* Journal */
.search-container td:nth-child(4) { width: 12%; }   /* Author */
.search-container td:nth-child(5) { width: 15%; }   /* Study Flags */
.search-container td:nth-child(6) { width: 7%;  }   /* Search button */

.search-container select,
.search-container input {
    width: 100%;
    height: 37px;
    font-size: 14px;
    padding: 0 11px;
    border: 2px solid #D2B48C;
    border-radius: 7px;
    background: white;
}

.search-container select:focus,
.search-container input:focus {
    outline: none;
    border-color: #C4B5A5;
}

.shop-button {
    background: #263F3B;
    color: white;
    padding: 6px 18px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    line-height: 1.2;
    transition: background 0.2s;
}
.shop-button:hover {
    background: #1a2f2a;
}

button[onclick="performTopSearch()"] {
    background: #263F3B;
    color: white;
    font-size: 16px;
    padding: 12px 36px;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    min-height: 42px;
}
button[onclick="performTopSearch()"]:hover {
    background: #1a2f2a;
}

.second-row-info {
    padding: 10px 0 0 0;
    background: transparent;
    border-radius: 0;
    border-top: 1px solid #e8d9c4;
    margin-top: 18px;
}

#remove-all-btn {
    margin-bottom: 5px;
    padding: 6px 18px;
    background-color: #263F3B;
    color: white;
    border: none;
    font-weight: bold;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    align-self: flex-start;
    white-space: nowrap;
    min-height: 36px;
}

#remove-all-btn:hover {
    background-color: #1a2f2a;
}

#filters-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}
.filter {
    padding: 5px 10px;
    border: 1px solid #4A5E6D;
    background-color: #E2D6C4;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
}
.filter-text { text-align: left; }
.filter-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}
.toggle-state, .remove-filter {
    padding: 5px;
    cursor: pointer;
}
.toggle-state.on { background-color: #E2D6C4; color: #333333; }
.toggle-state.off { background-color: #C4B5A5; color: #333333; }
.remove-filter { background-color: #6B8E23; color: #333333; }

.main-content {
    max-width: none;
    margin: 30px auto 80px;
    padding: 0 20px;
}

#columns-container {
    display: grid;
    grid-template-columns: 20% 40% 40%;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.sub-headers {
    display: flex;
    padding: 5px 0;
    font-size: 14px;
    font-weight: bold;
}

#column3 h3 {
    font-size: 1.1em;
    margin-bottom: 0.3em;
    color: #000;
    text-align: left;
}
#column3 h4 {
    margin-top: 1em;
    margin-bottom: 0.15em;
    font-size: 1.05em;
}
#column3 .indent-block {
    margin-top: 0;
    margin-bottom: 1.2em;
    display: block;
}
.date-product,
.conclusion-section,
.authors-section,
.journal-section,
.link-section {
    margin-bottom: 0.5em;
}

/* Color palette */
.color-0 { background-color: #E0D5C6; }
.color-1 { background-color: #C4B5A5; }
.color-2 { background-color: #A89F94; }
.color-3 { background-color: #C0C0C0; }
.color-4 { background-color: #D3D3D3; }
.color-5 { background-color: #E2D6C4; }
.color-6 { background-color: #D2B48C; }
.color-7 { background-color: #F5DEB3; }

.help-modal {
    display: none;
    position: fixed;
    top: 5%;
    left: 5%;
    width: 90%;
    background: white;
    padding: 20px;
    border: 1px solid black;
    z-index: 1000;
    max-height: 90vh;
    overflow-y: auto;
}
.close-help-btn {
    margin-top: 20px;
}

*,
body, div, span, p, h1, h2, h3, a,
.study-title, .keyword-row span, .filter, .filter-text {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

#flag_checkboxes {
    max-height: 140px;
    overflow-y: auto;
    padding: 3px;
    border: 1px solid #263F3B;
    border-radius: 6px;
    background: #ffffff;
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 2px 6px;
    align-items: start;
}

.flag-label {
    display: contents;
    cursor: pointer;
    font-size: 10px;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

.flag-label input.flag_cb {
    margin: 2px 0 0 0;
    width: 14px;
    height: 14px;
}

.flag-label span {
    padding-top: 1px;
}

.flag-label:hover {
    background: #f0f0f0;
    border-radius: 3px;
}

/* ==================== CONTACT PAGE STYLES ==================== */
.contact-container {
    max-width: 620px;
    margin: 40px auto;
    padding: 40px 30px;
    background: #F5F2EB;
    border: 2px solid #A89F94;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
h1 {
    color: #263F3B;
    font-size: 28px;
    margin-bottom: 8px;
    text-align: center;
}
h3 {
    color: #4A5E6D;
    font-size: 1.1em;
    margin-bottom: 30px;
    text-align: center;
}
input[type="text"], input[type="email"], input[type="number"], textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 18px;
    border: 1px solid #A89F94;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1.05em;
    background: #fff;
}
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}
.send-btn {
    background: #A89F94;
    color: #263F3B;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    flex: 1;
}
.send-btn:hover {
    background: #6B5E4F;
}
.cancel-btn {
    background: #E2D6C4;
    color: #263F3B;
    padding: 14px 32px;
    border: 1px solid #A89F94;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    flex: 1;
}
.cancel-btn:hover {
    background: #C4B5A5;
}
.feedback {
    padding: 14px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
}
.feedback.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* ====================== COLUMN FIXES (minimal + stable) ====================== */

/* 1. Cursor in column1 = pointer */
#column1,
#column1 * {
    cursor: pointer;
}

/* 2. Full-width colored rows in column2 ONLY (date + title both colored, edge-to-edge) */
#column2 .study-row {
    margin-left:  -22px;
    margin-right: -22px;
    padding-left:  32px;
    padding-right: 32px;
    width: calc(100% + 44px);
}

/* Make sure the date gets the same color as the title */
#column2 .study-date,
#column2 .study-title {
    background: transparent;
}


/* ====================== PROJECT FOCUS MODAL (moved from inline styles) ====================== */
.project-focus-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.project-focus-modal-content {
    background: white;
    max-width: 720px;
    margin: 20px;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-height: 85vh;
    overflow-y: auto;
}

#modalProjectName {
    margin: 0 0 4px 0;
    font-size: 1.45em;
}

#modalCuratorLine {
    font-size: 15.5px;
    color: #444;
    margin-bottom: 25px;
}

#modalFocusContent {
    line-height: 1.7;
    white-space: pre-wrap;
    font-size: 15px;
}

.modal-close-btn {
    margin-top: 30px;
    padding: 10px 26px;
    font-size: 15px;
}

/* ====================== COLUMN2 - FULL ROW BACKGROUND + FIT INSIDE ====================== */
#column2 .study-row {
    margin-left:  -22px;
    margin-right: -22px;
    padding-left:  32px;
    padding-right: 32px;
    width: calc(100% + 44px);
    box-sizing: border-box;
}

/* Make date + title inherit the row's background color */
#column2 .study-date,
#column2 .study-title {
    background: transparent;
}

/* Stop title from running off the right edge */
#column2 .study-title {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ====================== RESPONSIVE COLUMNS - PERCENTAGE BASED ====================== */

#columns-container {
    display: grid;
    grid-template-columns: 17% 38% 44%;
    gap: 15px;
    width: 100%;
    max-width: 1310px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px 0 3px;     /* ← reduced left padding = shifts everything left */
    box-sizing: border-box;
}

/* Column padding stays but stays inside the % grid */
#column1, #column2, #column3 {
    padding: 20px;
    box-sizing: border-box;
}

/* More vertical space between keywords in column 1 */
#column1-content .keyword-row {
    margin-bottom: 12px;     /* was probably 6px or less before */
}

/* Reduce spacing in Column 1 (keywords) and Column 2 (studies) */
#column1-content .keyword-row {
    margin-bottom: 8px;        /* was 12px */
}

#column2 .study-row {
    margin-bottom: 4px;        /* was 6px */
}