:root {
    --color-bg: #0a0a0a;
    --color-surface: rgba(30, 30, 30, 0.6);
    --color-surface-hover: rgba(45, 45, 45, 0.8);
    --color-primary: #e61919;
    --color-primary-hover: #ff3333;
    --color-text: #ffffff;
    --color-text-muted: #a0a0a0;
    --color-border: rgba(255, 255, 255, 0.1);
    
    --font-main: 'Outfit', sans-serif;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --blur-glass: blur(12px);
    
    --pitch-green-dark: #2a3b2c;
    --pitch-green-light: #324534;
    --pitch-line: rgba(255,255,255,0.6);
    
    color-scheme: dark; /* Forces native browser pickers (date/time) to use their dark theme */
}

/* Base Root Typography */
html {
    font-size: 16px; /* Base for mobile & small tablets */
}

@media (min-width: 1024px) {
    html {
        font-size: 20px; /* Scales base typography (~14px) up to ~18px-19px proportionally for laptop & desktop screens */
    }
}

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

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(230, 25, 25, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(230, 25, 25, 0.05), transparent 25%);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 1440px;
    min-height: 100vh;
    padding: 1rem;
    position: relative;
}

/* Glassmorphism Utilities */
.glass-card {
    background: var(--color-surface);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-glass);
}

/* View Management */
.view {
    display: none;
    height: 100%;
    width: 100%;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Typography & Brand */
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.logo-red {
    color: var(--color-primary);
}

.logo-pro {
    font-weight: 300;
    color: var(--color-text-muted);
}

h2, h3, h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.text-sm {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

/* Form Elements */
.input-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    caret-color: white; /* Ensure cursor is always visible */
}

input:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(230, 25, 25, 0.15); /* Subtle red to maintain theme and visibility */
}

/* Style the native dropdown options */
select option {
    background-color: var(--color-primary);
    color: white;
}

.file-input {
    display: none; /* Hide default input, label acts as button */
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #a30000);
    color: white;
    box-shadow: 0 4px 15px rgba(230, 25, 25, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 25, 25, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    padding: 0.5rem 1rem;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Auth View Specifics */
#auth-view,
#signup-view {
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem 0;
}

.login-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 2.2rem;
    text-align: center;
}

#signup-view .login-card {
    max-width: 560px;
    margin: 0 auto;
}

.error-msg {
    color: var(--color-primary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    min-height: 1.2rem;
}

.mock-note {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* App Layout */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.app-header .logo {
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background-color: var(--color-surface);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 250;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.dropdown-content.show {
    display: block !important;
}

.dropdown-content a {
    color: var(--color-text);
    padding: 12px 18px;
    text-decoration: none;
    display: block;
    transition: background 0.2s;
    font-size: 0.95rem;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
}

.dropdown-content a#logout-link {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #f87171;
}

.dropdown-content a#logout-link:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-content a.active {
    background-color: rgba(230, 25, 25, 0.2);
    color: white;
    font-weight: 600;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    background: rgba(255, 255, 255, 0.1);
}

/* Page Views */
.page-view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.page-view.active {
    display: block;
    flex-grow: 1;
}

/* --- Game Details View Styles --- */
.game-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.gd-info h2 {
    margin-bottom: 0.2rem;
    color: white;
}

.gd-info p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.quarter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.stat-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: white;
    color: black;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    pointer-events: auto; /* Allow clicking for removal */
}



/* Custom Scrollbar */
.page-view::-webkit-scrollbar {
    width: 8px;
}
.page-view::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
.page-view::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}
.page-view::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-hover);
}

.page-card {
    padding: 2rem;
    text-align: center;
    margin: 2rem auto;
    max-width: 600px;
}

.dashboard.single-col {
    display: block;
}

/* Schedule View Styles */
.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.schedule-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.toggle-group {
    display: inline-flex;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    flex-shrink: 0;
}

.btn-toggle {
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-toggle:hover {
    background: rgba(255,255,255,0.05);
}

.btn-toggle.active {
    background: var(--color-primary);
    color: white;
}

.schedule-list-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 5rem; /* space for FAB */
}

