/* ===================================
   Tennis Network - Main Stylesheet
   Clean, modern, responsive design
   =================================== */

@import 'toast.css';

/* CSS Variables */
:root {
    /* Colors */
    --primary: #667eea;
    --primary-dark: #764ba2;
    --primary-light: #a5b4fc;
    --secondary: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-light: #cbd5e1;
    
    /* Background Colors */
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-lighter: #f1f5f9;
    --bg-dark: #0f172a;
    
    /* Borders */
    --border-color: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body:not(.auth-page) {
    background-color: var(--bg-white);
}

/* ===================================
   ACCESSIBILITY
   =================================== */

/* Enhanced focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    :root {
        --text-primary: #000000;
        --text-secondary: #1a1a1a;
        --border-color: #000000;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */

.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    margin: 0 auto;
    padding-top: env(safe-area-inset-top);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin: 0 auto;
    width: 100%;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto;
    padding: 15px 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    order: 1;
}

#mobileChat {
    display: none;
    order: 2;
}

#desktopChat {
    display: flex;
}

.mobile-menu-toggle {
    order: 3;
}

.brand-link {
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.3s ease;
}

.brand-link:hover {
    opacity: 0.9;
}

.brand-logo {
    width: 200px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

.navbar-brand h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 40px;
    order: 4;
}

.navbar-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    border-bottom-color: white;
}

.navbar-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-notification-dropdown {
    position: relative;
    align-self: center;
}

.chat-notification-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

.chat-notification-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 250px;
    max-width: 80vw;
    z-index: 1200;
    margin-top: 0;
}

.chat-notification-btn #chatNotificationBadge {
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 20px;
    position: absolute;
    top: 6px;
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: translateY(-50%) !important;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 12px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tn-app-bottom-nav {
    display: none;
}

.tn-app-messages-modal {
    display: none;
}

body.native-app.has-app-bottom-nav .main-header {
    display: none;
}

body.native-app.has-app-bottom-nav {
    --tn-native-app-top-spacing: calc(12px + env(safe-area-inset-top));
    --tn-native-app-bottom-spacing: calc(76px + env(safe-area-inset-bottom));
    --tn-native-modal-bottom-spacing: env(safe-area-inset-bottom);
}

body.native-app.has-app-bottom-nav .tn-app-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1400;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.1);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    transition: transform 0.2s ease, opacity 0.2s ease;
}

body.native-app.has-app-bottom-nav.tn-modal-open .tn-app-bottom-nav {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
}

body.native-app.has-app-bottom-nav.tn-scroll-nav-hidden:not(.tn-modal-open) .tn-app-bottom-nav {
    transform: translateY(calc(100% + env(safe-area-inset-bottom)));
    opacity: 0;
    pointer-events: none;
}

body.native-app.has-app-bottom-nav .tn-app-bottom-nav-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-align: center;
    border-radius: 10px;
    padding: 8px 4px;
    transform: translateY(0);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.18s ease;
}

body.native-app.has-app-bottom-nav .tn-app-bottom-nav-link::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    width: 22px;
    height: 3px;
    border-radius: 99px;
    background: transparent;
    transform: translateX(-50%) scaleX(0.45);
    transition: transform 0.22s ease, background-color 0.22s ease;
}

body.native-app.has-app-bottom-nav .tn-app-bottom-nav-icon {
    position: relative;
    font-size: 16px;
    line-height: 1;
}

body.native-app.has-app-bottom-nav .tn-app-messages-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
}

body.native-app.has-app-bottom-nav .tn-app-bottom-nav-label {
    font-size: 11px;
    line-height: 1.1;
}

body.native-app.has-app-bottom-nav .tn-app-bottom-nav-link.active,
body.native-app.has-app-bottom-nav .tn-app-bottom-nav-link[aria-current="page"] {
    color: var(--primary-dark);
    background: rgba(102, 126, 234, 0.12);
    animation: tn-tab-activate 240ms ease-out;
}

body.native-app.has-app-bottom-nav .tn-app-bottom-nav-link.active::before,
body.native-app.has-app-bottom-nav .tn-app-bottom-nav-link[aria-current="page"]::before {
    background: var(--primary);
    transform: translateX(-50%) scaleX(1);
}

body.native-app.has-app-bottom-nav .tn-app-bottom-nav-link.is-pressed {
    transform: translateY(1px) scale(0.98);
}

