/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    text-decoration: none;
    background: none;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Times New Roman", serif;
    background: #f2f2f2;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ===== SHARED COMPONENTS ===== */

/* Background Image */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    object-fit: cover;
}

/* Header */
.header {
    background: #b45252;
    width: 100%;
    height: 66px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.header-title {
    color: #fef8ec;
    font-size: 30px;
    font-weight: 400;
    text-align: center;
    flex: 1;
}

/* Navigation Buttons */
.home-button, .about-button {
    position: absolute;
    right: 20px;
    background: #ffddc2;
    border-radius: 19.5px;
    padding: 8px 24px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.home-button:hover, .about-button:hover {
    transform: translateY(-2px);
    box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.3);
}

.home-button a, .about-button a {
    color: #6b1e1e;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
}

/* Hidden Form (Used on Results Page) */
.hidden-form {
    display: none;
}

/* ===== ANIMATIONS & UTILITIES ===== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f2f2f2; }
::-webkit-scrollbar-thumb { background: #b45252; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9d2828; }

/* ===== INDEX PAGE STYLES ===== */

.main-content {
    min-height: calc(100vh - 66px);
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.content-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.search-container, .disclaimer-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 40px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out;
}

.disclaimer-card {
    padding: 30px;
    box-shadow: 0 20px 20px rgba(0, 0, 0, 0.1);
}

.disclaimer-text {
    font-size: 15px;
    font-weight: 400;
    line-height: 1;
    color: #333;
    margin-bottom: 20px;
}

/* This adds empty space so you can scroll down on the index page */
.scroll-spacer {
    width: 100vw;
    height: 100vh;
    background: transparent;
    pointer-events: none;
}

/* Tooltips */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    color: #b45252;
    cursor: help;
}
.tooltip-icon i {
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.tooltip-icon:hover i { opacity: 1; }

.tooltip { font-family: "Times New Roman", serif; }
.tooltip .tooltip-inner {
    background-color: #b45252;
    color: #fff;
    padding: 8px 12px;
    font-size: 14px;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}
.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #b45252;
}