.month-group h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.game-item {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    align-items: center;
    transition: transform 0.2s;
}

.player-item {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    cursor: grab;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.player-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: space-between;
}

.player-name {
    font-weight: 500;
}

.player-position {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.game-item:hover {
    transform: translateX(5px);
    border-color: rgba(255,255,255,0.3);
}

.game-date-col {
    width: 80px;
    text-align: center;
    border-right: 1px solid var(--color-border);
    padding-right: 1rem;
    margin-right: 1rem;
}

.game-date-col .day-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}

.game-date-col .day-name {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

.game-details-col {
    flex-grow: 1;
}

.game-opponent {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.game-meta {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.location-map-link {
    color: #60a5fa;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s ease;
    border-radius: 4px;
    padding: 0.1rem 0.3rem;
    margin: -0.1rem -0.3rem;
}

.location-map-link:hover {
    color: #93c5fd;
    text-decoration: underline;
    background: rgba(96, 165, 250, 0.12);
}

.location-map-link:active {
    transform: scale(0.97);
}

/* Schedule Bulk Action Bar & Selection */
.schedule-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.bulk-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bulk-select-all-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
}

.bulk-select-all-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.bulk-count-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.btn-danger-soft {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.btn-danger-soft:not(:disabled):hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.btn-danger-soft:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.game-item.selectable {
    cursor: pointer;
    user-select: none;
}

.game-item.selected {
    background: rgba(230, 25, 25, 0.08);
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(230, 25, 25, 0.25);
}

.game-select-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 1rem;
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #a30000);
    color: white;
    font-size: 2rem;
    font-weight: 300;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(230, 25, 25, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 50;
}

.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(230, 25, 25, 0.7);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 1rem;
}

.modal-content p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Roster Management (Component 5) */
.roster-header-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem 1rem 2.5rem; /* Account for drag handle space */
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.sortable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sortable-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: background 0.2s, box-shadow 0.2s;
}

.sortable-item:active {
    cursor: grabbing;
}

.sortable-item.dragging {
    opacity: 0.5;
    background: rgba(230, 25, 25, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.sortable-item .drag-handle {
    margin-right: 1rem;
    color: var(--color-text-muted);
    font-size: 1.2rem;
    cursor: grab;
}

.sortable-item-name {
    flex-grow: 1;
    font-weight: 500;
}

.sortable-item-positions {
    display: flex;
    gap: 0.5rem;
}

.sortable-item-positions select {
    width: 80px;
    padding: 0.4rem;
    font-size: 0.85rem;
    text-align: center;
}

.dashboard {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 100px);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
}

.ocr-section {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.status-msg {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.roster-list {
    flex-grow: 1;
    min-height: 200px;
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    transition: background 0.2s;
}

.roster-list.drag-over {
    background: rgba(255, 255, 255, 0.05);
}

/* Draggable Player Items */
.player-item {
    position: relative;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    transition: transform 0.1s;
}

.player-item:active {
    cursor: grabbing;
}

.player-info {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.player-pos {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Player on Field */
.player-token {
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 10;
}

.player-token:active {
    cursor: grabbing;
}

.formation-dot {
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}
.formation-dot:hover {
    border-color: rgba(255, 255, 255, 0.8);
    color: rgba(255, 255, 255, 0.8);
}

.formation-dot.filled {
    background: var(--color-primary);
    border: 2px solid white;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.formation-dot.filled:hover {
    border-color: white;
}

.player-token-name {
    position: absolute;
    bottom: -22px;
    white-space: nowrap;
    font-size: 0.75rem;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.tactics-area {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gd-layout-wrapper {
    display: flex;
    gap: 1rem;
    flex-grow: 1;
}

.roster-sidebar {
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.stats-sidebar {
    min-width: 80px;
    text-align: center;
}

.stats-sidebar > *:not(:last-child) {
    margin-bottom: 1rem;
}

.stats-help {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.tactics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.formation-selector {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.formation-selector select {
    min-width: 90px;
}

/* Soccer Field */
.soccer-field {
    flex-grow: 1;
    height: 750px;
    background: repeating-linear-gradient(
        0deg,
        var(--pitch-green-dark),
        var(--pitch-green-dark) 40px,
        var(--pitch-green-light) 40px,
        var(--pitch-green-light) 80px
    );
    border-radius: 12px;
    border: 2px solid var(--pitch-line);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}

.pitch-lines {
    position: absolute;
    top: 5%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    border: 2px solid var(--pitch-line);
    pointer-events: none; /* Let drops go to field */
}

.center-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--pitch-line);
}

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 2px solid var(--pitch-line);
    border-radius: 50%;
}

.center-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--pitch-line);
    border-radius: 50%;
}

.penalty-box {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 100px;
    border: 2px solid var(--pitch-line);
}

.penalty-box.top {
    top: 0;
    border-top: none;
}

.penalty-box.bottom {
    bottom: 0;
    border-bottom: none;
}

.six-yard-box {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 40px;
    border: 2px solid var(--pitch-line);
}

.penalty-box.top .six-yard-box {
    top: 0;
    border-top: none;
}

.penalty-box.bottom .six-yard-box {
    bottom: 0;
    border-bottom: none;
}

.penalty-spot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--pitch-line);
    border-radius: 50%;
}

.penalty-box.top .penalty-spot {
    bottom: 20px;
}

.penalty-box.bottom .penalty-spot {
    top: 20px;
}

/* Game Details Additions */
.quarter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--color-text);
    background: rgba(230, 25, 25, 0.2);
    border-bottom: 2px solid var(--color-primary);
}

.game-item {
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.game-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.02);
}

.stat-icon:active {
    cursor: grabbing;
}

.stat-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--color-primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 12px;
    border: 1px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
    z-index: 20;
}

@media (max-width: 900px) {
    .dashboard {
        display: flex;
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        height: auto;
        max-height: 40vh; /* Prevents sidebar from pushing everything off screen */
    }

    .gd-layout-wrapper {
        flex-direction: column;
    }

    .roster-sidebar, .stats-sidebar {
        min-width: 100%;
        max-height: 25vh;
        flex-direction: row !important;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .roster-sidebar h3, .stats-sidebar h3 {
        display: none; /* Hide header to save space */
    }

    .roster-list {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }

    .player-item {
        min-width: 150px; /* Keep them horizontal */
    }

    .stats-sidebar {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        padding: 0.5rem;
    }
    
    .stats-sidebar > *:not(:last-child) {
        margin-bottom: 0;
    }
}

/* Responsive Mobile Improvements for Phone (e.g. Pixel 9) */
.gd-header-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

#gd-saved-lineups-dropdown {
    width: 100%;
}

#gd-saved-lineups-list {
    min-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    right: 0;
    left: auto;
}

