/* --- GLOBAL STYLES & CSS VARIABLES --- */
:root {
    /* Color Palette from Header/Footer */
    --primary-color-site: #0a4d68;
    --secondary-color-site: #088395;
    --accent-color-site: #f39c12;
    --light-color-site: #f8f9fa;
    --dark-color-site: #343a40;
    
    /* Color Palette from Visa Analyzer */
    --primary-color-analyzer: #5A67D8; /* Indigo */
    --success-color: #38A169; /* Green */
    --warning-color: #DD6B20; /* Orange */
    --danger-color: #E53E3E; /* Red */
    --bg-color: #F7FAFC;
    --card-bg-color: #FFFFFF;
    --text-color: #4A5568;
    --heading-color: #1A202C;
    --border-color: #EDF2F7;
    --shadow-color: rgba(90, 103, 216, 0.1);

    /* Shared Variables */
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.menu-open { overflow: hidden; }
img { max-width: 100%; display: block; }

/* --- HEADER & NAVIGATION STYLES --- */
.header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding-top: env(safe-area-inset-top);
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo img { height: 45px; width: auto; }
.logo span { font-size: 1.5rem; font-weight: 700; color: var(--primary-color-site); }
.primary-menu .nav-links { list-style: none; display: flex; align-items: center; gap: 1.5rem; }
.primary-menu a { text-decoration: none; color: var(--dark-color-site); font-weight: 500; transition: color 0.3s ease; padding: 5px 0; position: relative; }
.primary-menu a:hover { color: var(--secondary-color-site); }
.dropdown { position: relative; }
.dropdown-content { display: none; position: absolute; background-color: #fff; min-width: 260px; box-shadow: var(--box-shadow); z-index: 1; border-radius: var(--border-radius); padding: 0.5rem 0; margin-top: 10px; border: 1px solid #eee; }
.dropdown-content a { color: var(--dark-color-site); padding: 12px 20px; text-decoration: none; display: block; font-size: 0.95rem; }
.dropdown-content a:hover { background-color: var(--light-color-site); }
.dropdown:hover .dropdown-content { display: block; }
.dropdown .dropbtn i { font-size: 0.7rem; margin-left: 5px; transition: transform 0.3s ease; }
.dropdown:hover .dropbtn i { transform: rotate(180deg); }
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: var(--primary-color-site); cursor: pointer; z-index: 1001; padding: 10px; }
#overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 998; }
#overlay.active { display: block; }

/* --- ANALYZER & DASHBOARD STYLES --- */
.analyzer-container { max-width: 900px; margin: auto; padding: 40px 20px; }
h1 { font-family: 'Poppins', sans-serif; color: var(--heading-color); text-align: center; font-weight: 600; font-size: 2.2em; margin-bottom: 30px; }
#upload-container { background: var(--card-bg-color); padding: 30px 40px; border-radius: 12px; box-shadow: 0 10px 25px 0 var(--shadow-color); text-align: center; }
.btn-primary { background-color: var(--primary-color-analyzer); color: white; border: none; width: 100%; padding: 15px 35px; font-size: 18px; font-family: 'Poppins', sans-serif; font-weight: 500; border-radius: 50px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; text-align: center; display: block; margin-top: 25px; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(90, 103, 216, 0.2); }
.loader { text-align: center; display: none; padding: 40px; }
.progress-bar-container { width: 90%; background-color: #e0e0e0; border-radius: 10px; margin: 20px auto 10px auto; overflow: hidden; }
.progress-bar { width: 0%; height: 20px; background-color: var(--primary-color-analyzer); border-radius: 10px; transition: width 0.4s ease; }
#results-container { margin-top: 40px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.dashboard-card { background: var(--card-bg-color); border-radius: 12px; padding: 25px; box-shadow: 0 10px 25px 0 var(--shadow-color); opacity: 0; transform: translateY(20px); animation: card-fade-in 0.5s ease-out forwards; }
.dashboard-card:nth-child(1) { animation-delay: 0.1s; } .dashboard-card:nth-child(2) { animation-delay: 0.2s; } .dashboard-card:nth-child(3) { animation-delay: 0.3s; }
@keyframes card-fade-in { to { opacity: 1; transform: translateY(0); } }
.full-width { grid-column: 1 / -1; }
.card-title { font-family: 'Poppins', sans-serif; font-size: 1.1em; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; color: var(--heading-color); }
.gauge-container { text-align: center; }
.gauge-value { font-size: 2.5em; font-weight: 700; margin-top: 10px; }
.gauge-label { font-size: 1em; font-weight: 500; margin-top: 10px; }
.summary-item { display: flex; align-items: center; justify-content: space-between; font-size: 1em; padding: 15px 0; border-bottom: 1px solid var(--border-color); }
.summary-item:last-child { border-bottom: none; }
.summary-item .label { flex-grow: 1; }
.summary-item .value { font-weight: 600; font-size: 1.1em; }
.issue-item { padding: 15px; border-bottom: 1px solid var(--border-color); }
.issue-item:last-child { border-bottom: none; }
.issue-item .issue-title { font-weight: bold; margin-bottom: 5px; }
.issue-item .details { margin-bottom: 8px; }
.issue-item .solution { color: var(--primary-color-analyzer); }
.selection-container { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }
.selection-container select { padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); font-family: 'Inter', sans-serif; font-size: 16px; width: 100%; background-color: #fff; }
.file-upload-wrapper { border: 2px dashed var(--border-color); border-radius: 8px; padding: 20px; text-align: center; cursor: pointer; transition: background-color 0.2s ease-in-out; }
.file-upload-wrapper:hover { background-color: #fcfcff; }
.file-upload-wrapper .file-upload-text { font-weight: 500; color: var(--primary-color-analyzer); }
#pdf-file-input { display: none; }
#file-upload-status { margin-top: 15px; font-style: italic; color: var(--text-color); }
#document-checklist-container { background-color: #F9FAFB; padding: 15px; border-radius: 8px; margin-top: 20px; text-align: left; }
.checklist-title { font-weight: 600; color: var(--heading-color); margin-bottom: 10px; }
#document-checklist-container ul { list-style-type: '✅  '; padding-left: 20px; margin: 0; }
#document-checklist-container li { padding-bottom: 5px; }
.dashboard-actions { text-align: center; margin-top: 30px; }
.btn-secondary { background-color: #E2E8F0; color: #2D3748; padding: 12px 30px; font-family: 'Poppins', sans-serif; font-size: 16px; border-radius: 50px; border: none; cursor: pointer; transition: background-color 0.2s; }
.btn-secondary:hover { background-color: #CBD5E0; }
.sufficiency-meter-container { padding-top: 15px; }
.sufficiency-label { font-weight: 600; margin-bottom: 8px; font-size: 0.9em; display: flex; justify-content: space-between; }
.meter-bg { background-color: var(--border-color); border-radius: 5px; overflow: hidden; height: 10px; }
.meter-bar { width: 0%; height: 10px; border-radius: 5px; transition: width 1.5s ease-out, background-color 1s; }
.meter-bar.low { background-color: var(--danger-color); }
.meter-bar.medium { background-color: var(--warning-color); }
.meter-bar.high { background-color: var(--success-color); }

/* --- FOOTER STYLES --- */
.footer {
    background-color: var(--dark-color-site);
    color: #ccc;
    padding: 40px 0 20px 0;
    margin-top: 50px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #555;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
}
.footer-logo { font-size: 1.2rem; font-weight: 700; color: #fff; }
.footer-menu a { color: #ccc; text-decoration: none; margin-left: 20px; transition: color 0.3s ease; }
.footer-menu a:hover { color: #fff; }
.copyright { text-align: center; margin-top: 20px; font-size: 0.9rem; }

/* --- RESPONSIVE STYLES --- */
@media (max-width: 768px) {
    .logo span { font-size: 1.2rem; }
    .logo img { height: 35px; }
    .mobile-menu-toggle { display: block; }
    .primary-menu { position: fixed; top: 0; right: 0; width: min(80vw, 320px); height: 100vh; background-color: #fff; z-index: 999; transform: translateX(100%); transition: transform 0.3s ease-in-out; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
    .primary-menu.active { transform: translateX(0); }
    .primary-menu .nav-links { flex-direction: column; align-items: flex-start; gap: 0; padding: 2rem; padding-left: calc(2rem + env(safe-area-inset-left)); padding-right: calc(2rem + env(safe-area-inset-right)); }
    .primary-menu li { width: 100%; text-align: left; }
    .primary-menu a { padding: 1rem 0; display: block; width: 100%; font-size: 1.1rem; }
    .dropdown:hover .dropdown-content { display: none; }
    .dropdown-content { position: static; display: none; box-shadow: none; background-color: #f7f7f7; width: 100%; border-radius: 0; margin-top: 0; padding: 0; padding-left: 1rem; }
    .dropdown-content a { padding: 12px 16px; }
    .dropdown.active > .dropdown-content { display: block; }
    .dropdown.active > a > i { transform: rotate(180deg); }
    .dropdown .dropbtn { display: flex; justify-content: space-between; align-items: center; width: 100%; }
    .analyzer-container { padding: 20px 15px; }
    h1 { font-size: 1.8em; margin-bottom: 20px; }
    #upload-container { padding: 20px; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 20px; }
    .summary-item { flex-direction: column; align-items: flex-start; gap: 5px; }
    .footer-content { flex-direction: column; text-align: center; }
    .footer-menu a { margin: 0 10px; display: inline-block; padding: 5px 0; }
}

/* --- PRINT STYLES --- */
@media print {
    body { padding: 0; background-color: #fff; }
    .header, .footer, #upload-container, .dashboard-actions, h1, .loader { display: none !important; }
    .analyzer-container { max-width: 100%; margin: 0; }
    .dashboard-grid, .dashboard-card { box-shadow: none; border: 1px solid var(--border-color); }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    a { text-decoration: none; color: inherit; }
    .card-title, .issue-item, .gauge-value { color: #000 !important; }
}