/* Main Search Bar */
.search-system { position: relative; margin-bottom: 30px; }
.search-bar {
    background: #d3aeaa;
    border-radius: 63.5px;
    height: 76px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    padding: 0 80px;
}
.search-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    background: #c99f9b;
}
.search-text {
    color: #333;
    font-size: 28px;
    font-family: "Times New Roman", serif;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    flex: 1;
    margin: 0;
    text-transform: capitalize;
    position: relative;
    right: 28px;
}
.search-button {
    position: absolute;
    right: 10px;
    background: #ffebeb;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.search-bar:hover .search-button {
    background: #ffe0e0;
    transform: scale(1.05);
}
.search-icon { width: 32px; height: 32px; stroke: #333; stroke-width: 2; }


/* Advanced Filters */
.advanced-filters {
    background: rgba(211, 174, 170, 0.3);
    border-radius: 30px;
    padding: 30px;
    margin-top: 20px;
}
.advanced-filters.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group, .filter-group-multi {
    position: relative;
    display: flex;
    flex-direction: column;
}
.form-label { margin-bottom: 5px; color: #333; font-weight: bold; }

.filter-input {
    width: 100%;
    background: #ffebeb;
    border-radius: 25px;
    padding: 15px 45px 15px 20px;
    border: 2px solid transparent;
    font-size: 16px;
    font-family: "Times New Roman", serif;
    transition: all 0.3s ease;
}
.filter-input:focus {
    outline: none;
    border-color: #b45252;
    box-shadow: 0 0 0 3px rgba(180, 82, 82, 0.1);
}

/* Multi-input fields (Authors/Institutions) */
.filter-group-multi { margin-bottom: 15px; }
.multi-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    position: relative;
    width: 100%;
}
.multi-input .filter-input { flex: 1; }
.multi-input .add-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #b45252;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}
.multi-input .add-btn:hover {
    background: #9d2828;
    transform: scale(1.1);
}

/* Year Range Inputs */
.year-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.filter-icon-small {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: #666;
    stroke-width: 2;
    pointer-events: none;
}

/* ===== RESULTS PAGE STYLES ===== */

.table-wrapper {
    background: rgba(255,255,255,0.95);
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 0;
    margin-bottom: 30px;
    overflow-x: auto;
    width: 100%;
}
.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.results-table th {
    background: #d3aeaa;
    color: #6b1e1e;
    font-size: 18px;
    font-weight: 600;
    padding: 14px 10px;
    border: none;
    /* For Sticky Header */
    position: sticky;
    top: 0;
    z-index: 5;
}
.results-table td {
    padding: 12px 10px;
    font-size: 16px;
    color: #222;
    vertical-align: middle;
    border-top: 1px solid #f2e6e6;
}
.table-row:hover {
    background: rgba(211, 174, 170, 0.15);
}

/* Expandable Cells */
.expandable-cell {
    position: relative;
    padding-right: 35px;
}
.text-full {
    white-space: normal;
}
.expand-btn {
    position: absolute;
    right: 5px;
    top: 0;
    height: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: #b45252;
    padding: 0 5px;
    font-size: 14px;
}
.expand-btn:hover { color: #9d2828; }
.expand-icon { transition: transform 0.2s ease-in-out; }
.expandable-cell.expanded .expand-icon { transform: rotate(180deg); }


/* Count Badge & Download Button */
.count-badge {
    background: #b45252;
    color: #fff;
    border-radius: 16px;
    padding: 8px 18px;
    font-size: 18px;
    font-weight: 500;
}
.download-btn {
    background: #ffddc2;
    color: #6b1e1e;
    border-radius: 19.5px;
    padding: 8px 24px;
    font-weight: 600;
    border: none;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.15);
    transition: all 0.3s;
}
.download-btn:hover {
    background: #ffe0e0;
    color: #b45252;
}

/* Pagination */
.pagination .page-link {
    color: #b45252;
    background: #ffddc2;
    border: none;
    border-radius: 12px !important;
    margin: 0 2px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}
.pagination .page-link:hover,
.pagination .active .page-link {
    background: #b45252;
    color: #fff;
}
.pagination .disabled .page-link {
    background: #f2e6e6;
    color: #aaa;
}

/* ===== ABOUT PAGE STYLES ===== */

.about-us .main-content {
    display: flex;
    align-items: center;
    justify-content: center;
}
.content-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    animation: fadeInUp 0.8s ease-out;
}
.title-section, .authors-section, .content-section {
    border-radius: 54px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.title-section { background: #d34747; padding: 25px 40px; max-width: 1129px; }
.main-title { color: #ffffff; font-size: 40px; font-weight: 400; line-height: 1.2; }
.authors-section { background: #fef8ec; padding: 20px 0; max-width: 1053px; }
.authors { color: #9d2828; font-size: 26px; font-weight: 400; }
.content-section { background: #bf4242; padding: 50px; max-width: 1491px; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25); text-align: left;}
.content-text { color: #fdf8ec; font-size: 20px; font-weight: 400; line-height: 1.6; }
.content-text p { margin-bottom: 24px; }
.content-text strong { font-weight: 700; color: #fdf8ec; }
.content-text h3 { color: #fdf8ec; font-size: 26px; font-weight: 700; margin: 30px 0 25px 0; }
.outcomes-list { margin: 30px 0; }
.outcome-item { margin-bottom: 25px; padding-left: 20px; position: relative; }
.outcome-item::before { content: "•"; position: absolute; left: 0; color: #fdf8ec; font-size: 20px; font-weight: bold; }
.outcome-item h4 { color: #fdf8ec; font-size: 20px; font-weight: 700; margin-bottom: 8px; display: inline; }
.outcome-item p { color: #fdf8ec; font-size: 20px; font-weight: 400; margin: 0; display: inline; margin-left: 10px; }


/* ===== RESPONSIVE STYLES ===== */

@media (max-width: 768px) {
    .header-title { font-size: 24px; }
    .home-button, .about-button { padding: 6px 16px; right: 10px; }
    .home-button a, .about-button a { font-size: 18px; }

    /* Index Page */
    .search-container { padding: 30px 20px; }
    .search-bar { height: 60px; }
    .search-text { font-size: 20px; }
    .search-button { width: 44px; height: 44px; }
    .filter-grid { grid-template-columns: 1fr; }

    /* Results Page */
    .table-wrapper { border-radius: 18px; }
    .results-table th, .results-table td { font-size: 14px; padding: 8px 6px; }
    .count-badge { font-size: 14px; padding: 6px 10px; }

    /* About Page */
    .about-us .main-content { padding: 20px 10px; }
    .content-container { gap: 20px; }
    .title-section, .authors-section, .content-section { padding: 25px 20px; }
    .main-title { font-size: 32px; }
    .authors { font-size: 24px; }
    .content-text { font-size: 20px; }
}

@media (max-width: 480px) {
    /* About Page */
    .main-title { font-size: 28px; }
    .authors { font-size: 20px; }
    .content-text { font-size: 18px; }
    .title-section, .authors-section, .content-section { padding: 20px 15px; }
}