.admin-form-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.admin-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
    padding-right: 0.5rem;
}

.admin-user-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.admin-user-email {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    word-break: break-all;
}

.admin-user-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.role-select {
    width: auto !important;
    min-width: 125px !important;
    max-width: 155px !important;
    padding: 0.4rem 0.5rem !important;
    font-size: 0.85rem !important;
    text-align: left !important;
}

.btn-edit-user, .btn-delete-user {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    padding: 0.2rem;
    color: var(--color-primary);
    line-height: 1;
}

@media (max-width: 680px) {
    /* 1. Admin Page mobile */
    .admin-form-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    .admin-form-row .input-group {
        width: 100% !important;
        min-width: 100% !important;
    }
    .admin-form-row button {
        width: 100% !important;
    }

    /* 2. Game Day Saved Lineup Dropdown */
    .gd-header-actions {
        width: 100% !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.5rem !important;
    }
    #gd-saved-lineups-dropdown {
        width: auto !important;
    }
    #gd-saved-lineups-list {
        left: 0 !important;
        right: auto !important;
        max-width: calc(100vw - 2.5rem) !important;
    }

    /* 3. Tactics Header overlapping Size */
    .tactics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .tactics-header h2,
    .tactics-header h3 {
        margin: 0;
        width: 100%;
    }
    .formation-selector {
        width: 100%;
        justify-content: flex-start;
    }

    /* 4. Schedule Page actions & Past Games button */
    .schedule-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .schedule-header h2 {
        margin-bottom: 0.25rem;
    }
    .schedule-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.6rem;
    }
    .schedule-actions > label[for="schedule-upload"] {
        grid-column: 1 / -1;
        width: 100%;
        text-align: center;
        margin: 0;
        box-sizing: border-box;
    }
    .schedule-actions .toggle-group {
        display: flex;
        width: 100%;
        min-width: 0;
    }
    .schedule-actions .toggle-group .btn-toggle {
        flex: 1;
        text-align: center;
        padding: 0.5rem 0.4rem;
        font-size: 0.85rem;
    }
    .schedule-actions #btn-select-games {
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* 5. Stats Table Mobile */
    .stats-table-header, .stats-player-row {
        padding: 0.6rem 0.6rem;
        min-width: 460px;
        grid-template-columns: minmax(100px, 1fr) 68px 80px 68px 46px 46px;
        gap: 0.3rem;
    }
    .stats-table-body {
        min-width: 460px;
    }
    .stats-player-info {
        gap: 0.5rem;
        min-width: 0;
    }
    .stats-player-name-text {
        font-size: 0.88rem;
    }
    .stats-player-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    .col-stat {
        font-size: 0.78rem;
    }
    .stats-player-val {
        font-size: 0.95rem;
    }
}