body.native-app.has-app-bottom-nav .main-content {
    padding-bottom: var(--tn-native-app-bottom-spacing);
    padding-top: env(safe-area-inset-top);
}

/* Keep all modal dialogs clear of native app bottom UI using the same global spacing token. */
body.native-app.has-app-bottom-nav .modal,
body.native-app.has-app-bottom-nav .info-modal,
body.native-app.has-app-bottom-nav .modal-overlay {
    padding-top: var(--tn-native-app-top-spacing) !important;
    padding-bottom: var(--tn-native-modal-bottom-spacing) !important;
    box-sizing: border-box;
}

body.native-app.has-app-bottom-nav .modal-dialog,
body.native-app.has-app-bottom-nav .info-modal .modal-dialog,
body.native-app.has-app-bottom-nav .modal-overlay .modal {
    height: auto !important;
    max-height: calc(100vh - var(--tn-native-app-top-spacing) - var(--tn-native-modal-bottom-spacing)) !important;
}

@keyframes tn-tab-activate {
    0% {
        transform: translateY(3px);
        opacity: 0.82;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===================================
   BREADCRUMBS
   =================================== */

.breadcrumbs {
    background-color: var(--bg-lighter);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
}

.breadcrumb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    color: var(--text-tertiary);
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-item.current {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Breadcrumb dropdown */
.breadcrumb-dropdown {
    position: relative;
}

.breadcrumb-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.breadcrumb-dropdown-toggle .dropdown-icon {
    color: var(--primary);
    transition: transform 0.2s ease;
}

.breadcrumb-dropdown-toggle:hover .dropdown-icon {
    color: var(--primary-dark);
}

.breadcrumb-dropdown-toggle .team-name-current {
    color: var(--text-secondary);
    font-weight: 500;
}

.breadcrumb-dropdown.open .dropdown-icon {
    transform: rotate(180deg);
}

.breadcrumb-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 350px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.breadcrumb-dropdown.open .breadcrumb-dropdown-menu {
    display: block;
}

.breadcrumb-dropdown-menu .dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.breadcrumb-dropdown-menu .dropdown-item:last-child {
    border-bottom: none;
}

.breadcrumb-dropdown-menu .dropdown-item:hover {
    background-color: var(--bg-lighter);
}

.breadcrumb-dropdown-menu .dropdown-item.active {
    background-color: var(--primary-lightest, #e6f0ff);
    font-weight: 500;
}

.breadcrumb-dropdown-menu .team-name {
    font-size: 12px;
    color: var(--text-primary);
}

.breadcrumb-dropdown-menu .team-role {
    font-size: 12px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

@media (max-width: 900px) {
    .main-header,
    .navbar,
    .navbar-container,
    .main-content {
        width: 100%;
        margin: 0;
    }

    .navbar-container {
        padding: 12px 16px;
    }

    .brand-logo {
        width: 140px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .navbar-menu {
        position: absolute;
        top: 88px;
        left: 16px;
        right: 16px;
        background: var(--bg-white);
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
        border-radius: 12px;
        box-shadow: var(--shadow-lg);
        z-index: 1300;
        opacity: 1;
        display: none !important;
    }

    .navbar-menu.active {
        display: flex !important;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 12px;
    }

    .navbar-auth {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .nav-link {
        color: var(--text-light);
        border-bottom: none;
        padding: 6px 0;
        font-size: 18px;
    }

    .nav-link:hover,
    .nav-link.active {
        color: var(--primary-light);
        border-bottom: none;
    }
}

@media (min-width: 1200px) {
    .main-header,
    .navbar,
    .navbar-container,
    .main-content,
    .breadcrumbs {
        min-width: 1200px;
    }
}

/* ===================================
   MAIN CONTENT AREA
   =================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px;
    width: 100%;
    flex: 1;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--primary-light);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* ===================================
   HERO SECTION
   =================================== */

.hero {
    text-align: center;
    margin-bottom: 5px;
    animation: slideDown 0.6s ease-out;
}

.hero-content {
    padding: 10px 40px;
}

.hero h2 {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--bg-dark);
    margin-bottom: 10px;
    line-height: 1.6;
}

.welcome-banner {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 10px 40px;
    margin: 5px 0;
    color: #3b3c3d;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-banner h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.welcome-email {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 20px;
}

/* ===================================
   FEATURES SECTION
   =================================== */

.section-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 50px;
    letter-spacing: -0.5px;
}

.features {
    margin-bottom: 80px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* ===================================
   HOW IT WORKS SECTION
   =================================== */

.how-it-works {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-lighter) 100%);
    border-radius: 16px;
    padding: 60px 40px;
    margin-bottom: 80px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-top: 40px;
    list-style: none;
    padding: 0;
}

.step {
    text-align: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
}

.step h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.step p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* ===================================
   CTA SECTION
   =================================== */

.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 40px;
}

.cta-section h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
}

.cta-section p {
    font-size: 16px;
    margin-bottom: 30px;
    opacity: 0.95;
}

/* ===================================
   FOOTER
   =================================== */

.main-footer {
    background: var(--primary-dark);
    color: white;
    padding: 60px 20px 20px;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.footer-section p {
    font-size: 14px;
    color: white;
    line-height: 1.6;
    margin: 0;
}

.footer-link {
    display: inline-block;
    color: #60a5fa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
}

.footer-app-link {
    margin-bottom: 12px;
}

.footer-play-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    color: white;
    font-weight: 600;
    margin-top: 0;
}

.footer-play-badge:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
}

.play-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 1;
}

