/* Page-specific styles */
.landing-screen h1 {
    font-size: clamp(3rem, 4vw + 1rem, 4.2rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #00d4ff, #90e0ef);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Ensure headline is solid white in dark mode as well */
body:not(.light) .landing-screen h1 {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    color: #ffffff !important;
}
body.light .landing-screen h1 {
    /* Solid white text with subtle shadow for readability */
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: initial;
    color: #ffffff;
}
body:not(.light) .landing-screen h1 { text-shadow: 0 6px 24px rgba(0,0,0,0.35); }
body.light .landing-screen h1 { text-shadow: 0 2px 8px rgba(1,31,25,0.25); }

.landing-screen p {
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.55;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}
body.light .landing-screen p { color: rgba(1,31,25,0.75); opacity: 1; }
body.light .landing-screen p { color: #ffffff; text-shadow: 0 1px 4px rgba(1,31,25,0.25); }
/* Revert subheading to dark in light mode */
body.light .landing-screen p { color: #011f19; text-shadow: none; }

.assessment-screen h2 {
    font-size: 2.9rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 40px;
    color: #ffffff;
    padding-bottom: 12px;
}
/* Revert section titles to dark in light mode */
body.light .assessment-screen h2 { color: #011f19; text-shadow: none; }
body:not(.light) .assessment-screen h2 { text-shadow: 0 4px 16px rgba(0,0,0,0.35); }

.attribute-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.rating-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 2rem 0;
}

.chart-container {
    position: relative;
    width: 700px; /* Larger chart area on desktop */
    height: 600px; /* Taller area to prevent compression */
    margin: 150px auto 0px; /* Add generous space above and below */
    overflow: visible;
    z-index: 9999;
}

/* Ensure no extra margins during PDF export */
body.pdf-export .chart-container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

@media (max-width: 768px) {
    .landing-screen h1 { font-size: 1.9rem!important; line-height: 1.2; }
    .landing-screen p { font-size: 0.95rem!important; }
    .assessment-screen h2 { font-size: 2rem!important; }
    .assessment-screen .attribute-description { font-size: 0.95rem; line-height: 1.4; }
    .assessment-screen .attribute-question { margin-bottom: 10px; }
    .assessment-screen .attribute-tips { margin-top: 6px; }
    #ratingContainer { gap: 12px; margin: 1rem 0; }
    .assessment-screen.compact .attribute-description { font-size: 0.9rem; line-height: 1.35; }
    .assessment-screen.compact #attributeTitle { font-size: 2rem !important; margin-bottom: 10px; margin-top: 30px;}
    .assessment-screen.compact .attribute-question,
    .assessment-screen.compact .attribute-tips { font-size: 1rem; }
    .assessment-screen.compact .attribute-question strong { font-size: 1rem; }
    .assessment-screen.compact .attribute-tips strong { font-size: 0.95rem; }
    .chart-container {
        width: 260px;
        height: 260px;
        margin: 70px auto 16px; /* More top space on mobile */
    }

    /* Reorder assessment action buttons on mobile */
    #assessment > div:last-of-type { display: flex; flex-direction: column; gap: 10px; }
    #assessment > div:last-of-type #nextBtn { order: 0; }
    #assessment > div:last-of-type .back-btn { order: 1; }
    /* Keep back button pinned at the bottom area with safe spacing */
    #assessment > div:last-of-type .back-btn { align-self: center; margin-top: 0px; }
}

/* Admin Dashboard Specific Styles */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.tab-button {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    border-radius: 8px;
    margin: 0 5px;
}

.tab-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.tab-button.active {
    background-color: #129990;
    border-color: #129990;
}

body.light .tab-button {
    background-color: rgba(1, 31, 25, 0.06);
    border-color: rgba(1, 31, 25, 0.2);
    color: #011f19;
}

body.light .tab-button.active {
    background-color: #65cfba;
    border-color: #65cfba;
    color: #011f19;
}

.tab-content {
    display: none;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin-top: 1rem;
}

body.light .tab-content {
    background: rgba(1, 31, 25, 0.03);
}

#users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: #096B68; /* Dark green background for stat cards */
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.stat-title { 
    font-weight: 700; 
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px; 
}
.stat-value { 
    font-size: 2.5rem; 
    font-weight: 800; 
    color: #fff; 
}

body.light .stat-card { 
    background: #f0f2f5; /* Light background for stat cards in light mode */
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    color: #333;
}

body.light .stat-title {
    color: #011f19; /* Dark green for title in light mode */
}

body.light .stat-value {
    color: #011f19; /* Dark green for value in light mode */
}

@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr; /* Stack cards on small screens */
    }
}

/* Users Table */
#users-table tbody tr.user-row-clickable { cursor: pointer; }
#users-table tbody tr.user-row-clickable:hover { background-color: rgba(18, 153, 144, 0.1); }
body.light #users-table tbody tr.user-row-clickable:hover { background-color: rgba(101,207,186,0.1); }

/* Failures table - REMOVED */
/* #failures-table { width: 100%; border-collapse: collapse; margin-top: 12px; } */
/* #failures-table th, #failures-table td { border: 1px solid rgba(1,31,25,0.12); padding: 10px; } */
/* body:not(.light) #failures-table th, body:not(.light) #failures-table td { border-color: rgba(255,255,255,0.2); color: #011f19; } */
/* #failures-table th { background: rgba(1,31,25,0.05); } */
/* body:not(.light) #failures-table th { background: rgba(255,255,255,0.08); } */

#users-table th,
#users-table td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px;
    text-align: left;
    color: #011f19;
}

#users-table th {
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: bold;
}