/* Final Score Styling */
.score-box:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.score-grid-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--color-text);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.score-grid-btn:hover {
    background: var(--color-primary);
    color: var(--color-bg);
}

.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { width: 100%; padding-right: 2.5rem; }
.password-toggle { position: absolute; right: 10px; background: none; border: none; color: var(--color-text-muted); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.password-toggle:hover { color: var(--color-primary); }

/* Season Stats View Styles */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.summary-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-card-icon {
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.stat-card-content {
    display: flex;
    flex-direction: column;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text);
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.diff-positive {
    color: #4ade80 !important;
}

.diff-negative {
    color: #f87171 !important;
}

.diff-neutral {
    color: var(--color-text) !important;
}

/* Roster & Stats Layout Sizing */
.roster-nav-header,
.roster-manager-container,
.stats-manager-container {
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.stats-leaderboard-card {
    width: 100%;
    max-width: 100%;
    margin-top: 1.5rem;
    padding: 1.5rem;
    box-sizing: border-box;
}

.stats-leaderboard-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (min-width: 1024px) {
    .roster-nav-header,
    .roster-manager-container,
    .stats-manager-container {
        max-width: 1250px;
    }
    
    .roster-nav-header {
        margin-bottom: 0.85rem !important;
    }

    /* Compact 6-card metric strip for stats summary */
    .stats-summary-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 0.65rem !important;
        margin-bottom: 0.75rem !important;
    }

    .summary-stat-card {
        padding: 0.55rem 0.8rem !important;
        gap: 0.6rem !important;
        border-radius: 10px !important;
    }

    .stat-card-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.35rem !important;
    }

    .stat-card-value {
        font-size: 1.35rem !important;
        line-height: 1 !important;
    }

    .stat-card-label {
        font-size: 0.62rem !important;
        margin-top: 0.15rem !important;
    }

    /* Compact Full-Width Leaderboard Card */
    .stats-leaderboard-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0.65rem auto 0 auto !important;
        padding: 0.85rem 1.25rem !important;
    }

    .stats-leaderboard-header-row {
        margin-bottom: 0.5rem !important;
    }

    .stats-table-wrapper {
        width: 100% !important;
        max-height: calc(100vh - 275px);
        overflow-y: auto;
        overflow-x: auto;
        padding-right: 0.25rem;
    }

    .stats-table-header {
        width: 100% !important;
        position: sticky;
        top: 0;
        z-index: 5;
        grid-template-columns: minmax(260px, 1fr) 95px 115px 95px 75px 75px !important;
        padding: 0.55rem 1.15rem !important;
        gap: 0.65rem !important;
        margin-bottom: 0.35rem !important;
        background: rgba(24, 24, 27, 0.96) !important;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .stats-table-body {
        width: 100% !important;
        gap: 0.3rem !important;
    }

    .stats-player-row {
        width: 100% !important;
        grid-template-columns: minmax(260px, 1fr) 95px 115px 95px 75px 75px !important;
        padding: 0.45rem 1.15rem !important;
        gap: 0.65rem !important;
    }

    .stats-player-avatar {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.78rem !important;
    }

    .stats-player-name-text {
        font-size: 1rem;
        white-space: normal;
        word-break: break-word;
        overflow: visible;
        text-overflow: clip;
    }

    .stats-player-val {
        font-size: 1.05rem !important;
    }
}

/* Stats Leaderboard Table */
.stats-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
}