.footer-app-qr-wrap {
    margin-top: 10px;
}

.footer-app-qr {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    background: white;
    padding: 6px;
}

.footer-app-qr-text {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.9;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 13px;
    color:  white;
}

.footer-bottom p {
    margin: 5px 0;
}

/* ===================================
   FORMS & INPUTS
   =================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.3s ease;
    background-color: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #6c757d;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary);
}

.auth-page input:invalid:not(:placeholder-shown),
.auth-page select:invalid:not([value=""]) {
    border-color: var(--danger);
}

.auth-page input:valid:not(:placeholder-shown),
.auth-page select:valid:not([value=""]) {
    border-color: var(--success);
}

/* ===================================
   MESSAGES & ALERTS
   =================================== */

.message {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    display: none;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.message:not(:empty) {
    display: block;
}

.message::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 6px;
    background: currentColor;
    opacity: 0.25;
}

.message p {
    margin: 0;
    position: relative;
}

.message-success {
    background-color: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}

.message-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.message-warning {
    background-color: #fffbeb;
    color: #b45309;
    border-color: #fcd34d;
}

.message-info {
    background-color: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.message.note {
    font-size: 10px;
    font-weight: 400;
}

/* Join Code Feedback */
.join-code-feedback {
    font-size: 13px;
    margin-top: 5px;
    min-height: 18px;
}

.join-code-feedback.checking {
    color: #666;
}

.join-code-feedback.available {
    color: #28a745;
}

.join-code-feedback.unavailable,
.join-code-feedback.invalid {
    color: #dc3545;
}

.join-code-feedback.error {
    color: #ff6b6b;
}

/* Teams / Cards */
.teams-section .tabs {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.teams-section .card {
    background-color: #cdd6e4;
    border-radius: 14px;
}

.tabs .tab {
    padding: 10px 14px;
    border-radius: 10px;
    background: #f6f7fb;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.tabs .tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tabs .tab.active {
    background: #eef2ff;
    color: var(--primary-dark);
    border-color: #c7d2fe;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.12);
}

.card {
    background: var(--bg-white);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.team-form .form-grid,
.filter-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.team-form .form-group.full-width {
    grid-column: 1 / -1;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.team-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: #475569;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 6px;
}

.icon-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.icon-btn--active {
    color: var(--primary);
    border-color: var(--primary);
    background: #eef2ff;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.team-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.team-card .badge {
    background: #eef2ff;
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.team-card .card-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.team-detail .team-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.team-detail .team-layout > .card:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.team-detail .team-layout > .card:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.team-detail .team-layout > .matches-container {
    grid-column: 2;
    grid-row: 2;
}

.team-detail .team-layout.no-polls > .matches-container {
    grid-row: 1;
}

/* Event Detail Page Layout (mirrors team-layout pattern) */
.event-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 1rem;
}

.event-layout > .event-main {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.event-layout > .event-sidebar {
    grid-column: 2;
    grid-row: 1;
}

.data-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-bottom: 16px;
}

.data-list dt {
    font-weight: 700;
    color: #374151;
}

.data-list dd {
    margin: 0;
    color: #4b5563;
}

.muted {
    color: var(--text-light);
    margin: 0;
}

.team-header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #eef2ff;
    color: var(--primary-dark);
}

.badge-soft {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.badge-success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-warn {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fdba74;
}

@media (max-width: 900px) {
    .team-detail .team-layout {
        grid-template-columns: 1fr;
    }
    
    .team-detail .team-layout > .card:first-child,
    .team-detail .team-layout > .card:nth-child(2),
    .team-detail .team-layout > .matches-container {
        grid-column: 1;
        grid-row: auto;
    }

    .event-layout {
        grid-template-columns: 1fr;
    }

    .event-layout > .event-main,
    .event-layout > .event-sidebar {
        grid-column: 1;
        grid-row: auto;
    }

    .event-layout > .event-sidebar {
        display: none;
    }
}

/* ===================================
   AUTH PAGES
   =================================== */

body.auth-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    align-items: center;
    justify-content: center;
    padding: 0 20px 20px 20px;
}

.auth-page .main-header {
    position: static;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: 20px 20px;
}

.auth-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px 30px;
    text-align: center;
    color: white;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-header p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
    margin: 0;
}

.auth-form {
    padding: 20px 30px;
}

.auth-step {
    animation: fadeIn 0.3s ease-out;
}

.auth-step.hidden {
    display: none;
}

.btn-back {
    margin-top: 10px;
}

.auth-footer {
    background: var(--bg-light);
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-dark);
}