body.light #users-table th,
body.light #users-table td {
    border-color: rgba(1, 31, 25, 0.2);
    color: #011f19; /* Dark green text for table content in light mode */
}

body.light #users-table th {
    background-color: rgba(1, 31, 25, 0.08);
}

/* Admin Dashboard Layout */
.admin-dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    height: 100vh;
    overflow: hidden; /* Prevent scrollbars if content overflows */
}

.admin-sidebar {
    width: 250px;
    background-color: #011f19; /* Dark background for sidebar */
    color: #fff;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    display: flex; /* Enable flexbox */
    flex-direction: column; /* Stack items vertically */
    justify-content: space-between; /* Push logout to bottom */
    height: 100%; /* Ensure sidebar takes full height to justify-content work */
}

.sidebar-header {
    margin-bottom: 10px; /* Reduced margin */
    text-align: left; /* Changed from center to left */
}

.sidebar-header h2 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 10px;
    padding-left: 20px; /* Add left padding to align with buttons */
}

.sidebar-nav-top {
    margin-top: 0; /* Remove top margin */
}

.sidebar-nav-top button, .sidebar-nav-bottom button {
    display: block;
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 10px;
    color: #fff;
    text-align: left; /* Align text to the left */
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

.sidebar-nav-top button:hover, .sidebar-nav-bottom button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-nav-top button.active, .sidebar-nav-bottom button.active {
    background-color: #129990;
}

body.light .sidebar-nav-top button,
body.light .sidebar-nav-bottom button {
    color: #011f19;
}

body.light .sidebar-nav-top button:hover,
body.light .sidebar-nav-bottom button:hover {
    background-color: rgba(1, 31, 25, 0.05);
}

body.light .sidebar-nav-top button.active,
body.light .sidebar-nav-bottom button.active {
    background-color: #65cfba;
}

.admin-main-content {
    flex-grow: 1;
    background-color: white; /* White background for the main content */
    padding: 20px;
    color: #011f19; /* Dark green text for contrast on white background */
    overflow-y: auto; /* Enable vertical scrolling */
}

.admin-main-content .container {
    max-width: 1200px; /* Adjust max-width for dashboard content */
    text-align: left;
}

.admin-main-content h1 {
    color: #011f19; /* Darker heading for contrast */
    margin-bottom: 1.5rem;
}

.admin-main-content h2 {
    color: #011f19; /* Darker subheading */
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Adjustments for light mode */
body.light .admin-sidebar {
    background-color: #f0f2f5;
    color: #011f19;
}

body.light .sidebar-header h2 {
    color: #011f19;
}

body.light .sidebar-nav button {
    color: #011f19;
}

body.light .sidebar-nav button:hover {
    background-color: rgba(1, 31, 25, 0.05);
}

body.light .sidebar-nav button.active {
    background-color: #65cfba;
}

body.light .admin-main-content {
    background-color: #ffffff;
}

body.light .admin-main-content h1,
body.light .admin-main-content h2 {
    color: #011f19;
}

/* Hide the original tab buttons from admin-dashboard.html */
.tabs { display: none; }

/* Tighten spacing below the chart controls on results screen */
#results .chart-style-toggle { margin-top: 0 !important; }

/* Reduce gap between toggle and results summary on results screen */
#results .results-summary { margin-top: 8px !important; }
.radar-chart { overflow: visible; position: relative; z-index: 10000; }

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

#results.active .radar-chart { animation: revealUp 500ms ease-out; }
#results.active .results-summary { animation: revealUp 600ms ease-out; }

.form-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
}
/* Light mode: brighter panel for the report form with visible border */
body.light .form-container { background: rgba(255,255,255,0.9); border: 2px solid #011f19; }

.results-summary {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    max-width: 1100px; /* reduce side margins on website content */
    backdrop-filter: blur(10px);
}

body.light .results-summary { background: rgba(1,31,25,0.06); }

/* Card look closer to reference mint style */
.score-item { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25); }
body.light .score-item { background: rgba(1,31,25,0.04); border-color: rgba(1,31,25,0.15); }

body.light .score-item .rating-label[data-status="needs-attention"] {
    color: #8B0000;  /* Dark red */
}

body.light .score-item .rating-label[data-status="good-progress"] {
    color: #006400;  /* Dark green for good progress */
}

body.light .score-item .rating-label[data-status="excellent"] {
    color: #004080;  /* Dark blue for excellent */
}

/* Modal specific styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12000;
}

.modal-overlay[hidden] { display: none !important; }

.modal-card {
    width: min(92vw, 560px);
    background: #096B68;
    border: 1px solid #90D1CA;
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    color: #fff;
    text-align: center;
}

body.light .modal-card {
    background: rgba(255,255,255,0.95);
    border-color: rgba(1,31,25,0.2);
    color: #011f19;
}

.modal-card h3 { margin-bottom: 10px; font-size: 1.6rem; }
.modal-card p { opacity: .95; margin-bottom: 16px; }
.modal-actions { display:flex; gap:12px; justify-content:center; }

/* Styles for individual score items in the modal, reused from results screen */
.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.score-item {
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

body.light .score-item { background: rgba(1,31,25,0.04); border-color: rgba(1,31,25,0.15); }

.score-item .rating-label { font-weight: 600; color: inherit; }
.score-item .stars { color: #f5c300; }

.score-item.status-red { border-color: #dc3545; background-color: rgba(220, 53, 69, 0.2); }
.score-item.status-yellow { border-color: #ffc107; background-color: rgba(255, 193, 7, 0.2); }
.score-item.status-green { border-color: #28a745; background-color: rgba(40, 167, 69, 0.2); }

body.light .score-item.status-red { background-color: rgba(220, 53, 69, 0.1); }
body.light .score-item.status-yellow { background-color: rgba(255, 193, 7, 0.1); }
body.light .score-item.status-green { background-color: rgba(40, 167, 69, 0.1); }

body.light .score-item .rating-label { color: #011f19; }
body.light .score-item .stars { color: #f5c300; }

/* Force desktop layout during PDF export/capture */
.pdf-export .container {
    max-width: 960px !important;
    padding: 32px !important;
}

.pdf-export .chart-container {
    width: 500px !important;
    height: 500px !important;
}

.pdf-export .score-grid {
    grid-template-columns: repeat(4, minmax(200px, 1fr)) !important;
    gap: 15px !important;
}

.pdf-export .rating-container {
    grid-template-columns: repeat(2, 1fr) !important;
}

.dashboard-charts {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.dashboard-charts > div {
    flex: 1;
    min-width: 300px; /* Minimum width for charts before wrapping */
    background-color: white; /* Changed to white for better contrast */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.light .dashboard-charts > div {
    background-color: #f0f2f5;
    color: #011f19;
}

body:not(.light) .dashboard-charts > div {
    background-color: #DDF4E7; /* Slightly light green for dark mode chart background */
    color: #e2e8f0;
}

body.light .dashboard-charts h2 {
    color: #011f19;
}

body:not(.light) .dashboard-charts h2 {
    color: #011f19; /* Dark green for titles in dark mode */
}

/* Enhanced slider styling for the assessment control */
#assessment #starSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #65cfba 0%, #65cfba 0%, rgba(255,255,255,0.25) 0%);
    outline: none;
    transition: box-shadow 200ms ease;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 2px 10px rgba(0,0,0,0.25);
}

#assessment #starSlider:hover {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35), 0 4px 18px rgba(0,0,0,0.35);
}

/* WebKit */
#assessment #starSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(closest-side, #ffe066 0%, #ffd24d 60%, #f5c400 100%);
    box-shadow: 0 0 0 4px rgba(255, 208, 0, 0.35), 0 8px 24px rgba(0,0,0,0.35);
    border: 2px solid #fff9;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 200ms ease;
}

#assessment #starSlider::-webkit-slider-thumb:hover {
    transform: scale(1.06);
    box-shadow: 0 0 0 6px rgba(255, 208, 0, 0.45), 0 10px 28px rgba(0,0,0,0.45);
}

/* Firefox */
#assessment #starSlider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(closest-side, #ffe066 0%, #ffd24d 60%, #f5c400 100%);
    box-shadow: 0 0 0 4px rgba(255, 208, 0, 0.35), 0 8px 24px rgba(0,0,0,0.35);
    border: 2px solid #fff9;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 200ms ease;
}

#assessment #starSlider::-moz-range-track {
    height: 12px;
    border-radius: 999px;
    background: transparent;
}

/* Light mode tweaks */
body.light #assessment #starSlider {
    box-shadow: inset 0 0 0 1px rgba(1,31,25,0.15), 0 2px 10px rgba(1,31,25,0.08);
}

@media (max-width: 768px) {
    .dashboard-charts {
        flex-direction: column; /* Stack charts on small screens */
    }
}

/* Form for Account Creation */
.admin-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 20px auto;
    text-align: left;
}

body:not(.light) .admin-form {
    background-color: #096B68;
    color: #e2e8f0;
}

.admin-form .form-group {
    margin-bottom: 15px;
}

.admin-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.admin-form .btn {
    width: auto;
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 1rem;
}