.stats-table-wrapper::-webkit-scrollbar {
    height: 5px;
    width: 6px;
}

.stats-table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.stats-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
}

.stats-table-header {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) 74px 86px 74px 52px 52px;
    align-items: center;
    gap: 0.4rem;
    min-width: 480px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
    box-sizing: border-box;
}

.sort-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
    user-select: none;
}

.sort-header:hover {
    color: var(--color-primary);
}

.col-player-name {
    justify-content: flex-start;
    min-width: 0;
}

.col-stat {
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.sort-indicator {
    font-size: 0.68rem;
    margin-left: 0.25rem;
    color: var(--color-primary);
    display: inline-block;
    min-width: 8px;
    line-height: 1;
}

.stats-table-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 480px;
}

.stats-player-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) 74px 86px 74px 52px 52px;
    align-items: center;
    gap: 0.4rem;
    min-width: 480px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    transition: background 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.stats-player-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.stats-player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    overflow: hidden;
}

.stats-player-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.stats-player-name-text {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-player-val {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.stats-player-val.highlight-val {
    color: var(--color-text);
    font-weight: 700;
}

.stats-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Saved Lineups Styles */
.btn-save-inactive {
    background: #333333 !important;
    color: #888888 !important;
    border: 1px solid #444444 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    box-shadow: none !important;
    opacity: 0.65;
}

.btn-save-active {
    background: var(--color-primary) !important;
    color: white !important;
    border: 1px solid var(--color-primary) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    box-shadow: 0 0 10px rgba(230, 25, 25, 0.4) !important;
    animation: pulseSaveBtn 2s infinite;
}

@keyframes pulseSaveBtn {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

#btn-tactics-clear:hover,
#btn-gd-clear-field:hover {
    background: rgba(230, 25, 25, 0.1) !important;
    color: #ff5555 !important;
    border-color: rgba(230, 25, 25, 0.6) !important;
}

#btn-tactics-reset:hover,
#btn-gd-reset-positions:hover {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

.lineup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
}

.lineup-item:last-child {
    border-bottom: none;
}

.lineup-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lineup-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex-grow: 1;
    overflow: hidden;
    padding-right: 0.5rem;
}

.lineup-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lineup-item-meta {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.btn-delete-lineup {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.btn-delete-lineup:hover {
    color: var(--color-primary);
    background: rgba(230, 25, 25, 0.15);
}

.quota-pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-text-muted);
}

.quota-pill.quota-full {
    background: rgba(230, 25, 25, 0.15);
    border-color: var(--color-primary);
    color: #ff6b6b;
}

/* --- Game Finalization & Lock Styles --- */
.badge-finalized {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.gd-locked-banner {
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.35);
    color: #fde047;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.final-actions-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.btn-finalize {
    background: #16a34a;
    color: white;
    border: 1px solid #22c55e;
    padding: 0.75rem 1.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.btn-finalize:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
}

.btn-unlock {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid #eab308;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-unlock:hover {
    background: rgba(234, 179, 8, 0.25);
    transform: translateY(-1px);
}

.score-box.locked {
    cursor: not-allowed !important;
    opacity: 0.85;
}

