/* Main Layout, CSS Grid Architecture & Device Responsiveness
   Supports: 320px, 360px, 390px, 414px, 768px, 1024px, 1366px, 1440px, 1920px+, Landscape & Portrait */

@import url('./material3.css');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    line-height: 1.6;
    padding-bottom: 80px; /* Safe space for mobile bottom navigation */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header & Navigation Bar */
.navbar {
    background: var(--md-sys-color-primary);
    color: #ffffff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 950;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
}

.nav-brand svg {
    width: 32px;
    height: 32px;
    fill: var(--md-sys-color-secondary);
}

.nav-brand span {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    list-style: none;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.nav-user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Responsive Container */
.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Responsive Grid System */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 24px;
}

/* Responsive Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, #800020 0%, #4a0013 100%);
    color: white;
    border-radius: var(--md-shape-large);
    padding: 44px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    box-shadow: var(--md-elevation-3);
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 640px;
    z-index: 2;
}

.hero-content h1 {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 14px;
    font-family: var(--font-heading);
}

.hero-content p {
    font-size: 17px;
    opacity: 0.92;
    margin-bottom: 26px;
}

/* Form Styles */
.form-card {
    background: white;
    padding: 32px;
    border-radius: var(--md-shape-large);
    max-width: 580px;
    margin: 20px auto;
    box-shadow: var(--md-elevation-2);
    border: 1px solid rgba(128, 0, 32, 0.08);
}

.form-field {
    margin-bottom: 18px;
}

.form-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
}

.form-field input, .form-field select, .form-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.12);
}

/* Buttons */
.btn-primary {
    background: var(--md-sys-color-primary);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--md-shape-small);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
    min-height: 44px; /* Accessible Touch Target */
}

.btn-primary:hover {
    background: #600018;
}

.btn-accent {
    background: var(--md-sys-color-secondary);
    color: #000000;
    border: none;
    padding: 12px 24px;
    border-radius: var(--md-shape-small);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-gold { background: #fff3cd; color: #856404; }
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-burgundy { background: rgba(128, 0, 32, 0.1); color: #800020; }

/* Media Elements */
img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   DEVICE BREAKPOINT MEDIA QUERIES
   ========================================================================== */

/* 1. Ultra-Wide & TV Browsers (1920px+) */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    .grid-cards {
        grid-template-columns: repeat(4, 1fr);
    }
    .hero-banner {
        padding: 60px 50px;
    }
    .hero-content h1 {
        font-size: 46px;
    }
}

/* 2. Desktop & Laptops (1366px to 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    .grid-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 3. Tablets & Chromebooks (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: 20px 16px;
    }
    .grid-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .hero-banner {
        padding: 36px 24px;
    }
    .hero-content h1 {
        font-size: 32px;
    }
    .nav-links {
        gap: 10px;
    }
    .nav-links a {
        font-size: 14px;
        padding: 6px 10px;
    }
}

/* 4. Small Tablets & Mobile Devices (<768px) */
@media (max-width: 767px) {
    body {
        padding-bottom: 75px;
    }
    .nav-links {
        display: none; /* Hidden on mobile; bottom nav is used */
    }
    .navbar {
        padding: 10px 16px;
    }
    .nav-brand span {
        font-size: 18px;
    }
    .container {
        padding: 16px 12px;
    }
    .hero-banner {
        padding: 26px 18px;
        flex-direction: column;
        text-align: center;
    }
    .hero-content h1 {
        font-size: 26px;
    }
    .hero-content p {
        font-size: 14px;
    }
    .grid-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .form-card {
        padding: 20px 16px;
    }
    /* Auto-stack two-column forms on mobile */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* 5. Small Smartphone Screens (320px, 360px, 390px) */
@media (max-width: 414px) {
    .nav-brand span {
        font-size: 16px;
    }
    .nav-user-actions select {
        font-size: 12px;
        padding: 2px 4px;
    }
    .btn-primary, .btn-accent {
        width: 100%;
        text-align: center;
    }
}