.login-app-prompt {
    margin: 16px 30px 0;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-light);
}

.login-app-prompt.hidden {
    display: none;
}

.login-app-prompt-title {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--text-primary);
}

.login-app-prompt-text {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.login-app-prompt-btn {
    margin-top: 12px;
}

.login-play-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 480px) {
    .auth-card {
        border-radius: 8px;
    }
    
    .auth-header {
        padding: 30px 20px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-form {
        padding: 30px 20px;
    }
    
    .auth-footer {
        padding: 15px 20px;
    }

    .login-app-prompt {
        margin: 14px 20px 0;
    }
    
    .auth-page .form-group {
        margin-bottom: 16px;
    }
    
    .auth-page .form-group input,
    .auth-page .form-group select {
        padding: 10px 12px;
        font-size: 16px;
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .navbar-container {
        padding: 8px 12px;
        gap: 6px;
    }

    .brand-logo {
        width: 120px;
    }

    .breadcrumbs {
        font-size: 11px;
        padding: 8px 12px;
    }

    .breadcrumb-dropdown-menu {
        left: 10vw;
        right: auto;
        width: 80vw;
        min-width: 0;
        max-width: 80vw;
        box-sizing: border-box;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .navbar-menu {
        position: absolute;
        top: 82px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        gap: 0;
        padding: 20px;
        border-radius: 0;
        z-index: 1300;
        opacity: 1;
        display: none !important;
        width: 100%;
        box-shadow: var(--shadow-lg);
    }

    .navbar-menu.active {
        display: flex !important;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding-bottom: 15px;
    }

    .nav-link {
        border-bottom: none;
        padding: 8px 0;
        font-size: 18px;
        color: var(--text-light);
    }

    .navbar-auth {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .section-header h2 {
        font-size: 16px;
    }

    .user-menu {
        flex-direction: column;
        width: 100%;
    }

    .hero h2 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-content {
        padding: 5px 20px;
    }

    .section-title {
        font-size: 28px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn,
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .how-it-works {
        padding: 40px 20px;
    }

    .cta-section {
        padding: 40px 20px;
    }

    .welcome-banner h3 {
        font-size: 16px;
    }

    .welcome-banner h1 {
        font-size: 20px;
    }

    /* Mobile chat notification - show between logo and hamburger */
    #mobileChat {
        display: flex !important;
        order: 2;
    }

    /* Hide desktop chat on mobile */
    #desktopChat {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 12px 15px;
    }

    .navbar-brand h1 {
        font-size: 20px;
    }

    .hero h2 {
        font-size: 24px;
    }

    .features-grid {
        gap: 20px;
    }

    .feature-card {
        padding: 20px;
    }

    .feature-icon {
        font-size: 36px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .container {
        padding: 10px;
    }

    .card {
        padding: 10px;
        margin-bottom: 12px;
    }

    .cta-section h2 {
        font-size: 24px;
    }

    .auth-card {
        border-radius: 8px;
    }

    .auth-header {
        padding: 30px 20px;
    }

    .auth-form {
        padding: 30px 20px;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
/* ===================================
   CONTACT PAGE
   =================================== */

.contact-section {
    padding: 40px 0;
}

.section-intro {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 40px;
    line-height: 1.6;
}

.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.contact-form-wrapper {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.contact-form .form-group {
    margin-bottom: 24px;
}

.contact-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-card {
    background: var(--bg-light);
    padding: 24px 5px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.info-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.info-item {
    margin-bottom: 5px;
}

.info-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.info-item a {
    color: var(--primary);
    text-decoration: none;
}

.info-item a:hover {
    text-decoration: underline;
}

.info-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 5px;
    margin-bottom: 0;
    font-style: italic;
}

/* ===================================
   STATIC PAGES (ABOUT, FAQ, LEGAL)
   =================================== */

.about-section,
.faq-section,
.legal-section {
    padding: 40px 0;
    max-width: 900px;
    margin: 0 auto;
}

.content-block {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
}

.content-block h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.content-block h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 12px;
}

.content-block p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.content-block ul {
    margin: 16px 0;
    padding-left: 24px;
}

.content-block li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.content-block a {
    color: var(--primary);
    text-decoration: none;
}

.content-block a:hover {
    text-decoration: underline;
}

.last-updated {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 32px;
}

/* FAQ specific styles */
.faq-category {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
}

.faq-category h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

.faq-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.faq-item p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.faq-item ul {
    margin: 12px 0;
    padding-left: 24px;
}

.faq-item li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.faq-item strong {
    color: var(--text-primary);
}

/* Responsive adjustments for static pages */
@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-form-wrapper {
        padding: 24px;
    }
    
    .content-block {
        padding: 24px;
    }
    
    .faq-category {
        padding: 24px;
    }
}
/* ===================================
   PROFILE PAGE
   =================================== */

.profile-section {
    padding: 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.profile-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.profile-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-primary);
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.profile-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.profile-form .form-group {
    margin-bottom: 24px;
}

.profile-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.profile-form input,
.profile-form select,
.profile-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.profile-form input:disabled {
    background-color: var(--bg-light);
    cursor: not-allowed;
}

.profile-form small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-form textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-weight: 600;
    color: var(--text-primary);
}

.status-value {
    color: var(--text-secondary);
}

.status-value.verified {
    color: var(--success-color);
    font-weight: 600;
}

.status-value.unverified {
    color: var(--error-color);
}

.quick-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-links li {
    margin-bottom: 12px;
}

.quick-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.quick-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-card {
        padding: 24px;
    }
    
    .profile-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* Profile Photo Upload */
.photo-upload-section {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.current-photo {
    flex-shrink: 0;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

.photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    font-weight: 700;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

.photo-upload-controls {
    flex: 1;
}

.file-input {
    display: none;
}

.section-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

@media (max-width: 768px) {
    .photo-upload-section {
        flex-direction: column;
        text-align: center;
    }
}
/* ===================================
   Dashboard Styles
   =================================== */

.dashboard-section {
    margin: 10px 0;
    animation: fadeIn 0.3s ease-in;
}

.dashboard-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--bg-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
}

.section-header h2 {
    margin: 0;
}

.section-header .btn-small {
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}

/* Team Cards */
.dashboard-grid {
    display: grid;
    gap: 40px;
}

.section-group {
    display: grid;
    gap: 20px;
}

.section-group h3 {
    color:#e4e8f5;
}

.subsection-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.team-card,
.card-link {
    display: block;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
}

.team-card:hover,
.card-link:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.card-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.card-content {
    display: grid;
    gap: 5px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--bg-lighter);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-item .value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-captain {
    background-color: rgba(102, 126, 234, 0.15);
    color: #5a67d8;
}

.badge-cocaptain {
    background-color: rgba(6, 182, 212, 0.15);
    color: #0891b2;
}

.badge-player {
    background-color: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.badge-alert {
    background-color: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.badge-info {
    background-color: rgba(96, 165, 250, 0.15);
    color: #2563eb;
}

/* Action Items Section */
.action-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.action-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.action-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.action-card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.action-card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.action-card-content {
    padding: 20px;
    flex-grow: 1;
}

.pending-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.pending-list li {
    display: block;
}

.pending-team-group {
    margin-bottom: 15px;
}

.pending-team-group h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.pending-list ul {
    list-style: none;
    margin: 0;
    padding: 0 0 0 15px;
    display: grid;
    gap: 6px;
}

.pending-list ul li {
    font-size: 13px;
    color: var(--text-secondary);
    display: block;
    padding-left: 0;
}

.pending-list ul li:before {
    content: "→ ";
    color: var(--secondary);
    font-weight: 600;
    margin-right: 5px;
}

.pending-match {
    display: block;
    color: var(--text-secondary);
}

.pending-match-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-lighter);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    margin: 2px 0;
}

.pending-match-link:hover {
    background: var(--primary-light);
    transform: translateX(3px);
    box-shadow: var(--shadow-sm);
}

.pending-match-date {
    font-weight: 600;
    color: var(--primary);
    font-size: 13px;
    min-width: 50px;
}

.pending-match-opponent {
    color: var(--text-secondary);
    font-size: 14px;
    flex: 1;
}

.pending-match-meta {
    display: block;
    color: #6b7280;
    margin-top: 2px;
}

.pending-more {
    font-style: italic;
    color: var(--text-tertiary);
    padding: 8px 0;
    margin-top: 5px;
}

.poll-item {
    display: grid;
    gap: 5px;
}

.poll-link {
    display: block;
    text-decoration: none !important;
    color: var(--text-primary);
    padding: 8px 10px;
    background: var(--bg-lighter);
    border-radius: 6px;
    transition: all 0.2s ease;
    margin: 2px 0;
    font-size: 14px;
}

.poll-link:hover {
    background: var(--primary-light);
    transform: translateX(3px);
    box-shadow: var(--shadow-sm);
    text-decoration: none !important;
}

.match-item {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    background: var(--bg-lighter);
    border-radius: 8px;
}

.match-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    background: var(--bg-lighter);
    border-radius: 8px;
}

.match-link:hover {
    background: var(--primary-light);
    transform: translateX(3px);
    box-shadow: var(--shadow-sm);
}

.match-date {
    font-weight: 600;
    color: var(--primary);
    font-size: 13px;
    white-space: nowrap;
}

.match-opponent {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.match-team-name {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.match-vs {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
}

.match-availability {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.availability-yes {
    background-color: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.availability-maybe {
    background-color: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.availability-no {
    background-color: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.availability-pending {
    background-color: rgba(96, 165, 250, 0.15);
    color: #2563eb;
}

/* Action Card Specific Styles */
.action-card-availability {
    border-left: 4px solid var(--secondary);
}

.action-card-polls {
    border-left: 4px solid var(--primary);
}

.action-card-matches {
    border-left: 4px solid var(--warning);
}

.action-card-stats {
    border-left: 4px solid var(--success);
    position: relative;
    overflow: visible;
}

.team-stats-click-target {
    position: relative;
    cursor: pointer;
}

.team-stats-click-target:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.team-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.team-stats-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.team-stats-container {
    position: relative;
}

.team-quick-select {
    position: absolute;
    top: calc(100% + 8px);
    left: 20px;
    right: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 10px;
    padding: 12px;
    display: none;
    z-index: 10;
}

.team-quick-select.open {
    display: block;
}

.team-quick-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.team-quick-select-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

.team-quick-select-list {
    display: grid;
    gap: 8px;
}

.snapshot-drilldown {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 50%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 20;
    max-height: min(52vh, 440px);
    overflow: auto;
}

.snapshot-drilldown.open {
    display: block;
}

.snapshot-drilldown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.snapshot-drilldown-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

.snapshot-drilldown-list {
    display: grid;
    gap: 8px;
    padding: 10px 12px 12px;
}

.snapshot-drilldown-item {
    display: block;
    text-decoration: none;
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.snapshot-drilldown-item:hover,
.snapshot-drilldown-item:focus {
    background: var(--primary-light);
    border-color: var(--primary);
    outline: none;
}

.snapshot-drilldown-item-title {
    font-size: 13px;
    font-weight: 700;
}

.snapshot-drilldown-item-meta {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.snapshot-drilldown-score {
    display: inline-block;
    margin-top: 7px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #065f46;
    background: rgba(16, 185, 129, 0.15);
}

.snapshot-drilldown-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 12px;
    font-size: 13px;
}

.team-quick-select-item {
    width: 100%;
    text-align: left;
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.team-quick-select-item:hover,
.team-quick-select-item:focus {
    background: var(--primary-light);
    border-color: var(--primary);
    outline: none;
}

.team-quick-select-title {
    margin: 0;
}

.team-quick-select-item small {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-footer-link {
    display: block;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.card-footer-link:hover {
    background: var(--bg-lighter);
    padding-left: 25px;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.stats-grid-upcoming {
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 900px) {
    .stats-grid-upcoming {
        grid-template-columns: repeat(3, 1fr);
    }
}

.match-stats-section {
    position: relative;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 900px) {
    .snapshot-drilldown {
        left: 8px;
        right: 8px;
        top: 48%;
        max-height: min(58vh, 460px);
    }
}

.match-stats-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.match-stats-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-lighter);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

.team-stat-clickable {
    cursor: pointer;
    user-select: none;
}

.team-stat-clickable:hover {
    background: var(--primary-light);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.team-stat-clickable:active {
    transform: scale(0.98);
}

.stat-yes {
    background: rgba(16, 185, 129, 0.1);
}

.stat-yes:hover {
    background: rgba(16, 185, 129, 0.2);
}

.stat-maybe {
    background: rgba(245, 158, 11, 0.1);
}

.stat-maybe:hover {
    background: rgba(245, 158, 11, 0.2);
}

.stat-no {
    background: rgba(239, 68, 68, 0.1);
}

.stat-no:hover {
    background: rgba(239, 68, 68, 0.2);
}

.stat-won {
    background: rgba(16, 185, 129, 0.1);
}

.stat-won:hover {
    background: rgba(16, 185, 129, 0.2);
}

.stat-lost {
    background: rgba(239, 68, 68, 0.1);
}

.stat-lost:hover {
    background: rgba(239, 68, 68, 0.2);
}

.stat-pending {
    background: rgba(239, 68, 68, 0.1);
}

.stat-pending:hover {
    background: rgba(239, 68, 68, 0.2);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    text-align: center;
    gap: 10px;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn .icon {
    font-size: 32px;
}

.quick-action-btn .text {
    font-weight: 600;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .action-items-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-section {
        margin: 30px 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-header .btn-small {
        width: 100%;
        text-align: center;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .action-items-grid {
        grid-template-columns: 1fr;
    }
    
    .match-item {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .match-link {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }
    
    .match-date {
        order: -1;
        flex-shrink: 0;
    }

    .match-opponent {
        flex: 1;
        min-width: 0;
    }

    .match-availability {
        flex-shrink: 0;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid-matches {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid-upcoming {
        grid-template-columns: repeat(2, 1fr);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.native-app.has-app-bottom-nav .tn-app-messages-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: none;
}

body.native-app.has-app-bottom-nav .tn-app-messages-modal.is-open {
    display: block;
}

body.native-app.has-app-bottom-nav .tn-app-messages-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
}

body.native-app.has-app-bottom-nav .tn-app-messages-modal-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(70vh, 620px);
    background: #fff;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    box-shadow: 0 -14px 36px rgba(2, 6, 23, 0.28);
    overflow: hidden;
    transform: translateY(10px);
    animation: tn-messages-sheet-in 180ms ease-out forwards;
}

body.native-app.has-app-bottom-nav .tn-app-messages-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

body.native-app.has-app-bottom-nav .tn-app-messages-modal-header h2 {
    margin: 0;
    font-size: 16px;
    color: #111827;
}

body.native-app.has-app-bottom-nav .tn-app-messages-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

body.native-app.has-app-bottom-nav .tn-app-messages-modal-list {
    overflow-y: auto;
    max-height: calc(min(70vh, 620px) - 62px);
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

body.native-app.has-app-bottom-nav .tn-app-more-modal-list {
    display: grid;
    gap: 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

body.native-app.has-app-bottom-nav .tn-app-more-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
    text-decoration: none;
    font-weight: 600;
}

body.native-app.has-app-bottom-nav .tn-app-more-link:last-child {
    border-bottom: none;
}

body.native-app.has-app-bottom-nav .tn-app-more-link-icon {
    font-size: 18px;
    line-height: 1;
}

body.native-app.has-app-bottom-nav .tn-app-more-link-label {
    font-size: 15px;
    line-height: 1.2;
}

@keyframes tn-messages-sheet-in {
    0% {
        opacity: 0.8;
        transform: translateY(14px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}