.score-box.locked:hover {
    transform: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.field-locked .player-token {
    cursor: default !important;
}

.field-locked .stat-badge {
    cursor: default !important;
}

/* ==========================================================================
   Help Center & Knowledge Base (Shopify Style)
   ========================================================================== */

.faq-container {
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}

/* Hero & Search */
.faq-hero {
    text-align: center;
    padding: 1.75rem 1rem 2.5rem;
}

.faq-hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.faq-search-wrapper {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
}

.faq-search-icon {
    display: none;
}

.faq-search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.6rem;
    font-size: 1.05rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    color: var(--color-text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.faq-search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.faq-search-clear {
    position: absolute;
    right: 1.35rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    line-height: 1;
    transition: color 0.15s ease;
}

.faq-search-clear:hover {
    color: var(--color-text);
}

/* Hub Section Header */
.faq-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.faq-section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.faq-search-count {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.07);
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
}

/* Topic Grid (Shopify 3-column layout) */
.faq-topic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}

.faq-topic-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.65rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.faq-topic-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.faq-topic-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.faq-topic-summary {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.faq-article-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-article-link {
    color: #93c5fd;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.4;
    cursor: pointer;
    display: inline-block;
    transition: all 0.15s ease;
}

.faq-article-link:hover {
    color: #ffffff;
    text-decoration: underline;
    transform: translateX(2px);
}

/* Empty search result */
.faq-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.faq-no-results h3 {
    color: var(--color-text);
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

/* Article View (Shopify Step-by-Step Style) */
.faq-article-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 980px;
    margin: 0 auto;
}

.faq-article-top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.faq-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.1rem;
    font-size: 0.95rem;
    cursor: pointer;
}

.faq-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.faq-breadcrumbs .breadcrumb-link {
    color: #93c5fd;
    cursor: pointer;
    text-decoration: none;
}

.faq-breadcrumbs .breadcrumb-link:hover {
    text-decoration: underline;
}

.faq-article-header-section {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1.5rem;
}

.faq-article-main-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 0.85rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.faq-article-lead {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Callout Boxes (Shopify Tip / Note Style) */
.faq-callout {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.faq-callout-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: capitalize;
}

.faq-callout-body {
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0;
}

.faq-callout-tip {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.faq-callout-tip .faq-callout-header {
    color: #60a5fa;
}

.faq-callout-note {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

.faq-callout-note .faq-callout-header {
    color: #fbbf24;
}

/* Table of Contents ("On this page") */
.faq-toc-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0 2.5rem;
}

.faq-toc-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.85rem;
}

.faq-toc-list {
    list-style: disc;
    padding-left: 1.35rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-toc-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.faq-toc-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Step-by-Step Guide Sections */
.faq-steps-container {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

.faq-step-item {
    scroll-margin-top: 80px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.6rem;
}

.faq-step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.faq-step-badge {
    color: #60a5fa;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.faq-step-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.faq-step-text strong {
    color: #ffffff;
}

.faq-step-text ul, .faq-step-text ol {
    margin: 0.6rem 0 0.85rem 1.75rem;
    padding: 0;
}

.faq-step-text li {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 1100px) {
    .faq-topic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .faq-topic-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .faq-hero-title {
        font-size: 1.9rem;
    }
    
    .faq-search-input {
        font-size: 1.05rem;
        padding: 0.95rem 2.75rem 0.95rem 1.4rem;
    }
    
    .faq-topic-title {
        font-size: 1.3rem;
    }
    
    .faq-topic-summary {
        font-size: 1rem;
    }
    
    .faq-article-link {
        font-size: 1.05rem;
    }
    
    .faq-article-wrapper {
        padding: 1.5rem 1.25rem;
    }
    
    .faq-article-main-title {
        font-size: 1.85rem;
    }
    
    .faq-article-lead {
        font-size: 1.1rem;
    }
    
    .faq-step-title {
        font-size: 1.25rem;
    }
    
    .faq-step-badge {
        font-size: 1rem;
    }
    
    .faq-step-text {
        font-size: 1.05rem;
    }
}



