/* ============================================================
   ISITCREDIBLE.COM - CLEAN STYLESHEET
   Migrated from Streamlit -> HTML/FastAPI
   ============================================================ */

/* --- FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700;800;900&family=Google+Sans+Flex:wght@400;500;600;700&display=swap');

/* --- VARIABLES --- */
:root {
    --color-is: rgb(247, 144, 139);
    --color-it: rgb(236, 90, 83);
    --color-credible: rgb(67, 55, 68);
    --bg-button: rgb(252, 238, 238);
    --bg-button-hover: rgb(255, 222, 222);
    --text-main: #1a1a1a;  /* The standard "Reviewer 2" text color */
    --font-main: 'Google Sans Flex', -apple-system, sans-serif;
    --font-brand: 'Urbanist', sans-serif;
}

/* --- GLOBAL RESETS --- */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    font-family: var(--font-main);
    font-size: 18px;
    color: var(--text-main); /* [FIX] Uniform color */
    line-height: 1.6;        /* [FIX] Uniform line spacing */
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* --- LAYOUT CONTAINER (Streamlit "Centered" Mode) --- */
.container {
    max-width: 730px; 
    margin: 0 auto;
    padding: 1rem 1rem 4rem 1rem;
}

/* --- HEADER & NAV --- */
.sticky-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 999;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-menu {
    display: flex;
    justify-content: flex-end; 
    align-items: center;
    gap: 30px;
    margin-bottom: 15px;
    padding-right: 5px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #555; /* Navigation remains slightly lighter/distinct */
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent; 
}

.nav-link:hover {
    color: #333;
}

.nav-current {
    font-weight: 700;
    color: var(--color-credible);
    border-bottom: 2px solid var(--color-it); 
}

.logo {
    text-align: center;
    margin: 0;
    line-height: 1.0;
    margin-bottom: 20px;
    font-size: 0; 
}

.logo span {
    font-family: var(--font-brand);
    font-size: 60px; 
    font-weight: 800;
}

@media (max-width: 600px) {
    .logo span { font-size: 40px; }
    .nav-menu { justify-content: center; gap: 20px; }
}

.color-is { color: var(--color-is); }
.color-it { color: var(--color-it); }
.color-credible { color: var(--color-credible); }

/* --- TYPOGRAPHY --- */
.page-title {
    text-align: center;
    color: #555; /* Headers kept distinct as requested */
    font-size: 24px; 
    font-weight: 600;
    margin: 10px 0 25px 0;
}

.intro-text {
    margin-bottom: 30px;
    line-height: 1.6;
    text-align: left;
    color: var(--text-main); /* [FIX] Force match main text color */
}

/* [FIX] Disclaimer: Larger, darker, consistent spacing */
.disclaimer {
    font-size: 18px; 
    color: var(--text-main);
    background: transparent;
    padding: 0;
    margin: 30px 0;
    line-height: 1.6;
}

.disclaimer a {
    color: #0066cc;
    text-decoration: underline;
}

/* --- FORMS & INPUTS --- */
.form-group {
    margin-bottom: 20px;
}

.form-group.centered {
    text-align: center;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 18px; 
    color: var(--text-main); /* [FIX] Ensure labels match body text */
}

/* [FIX] Checkbox Styling & Alignment */
.checkbox-label {
    display: flex;
    align-items: flex-start; /* Aligns box with the top line of text */
    gap: 12px;
    cursor: pointer;
    line-height: 1.6;
}

input[type="checkbox"] {
    accent-color: var(--color-it); /* [FIX] Matches "it" color */
    width: 20px;
    height: 20px;
    margin-top: 5px; /* [FIX] Pushes box down to align with text cap-height */
    flex-shrink: 0;  /* Prevents box from squishing */
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="search"],
textarea {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-main);
    transition: border-color 0.2s, background-color 0.2s;
    background-color: #fafafa;
    color: var(--text-main);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--color-it);
    background-color: #fff;
}

#email, .donation-input {
    text-align: center;
}

.donation-input {
    font-size: 36px !important; 
    font-weight: 700;
    color: var(--color-credible);
    width: 180px !important;
    padding: 10px;
}

/* --- FILE UPLOAD BOX --- */
.upload-heading {
    text-align: center;
    margin-bottom: 15px;
    font-size: 20px;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 600px) {
    .upload-grid { grid-template-columns: 1fr 1fr; }
}

.upload-wrapper {
    display: flex;
    flex-direction: column;
}

.upload-box {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-box:hover, .upload-box.drag-over {
    background: #f0f0f0;
    border-color: var(--color-it);
    transform: scale(1.01);
}

.upload-box.has-file {
    border-style: solid;
    background: #fff;
    border-color: #ccc;
}

.upload-box input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10; 
    display: block;
}

.upload-label {
    font-weight: 500;
    margin-bottom: 0;
    pointer-events: none; 
    z-index: 1;
    position: relative;
    color: var(--text-main);
}

/* --- UPLOAD PROGRESS BAR --- */
.progress-container {
    height: 40px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-bar-wrapper {
    width: 100%;
    max-width: 300px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-bar-wrapper.visible {
    opacity: 1;
}

.progress-label {
    font-size: 13px;
    color: #888;
    text-align: center;
    margin-bottom: 6px;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #bbb;
    border-radius: 4px;
    transition: width 0.1s ease-out;
}

/* --- BUTTONS --- */
.btn {
    display: block;
    width: 100%;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    height: 100px; 
    background-color: var(--bg-button);
    color: var(--color-credible); 
    font-family: var(--font-brand);
    font-size: 28px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Standard size buttons for Report Page */
.btn-standard {
    height: auto;
    padding: 12px 24px;
    background-color: var(--color-credible);
    color: #fff;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    text-align: center;
    display: inline-block;
}

.btn-standard:hover:not(:disabled) {
    background-color: #2a222b;
    transform: translateY(-1px);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--bg-button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.btn-primary:disabled, .btn-disabled {
    background-color: #f0f2f6;
    color: #bcc3ce;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-small {
    display: inline-block;
    width: auto;
    padding: 6px 16px;
    font-size: 14px;
    background: transparent;
    border: 1px solid var(--color-it);
    color: var(--color-it);
    border-radius: 4px;
    height: auto;
}

.btn-small:hover {
    background: var(--color-it);
    color: white;
}

/* --- ARCHIVE LIST --- */
.archive-row-link {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-main); /* [FIX] Use main color */
    font-size: 18px;
    line-height: 1.6;
    transition: background-color 0.1s;
}

.archive-row-link:hover {
    background-color: #fafafa;
    color: #000;
}

.archive-donate-link {
    color: #0066cc !important;
    text-decoration: underline;
    font-weight: 600;
}

.search-box {
    margin-top: 30px;
    margin-bottom: 30px;
}

.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

/* --- PDF VIEWER --- */
.pdf-wide-container {
    width: 130%;
    margin-left: -15%;
    margin-top: 20px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .pdf-wide-container {
        width: 100%;
        margin-left: 0;
    }
}

/* --- FOOTER --- */
.footer-container {
    margin-top: 50px;
    padding-top: 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.footer-container img { opacity: 0.8; }

/* --- ALERTS --- */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

.centered-header {
    text-align: center;
    color: #555;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    margin-top: 10px;
}

.nominate-header {
    text-align: center;
    color: #555;
    font-size: 24px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 10px;
}

.home-email-container {
    max-width: 400px;
    margin: 0 auto 20px auto;
}