/* Base Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
}

/* Dark mode styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */

h1 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}

h2 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 24px;
    color: #212529;
}

body.dark-mode h2 {
    color: #f8f9fa;
}

h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
}

p {
    margin-bottom: 16px;
    color: #6c757d;
}

body.dark-mode p {
    color: #adb5bd;
}

a {
    color: #6366f1;
    text-decoration: none;
}

a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

body.dark-mode a {
    color: #818cf8;
}

body.dark-mode a:hover {
    color: #a5b4fc;
}

/* Header */

header {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    transition: padding 0.3s ease;
}

header.header--scrolled {
    padding: 12px 0;
}

body.dark-mode header {
    background-color: #2d2d2d;
    border-bottom-color: #4a4a4a;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.branding h1 {
    margin-bottom: 0;
    color: #6366f1;
}

body.dark-mode .branding h1 {
    color: #818cf8;
}

.tagline {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    max-height: 50px;
    overflow: hidden;
}

header.header--scrolled .tagline {
    opacity: 0;
    max-height: 0;
}

body.dark-mode .tagline {
    color: #adb5bd;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Theme Toggle */
.theme-toggle {
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

body.dark-mode .theme-toggle {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

.theme-toggle:hover {
    background: #6366f1;
    border-color: #6366f1;
    transform: scale(1.05);
}

body.dark-mode .theme-toggle:hover {
    background: #818cf8;
    border-color: #818cf8;
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    gap: 24px;
}

nav a {
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
}

nav a:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

body.dark-mode nav a:hover {
    background-color: #3a3a3a;
}

nav a[aria-current="page"] {
    background: linear-gradient(135deg, #4f46e5 0%, #717de8 100%);
    color: white;
}

/* Hero Section */
.hero,
.submit-hero,
.about-hero {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 48px 0;
    text-align: center;
    margin: 32px auto;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero h2,
.submit-hero h2,
.about-hero h2 {
    color: white;
    margin-bottom: 16px;
}

.hero p:not(.btn-primary),
.hero .lead,
.submit-hero p:not(.btn-primary),
.submit-hero .lead,
.about-hero .lead {
    color: #ffffff;
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

.hero-actions {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.hero-subtext {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    margin: 0;
}

body.dark-mode .hero-subtext {
    color: rgba(255, 255, 255, 0.95);
}

/* Floor Data Section */

.floor-data {
    padding: 48px 0;
    background-color: #ffffff;
    border-radius: 16px;
    margin: 32px 0;
}

.floor-data h2 {
    text-align: center;
}

.floor-data .container {
    background-color: #f8f9fa;
    padding: 32px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

body.dark-mode .floor-data {
    background-color: #2d2d2d;
}

body.dark-mode .floor-data .container {
    background-color: #1a1a1a;
    border-color: #4a4a4a;
}

.last-updated {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 24px;
    text-align: center;
}

body.dark-mode .last-updated {
    color: #adb5bd;
}

.floor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 100%));
    gap: 24px;
    margin-top: 24px;
}

.floor-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Floor Cards */
.floor-card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

body.dark-mode .floor-card {
    background-color: #2d2d2d;
    border-color: #4a4a4a;
}

.floor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card-meta {
    font-size: 12px;
    color: #6c757d;
}

body.dark-mode .card-meta {
    color: #c5c9d0;
}

.floor-card--square {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.crowd-score {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.crowd-description {
    flex: 1 1 auto;
    font-size: 13px;
}

/* Charts Section */

.charts {
    padding: 48px 0;
    background-color: #ffffff;
    border-radius: 16px;
    margin: 32px 0;
}

.charts h2 {
    text-align: center;
}

body.dark-mode .charts {
    background-color: #2d2d2d;
}

#chart-container {
    background-color: #f8f9fa;
    padding: 32px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    overflow: hidden;
}

body.dark-mode #chart-container {
    background-color: #1a1a1a;
    border-color: #4a4a4a;
}

#trend-canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.chart-status {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

body.dark-mode .chart-status {
    color: #cbd5f5;
}

/* Buttons */

.btn-primary {
    display: inline-block;
    background-color: #6366f1;
    color: white !important;
    padding: 16px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 18px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: white !important;
}

/* Report Form */

.report-form {
    padding: 48px 0;
    background-color: #ffffff;
    border-radius: 16px;
    margin: 32px 0;
}

.report-form h2 {
    text-align: center;
}

body.dark-mode .report-form {
    background-color: #2d2d2d;
}

.form-description {
    text-align: center;
    margin-bottom: 32px;
    font-size: 18px;
}

.simple-form {
    max-width: 640px;
    margin: 0 auto 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.simple-form label {
    font-weight: 600;
    color: #212529;
}

body.dark-mode .simple-form label {
    color: #f8f9fa;
}

.simple-form select,
.simple-form textarea,
.simple-form input[type="range"] {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    background-color: #ffffff;
}

body.dark-mode .simple-form select,
body.dark-mode .simple-form textarea,
body.dark-mode .simple-form input[type="range"] {
    background-color: #2d2d2d;
    border-color: #4a4a4a;
    color: #f8f9fa;
}

.simple-form textarea {
    resize: vertical;
}

.busyness-output {
    font-size: 16px;
    color: #6c757d;
}

body.dark-mode .busyness-output {
    color: #cfd4dc;
}

.range-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-top: 4px;
    color: #6c757d;
}

body.dark-mode .range-ticks {
    color: #cfd4dc;
}

.form-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid #ced4da;
    color: #212529;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

body.dark-mode .btn-secondary {
    color: #f8f9fa;
    border-color: #4a4a4a;
}

body.dark-mode .btn-secondary:hover {
    background-color: #3a3a3a;
}

.submission-log {
    max-width: 640px;
    margin: 0 auto 16px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    padding: 24px;
}

body.dark-mode .submission-log {
    background-color: #1f1f1f;
    border-color: #3a3a3a;
}

.submission-log ul {
    list-style: disc inside;
    color: #212529;
}

body.dark-mode .submission-log ul {
    color: #f8f9fa;
}

.form-note {
    text-align: center;
    margin-top: 24px;
    color: #6c757d;
}

body.dark-mode .form-note {
    color: #adb5bd;
}

/* Footer */

footer {
    background-color: #ffffff;
    border-top: 1px solid #dee2e6;
    padding: 32px 0;
    text-align: center;
    margin-top: 48px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

body.dark-mode footer {
    background-color: #2d2d2d;
    border-top-color: #4a4a4a;
}

footer p {
    margin-bottom: 8px;
    font-size: 14px;
}

/* Team Section (About Page) */

.team-section {
    padding: 48px 0;
    background-color: #ffffff;
    border-radius: 16px;
    margin: 32px 0;
}

body.dark-mode .team-section {
    background-color: #2d2d2d;
}

.team-section h2 {
    text-align: center;
}

.team-intro {
    text-align: center;
    font-size: 18px;
    margin-bottom: 48px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.team-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 32px;
    margin-top: 32px;
    justify-content: center;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.team-member {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 0 0 auto;
    width: 300px;
}

body.dark-mode .team-member {
    background-color: #2d2d2d;
    border-color: #4a4a4a;
}

.team-member:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.member-avatar {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    background-color: #e9ecef;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 24px;
    border: 3px solid #6366f1;
    overflow: hidden;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.dark-mode .member-avatar {
    background-color: #3a3a3a;
    border-color: #818cf8;
}

.team-member h3 {
    color: #6366f1;
    margin-bottom: 8px;
}

body.dark-mode .team-member h3 {
    color: #818cf8;
}

.member-role {
    font-weight: 600;
    color: #212529;
    margin-bottom: 16px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .member-role {
    color: #f8f9fa;
}

.member-bio {
    font-size: 15px;
    line-height: 1.6;
}

/* How to Help Section (Submit Page) */

.how-to-help {
    padding: 48px 0;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 100%));
    gap: 32px;
    margin-top: 32px;
}

.help-item {
    text-align: center;
    padding: 32px;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #dee2e6;
}

body.dark-mode .help-item {
    background-color: #2d2d2d;
    border-color: #4a4a4a;
}

.help-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.help-icon {
    font-size: 48px;
    margin-bottom: 24px;
}

.help-item h3 {
    color: #6366f1;
    margin-bottom: 16px;
}

body.dark-mode .help-item h3 {
    color: #818cf8;
}

.help-item p {
    margin: 0;
}

/* About Page Content */

.about-content {
    padding: 48px 0;
    background-color: #ffffff;
    border-radius: 16px;
    margin: 32px 0;
}

body.dark-mode .about-content {
    background-color: #2d2d2d;
}

.about-content article {
    max-width: 800px;
    margin: 0 auto;
}

.cta {
    text-align: center;
    padding: 48px 0;
}

/* Responsive Design - Tablet */
@media only screen and (min-width: 400px) and (max-width: 998px) {
    .header-content {
        gap: 16px;
        align-items: center;
    }
    
    .header-controls {
        display: flex;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
    }
    
    nav ul {
        display: flex;
        flex: 0 0 auto;           
        gap: 8px;                
        margin: 0;
        padding: 0;
        list-style: none;
    }
    nav ul li a {
        white-space: nowrap;
        padding: 8px 12px;
    }
    
    .hero {
        padding: 32px 24px;
    }
    
    .floor-grid {
        grid-template-columns: 50% 50%;
    }

    .floor-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .team-grid {
        flex-wrap: wrap;
    }
    
    .team-member {
        width: 45%;
        min-width: 220px;
    }
    
    .member-avatar {
        max-width: 180px;
    }
    
    .help-grid {
        grid-template-columns: 50% 50%;
    }
    
    h1 {
        font-size: 32px;
    }
    
    h2 {
        font-size: 26px;
    }
    #chart-container {
        padding: 20px;
        min-height: auto;
        align-items: stretch;

    }
}

/* Responsive Design - Mobile */
@media only screen and (max-width: 399px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-controls {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;             
        gap: 8px;
    }
    
    nav ul {
        display: flex;
        flex: 0 0 auto;       
        flex-wrap: wrap;          
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
    }
    nav ul li a {
        padding: 8px 12px;
        white-space: nowrap;
    }
    
    .hero {
        padding: 24px 16px;
    }
    
    .floor-grid {
        grid-template-columns: 100%;
    }

    .floor-grid--three {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        flex-wrap: wrap;
    }
    
    .team-member {
        width: 100%;
        max-width: 300px;
    }
    
    .member-avatar {
        max-width: 200px;
    }
    
    .help-grid {
        grid-template-columns: 100%;
    }

    .simple-form {
        padding: 0 8px;
    }

    .form-buttons {
        flex-direction: column;
    }

    .form-buttons .btn-primary,
    .form-buttons .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .btn-primary {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }
    
    .container {
        padding: 0 16px;
    }
    #chart-container {
        padding: 12px 8px;
        min-height: auto;
        align-items: stretch;
    }
}
