/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --primary-color: #e65100;
    --primary-dark: #bf360c;
    --primary-light: #ff8a65;
    --secondary-color: #424242;
    --success-color: #2e7d32;
    --error-color: #c62828;
    --warning-color: #f57c00;
    --info-color: #0277bd;
    --background: #f5f5f5;
    --surface: #ffffff;
    --border: #e0e0e0;
    --text-primary: #212121;
    --text-secondary: #757575;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page,
.register-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-header {
    background: var(--primary-color);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.login-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.login-header p {
    opacity: 0.9;
    font-size: 14px;
}

.login-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

.password-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle input {
    width: 100%;
    padding-right: 45px;
}

.password-toggle .password-toggle-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle .password-toggle-btn:hover {
    opacity: 1;
}

.forgot-password {
    text-align: center;
    margin-top: 15px;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.login-footer {
    padding: 20px 30px;
    background: #fafafa;
    border-top: 1px solid var(--border);
}

.login-footer p {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.demo-credentials {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ============================================
   REGISTER PAGE
   ============================================ */
.register-container {
    width: 100%;
    max-width: 700px;
    padding: 20px;
}

.register-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.register-header {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    text-align: center;
}

.register-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.register-header p {
    opacity: 0.9;
    font-size: 14px;
}

.register-body {
    padding: 30px;
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 25px;
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.helper-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Role Selector */
.role-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.role-option {
    cursor: pointer;
}

.role-option input[type="radio"] {
    display: none;
}

.role-card {
    background: #f5f5f5;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.role-option:hover .role-card {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.role-option input[type="radio"]:checked + .role-card {
    border-color: var(--primary-color);
    background: #fff8e1;
    box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

.role-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.role-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.role-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Password Field */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    width: 100%;
    padding-right: 45px;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle-btn:hover {
    opacity: 1;
}

.password-strength,
.password-match {
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
    font-weight: 500;
}

.register-footer {
    padding: 20px 30px;
    background: #fafafa;
    border-top: 1px solid var(--border);
    text-align: center;
}

.register-footer p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.register-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.register-footer a:hover {
    text-decoration: underline;
}

select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    background: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #616161;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #1b5e20;
}

.btn-success-outline {
    background: transparent;
    color: var(--success-color);
    border: 2px solid var(--success-color);
    cursor: default;
}

.btn-success-outline:disabled {
    opacity: 0.7;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #ef6c00;
}

.btn-large {
    padding: 14px 40px;
    font-size: 16px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: var(--success-color);
    border: 1px solid #c8e6c9;
}

.alert-error {
    background: #ffebee;
    color: var(--error-color);
    border: 1px solid #ffcdd2;
}

/* ============================================
   CONTAINER & HEADER
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin: 0;
}

.header .user-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
}

.user-role {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.role-player {
    background: #e3f2fd;
    color: #1565c0;
}

.role-coach {
    background: #f3e5f5;
    color: #6a1b9a;
}

.role-admin {
    background: #fff3e0;
    color: #e65100;
}

.user-team-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: #f5f5f5;
    color: var(--text-secondary);
}

.logout-btn {
    padding: 6px 14px;
    background: #212121;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #424242;
}

.mobile-btn {
    padding: 6px 14px;
    background: #e65100;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s;
    box-shadow: 0 2px 6px rgba(230,81,0,.35);
}

.mobile-btn:hover {
    background: #bf360c;
}

/* ============================================
   MAIN CONTENT LAYOUT
   ============================================ */
.main-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

/* ============================================
   WEEK NAVIGATION
   ============================================ */
.week-navigation {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.week-info {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.week-nav-buttons {
    display: flex;
    gap: 8px;
}

/* ============================================
   SEASON NAVIGATION
   ============================================ */
.season-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.season-nav-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
    white-space: nowrap;
}

.season-btn {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--background);
    border: 2px solid var(--border);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}

.season-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.season-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ============================================
   LEGEND
   ============================================ */
.legend {
    background: #fff8e1;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-icon {
    font-size: 18px;
}

/* ============================================
   WEEK TABLE
   ============================================ */
.week-table-container {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.week-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.week-table thead th {
    background: var(--primary-color);
    color: white;
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

.week-table thead th:first-child {
    border-radius: 12px 0 0 0;
    position: sticky;
    left: 0;
    z-index: 3;
}

.week-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

.day-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.day-name {
    font-size: 14px;
}

.day-number {
    font-size: 20px;
    font-weight: bold;
}

.week-table tbody th {
    background: #f5f5f5;
    padding: 16px 12px;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    color: var(--text-secondary);
    white-space: nowrap;
    width: 1%;  /* shrink to content */
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 2px solid var(--border);
}

.week-table tbody td {
    padding: 12px;
    border: 1px solid var(--border);
    vertical-align: top;
    min-width: 110px;
}

.week-table tbody td.today {
    background: #fff8e1;
}

.week-table thead th.today {
    background: var(--warning-color);
}

.no-training {
    text-align: center;
    color: var(--text-secondary);
    font-size: 18px;
}

/* ============================================
   TRAINING ITEM
   ============================================ */
.training-item {
    background: #ffffff;
    border: 2px solid var(--primary-light);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.training-item:last-child {
    margin-bottom: 0;
}

.training-item.other-team {
    border-color: #e0e0e0;
    opacity: 0.7;
}

.match-item.other-team.other-game-hidden {
    display: none;
}

.week-table tbody tr.row-empty-hidden {
    display: none;
}

.other-games-toggle-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    margin-bottom: 8px;
}

.other-games-toggle-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: background .2s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #e65100;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.training-item.match-item {
    background: #e8f5e9;
    border-color: #43a047;
}

.training-item.match-item.weekend {
    background: #fff3e0;
    border-color: #fb8c00;
}

.training-item.match-item.weekend .match-badge {
    background: #fb8c00;
    color: #fff;
}

.match-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    background: #43a047;
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.match-opponent {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.match-opponent span:first-child {
    color: var(--text-secondary);
    font-weight: 400;
}

.home-away-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: #f5f5f5;
    color: var(--text-secondary);
    white-space: nowrap;
}

.match-result {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
}

.rsvp-count {
    font-size: 12px;
    font-weight: 600;
    color: #2e7d32;
    margin-top: 4px;
}

.event-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.training-team {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.badge-other {
    font-size: 11px;
    padding: 2px 8px;
    background: #f5f5f5;
    color: var(--text-secondary);
    border-radius: 10px;
    font-weight: 500;
}

.training-location {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.training-location svg {
    width: 14px;
    height: 14px;
}

.training-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.training-note {
    font-size: 12px;
    background: #fff3e0;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* ============================================
   ATTENDANCE BUTTONS
   ============================================ */
.attendance-buttons-inline {
    display: flex;
    gap: 4px;
    margin-top: 10px;
}

.attendance-btn-mini {
    flex: 1;
    padding: 6px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.attendance-btn-mini:hover {
    transform: scale(1.05);
}

.attendance-btn-mini.yes {
    border-color: #c8e6c9;
}

.attendance-btn-mini.yes.active {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.attendance-btn-mini.no {
    border-color: #ffcdd2;
}

.attendance-btn-mini.no.active {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.attendance-btn-mini.excused {
    border-color: #fff9c4;
}

.attendance-btn-mini.excused.active {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.attendance-btn-mini.note {
    border-color: #e1bee7;
}

.attendance-btn-mini.note:hover {
    background: #f3e5f5;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.stats-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* ============================================
   ATTENDANCE CIRCLE
   ============================================ */
.attendance-circle {
    margin: 20px 0 30px;
    position: relative;
    width: 180px;
    height: 180px;
    margin-left: auto;
    margin-right: auto;
}

.circle-bg {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(
        var(--success-color) 0% var(--percentage),
        #e0e0e0 var(--percentage) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle-inner {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.percentage-value {
    font-size: 36px;
    font-weight: bold;
    color: var(--success-color);
}

.percentage-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   ATTENDANCE ROW (circle + stats side by side on mobile)
   ============================================ */
.attendance-row {
    display: block;
}

@media (max-width: 900px) {
    .attendance-row {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .attendance-row .attendance-circle {
        flex-shrink: 0;
        width: 100px;
        height: 100px;
        margin: 0;
    }

    .attendance-row .circle-bg {
        width: 100px;
        height: 100px;
    }

    .attendance-row .circle-inner {
        width: 76px;
        height: 76px;
    }

    .attendance-row .percentage-value {
        font-size: 20px;
    }

    .attendance-row .percentage-label {
        font-size: 10px;
    }

    .attendance-row .stat-items-grid {
        flex: 1;
        display: flex !important;
        flex-direction: column;
        gap: 3px;
        margin-top: 0;
        grid-template-columns: unset;
    }

    .attendance-row .stat-items-grid .stat-item {
        margin-bottom: 0;
        padding: 4px 8px;
        font-size: 12px;
    }

    .attendance-row .stat-items-grid .stat-label {
        font-size: 12px;
    }

    .attendance-row .stat-items-grid .stat-value {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .attendance-row .attendance-circle {
        width: 84px;
        height: 84px;
    }

    .attendance-row .circle-bg {
        width: 84px;
        height: 84px;
    }

    .attendance-row .circle-inner {
        width: 64px;
        height: 64px;
    }

    .attendance-row .percentage-value {
        font-size: 17px;
    }
}

/* ============================================
   STAT ITEMS
   ============================================ */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: 7px;
    background: #f9f9f9;
    margin-bottom: 4px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary, #555);
}

.stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

.modal-body textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================
   TRAINING LIST PAGE
   ============================================ */
.trainings-list {
    max-width: 800px;
    margin: 0 auto;
}

.date-separator {
    margin: 30px 0 15px;
}

.date-separator h3 {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 600;
}

.training-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.training-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.training-card.registered {
    border-color: var(--success-color);
    background: #f1f8f4;
}

.training-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.training-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.training-time svg {
    stroke-width: 2;
}

.training-status {
    flex-shrink: 0;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.badge-success {
    background: #e8f5e9;
    color: var(--success-color);
}

.badge-danger {
    background: #ffebee;
    color: var(--error-color);
}

.badge-warning {
    background: #fff3e0;
    color: var(--warning-color);
}

.badge-neutral {
    background: #f5f5f5;
    color: var(--text-secondary);
}

.training-body {
    margin-bottom: 16px;
}

.training-body > div {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.training-body svg {
    flex-shrink: 0;
}

.training-participants strong {
    color: var(--primary-color);
}

.training-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.training-actions .btn {
    flex: 1;
    min-width: 120px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ============================================
   TEAM SELECTION
   ============================================ */
.team-selection {
    max-width: 900px;
    margin: 0 auto;
}

.team-select-form {
    margin-top: 30px;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.team-card-selectable {
    cursor: pointer;
    display: block;
}

.team-card-selectable input[type="radio"] {
    display: none;
}

.team-card-content {
    background: var(--surface);
    border: 3px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.team-card-selectable:hover .team-card-content {
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.team-card-selectable input[type="radio"]:checked + .team-card-content {
    border-color: var(--primary-color);
    background: #fff8e1;
    box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

.team-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.team-card-content h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.team-category {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-page {
    background: var(--background);
    min-height: 100vh;
    padding-bottom: 40px;
}

.profile-page .header {
    flex-direction: row;
    justify-content: space-between;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.profile-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.profile-card h2 {
    font-size: 22px;
    margin-bottom: 25px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.profile-card h3 {
    font-size: 18px;
    margin-top: 25px;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-form .form-group {
    margin-bottom: 20px;
}

.profile-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.profile-form .form-row .form-group {
    margin-bottom: 20px;
}

.profile-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.profile-form input,
.profile-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
}

.profile-form input:focus,
.profile-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

.profile-form input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: var(--text-secondary);
}

.profile-form .helper-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    display: block;
}

.profile-form .btn {
    margin-top: 10px;
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.profile-stat-box {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.profile-stat-box.primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    color: white;
}

.profile-stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.profile-stat-value {
    font-size: 24px;
    font-weight: bold;
}

.profile-card:last-child {
    width: 100%;
}

.password-requirements {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 15px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.password-requirements ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.password-requirements li {
    margin: 4px 0;
}

/* Profile Header Section */
.profile-header-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    color: white;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: var(--shadow-lg);
}

.profile-photo-container {
    flex-shrink: 0;
}

.profile-photo-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    font-weight: bold;
    color: white;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.photo-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-color);
    transition: all 0.2s;
}

.photo-upload-btn:hover {
    transform: scale(1.1);
    background: var(--primary-color);
    color: white;
}

.profile-header-info {
    flex: 1;
}

.profile-header-info h1 {
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: 700;
}

.profile-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.profile-meta-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-meta-item.primary {
    background: rgba(255, 215, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.profile-stats-inline {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.profile-stat-inline {
    display: flex;
    flex-direction: column;
}

.profile-stat-inline-value {
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
}

.profile-stat-inline-label {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

/* Multi-team selector styles */
.team-management-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.team-selector-grid {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}

.team-selector-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.team-selector-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.team-selector-item.selected {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.team-selector-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

.team-selector-info {
    flex: 1;
}

.team-selector-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.team-selector-category {
    font-size: 13px;
    color: var(--text-secondary);
}

.team-jersey-input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

.primary-team-badge {
    padding: 4px 12px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #856404;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.primary-selector-row {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 6px;
}

.primary-selector-row.show {
    display: block;
}

.primary-selector-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e65100;
}

.primary-selector-row select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ffb74d;
    border-radius: 6px;
}

.teams-summary {
    display: none;
    margin-top: 15px;
    padding: 12px 15px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 6px;
}

.teams-summary.show {
    display: block;
}

/* Photo Modal */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.photo-modal.show {
    display: flex;
}

.photo-modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
}

.photo-modal h3 {
    margin-bottom: 20px;
    font-size: 22px;
}

.photo-upload-area {
    border: 3px dashed var(--border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.photo-upload-area:hover {
    border-color: var(--primary-color);
    background: #fff8e1;
}

.photo-upload-area.drag-over {
    border-color: var(--primary-color);
    background: #fff8e1;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.photo-preview {
    display: none;
    margin-top: 20px;
}

.photo-preview img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.photo-actions {
    display: flex;
    gap: 10px;
}

.photo-actions .btn {
    flex: 1;
}

/* My Teams Section */
.my-teams-card {
    grid-column: span 2;
}

.teams-description {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.6;
}

.team-list-readonly {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.team-item-readonly {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.team-item-readonly::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.team-item-readonly:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.team-item-readonly:hover::before {
    opacity: 1;
}

.team-item-readonly.primary {
    background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%);
    border: 2px solid #ffa726;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.15);
}

.team-item-readonly.primary::before {
    background: linear-gradient(180deg, #ffd54f 0%, #ff9800 100%);
    width: 5px;
    opacity: 1;
}

.team-item-readonly.primary:hover {
    box-shadow: 0 8px 24px rgba(255, 152, 0, 0.25);
}

.team-item-icon {
    font-size: 40px;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border-radius: 12px;
    transition: all 0.3s;
}

.team-item-readonly.primary .team-item-icon {
    background: linear-gradient(135deg, #ffe082 0%, #ffb74d 100%);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.team-item-readonly:hover .team-item-icon {
    transform: scale(1.1) rotate(5deg);
}

.team-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.team-item-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.team-item-readonly.primary .team-item-name {
    color: #e65100;
}

.primary-badge-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #f57c00;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.primary-badge-small::before {
    content: '⭐ ';
}

.team-item-category {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}

.team-item-jersey {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.jersey-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 32px;
    padding: 0 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(230, 81, 0, 0.3);
}

.jersey-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.teams-info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #1976d2;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #0d47a1;
    line-height: 1.5;
}

.info-icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* Multi-team header styles */
.user-teams-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.user-team-badge.primary {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    border-color: #1976d2;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.3);
}

.user-team-badge .badge-icon {
    margin-right: 4px;
    font-size: 10px;
}

.teams-count {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 4px;
    font-style: italic;
}

/* ============================================
   PLAYBOOK STYLES
   ============================================ */
.playbook-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.playbook-header h1 {
    margin: 0 0 8px 0;
    font-size: 32px;
}

.playbook-stats {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.playbook-stat {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

.team-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.team-tab {
    padding: 12px 24px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-tab:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.team-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.filters-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
}

.category-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 14px;
}

.filter-btn:hover {
    border-color: #667eea;
}

.filter-btn.active {
    color: white;
    border-color: transparent;
}

.signals-list {
    display: grid;
    gap: 16px;
}

.signal-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
    border: 2px solid transparent;
}

.signal-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.signal-card.favorite {
    border-color: #FFD700;
    background: linear-gradient(135deg, #fffbf0 0%, #ffffff 100%);
}

.signal-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.signal-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.signal-actions {
    display: flex;
    gap: 8px;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.signal-media {
    margin: 16px 0;
    display: grid;
    gap: 16px;
}

.signal-photo {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.signal-photo:hover {
    transform: scale(1.02);
}

.signal-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.signal-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.media-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
    font-weight: 500;
}

.signal-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tag {
    background: #F3F4F6;
    color: #6B7280;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.signal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E5E7EB;
    font-size: 13px;
    color: #718096;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.file-input-label {
    display: block;
    padding: 20px;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-input-label:hover {
    background: #e5e7eb;
    border-color: #667eea;
}

.file-input-label input[type="file"] {
    display: none;
}

.remove-photo-btn {
    padding: 6px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox.show {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 36px;
    cursor: pointer;
    background: rgba(0,0,0,0.7);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
/* ============================================
   RESPONSIVE — 1200px (tablet landscape)
   ============================================ */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 16px;
    }
}

/* ============================================
   RESPONSIVE — 968px (tablet)
   ============================================ */
@media (max-width: 968px) {
    .profile-stats      { grid-template-columns: repeat(2, 1fr); }
    .my-teams-card      { grid-column: 1; }
    .team-list-readonly { grid-template-columns: 1fr; }
}

/* ============================================
   RESPONSIVE — 768px (mobile landscape / small tablet)
   ============================================ */
@media (max-width: 768px) {
    /* --- Layout --- */
    .container { padding: 0; }

    .main-content { padding: 0 12px; gap: 12px; }

    .header,
    .alert,
    .week-navigation,
    .season-nav,
    .legend,
    .stats-card,
    .sidebar { margin-left: 12px; margin-right: 12px; }

    .main-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* --- Header --- */
    .header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        gap: 12px;
    }

    .header h1 { font-size: 22px; }

    .user-info { gap: 10px; }

    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }

    .user-teams-list {
        width: 100%;
        margin-top: 6px;
    }

    .user-team-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .teams-count {
        width: 100%;
        margin-top: 4px;
        margin-left: 0;
    }

    /* --- Week navigation --- */
    .week-navigation {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 10px;
    }

    .week-info {
        font-size: 15px;
        text-align: center;
    }

    .week-nav-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
        width: 100%;
    }

    .week-nav-buttons .btn {
        text-align: center;
        font-size: 16px;
        padding: 9px 4px;
        touch-action: manipulation;
    }

    /* --- Legend --- */
    .legend {
        padding: 10px 12px;
        gap: 10px;
        font-size: 12px;
        flex-wrap: wrap;
    }

    /* --- Week table — full-bleed scrollable --- */
    .week-table-container {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
        width: 100%;
    }

    .week-table { min-width: 640px; }

    .week-table thead th {
        padding: 8px 3px;
        font-size: 11px;
    }

    .day-name   { font-size: 10px; }
    .day-number { font-size: 14px; }

    .week-table tbody th {
        padding: 8px 5px;
        font-size: 11px;
        white-space: nowrap;
        min-width: 50px;
    }

    .week-table tbody td { padding: 5px 3px; }

    /* --- Training / match items --- */
    .training-item {
        padding: 8px;
        margin-bottom: 6px;
    }

    .training-team {
        font-size: 12px;
        margin-bottom: 5px;
        gap: 4px;
    }

    .match-badge { font-size: 10px; padding: 2px 5px; }

    .match-opponent { font-size: 12px; gap: 4px; }

    .home-away-badge { font-size: 10px; padding: 2px 5px; }

    .training-location { font-size: 11px; }

    .training-description { font-size: 11px; }

    /* --- Attendance buttons --- */
    .attendance-buttons-inline { gap: 3px; margin-top: 8px; }

    .attendance-btn-mini {
        padding: 9px 4px;
        font-size: 15px;
        min-height: 36px;
    }

    /* --- Stats card --- */
    .stats-card { padding: 16px; }

    .attendance-circle {
        width: 140px;
        height: 140px;
        margin: 16px auto 24px;
    }

    /* --- Modal --- */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 0 10px;
    }

    /* --- Forms (other pages) --- */
    .form-row         { grid-template-columns: 1fr; }
    .role-selector    { grid-template-columns: 1fr; }
    .teams-grid       { grid-template-columns: 1fr; }
    .register-body    { padding: 20px; }
    .search-row       { flex-direction: column; }
    .team-tabs        { flex-direction: column; }
    .filter-btn       { flex: 1; }

    .training-actions .btn {
        min-width: 100px;
        font-size: 13px;
    }

    /* --- Profile (other pages) --- */
    .profile-header-section {
        flex-direction: column;
        text-align: center;
        padding: 24px 16px;
    }

    .profile-header-info h1 { font-size: 26px; }
    .profile-meta            { justify-content: center; }
    .profile-stats-inline    { justify-content: center; }

    .profile-photo-wrapper,
    .profile-photo {
        width: 110px;
        height: 110px;
    }

    .profile-photo { font-size: 44px; }
}

/* ============================================
   RESPONSIVE — 640px (mobile portrait)
   ============================================ */
@media (max-width: 640px) {
    /* --- Header --- */
    .header h1 { font-size: 19px; }

    .header-actions          { width: 100%; }
    .header-actions .btn     { flex: 1; }

    /* --- Week table more compact --- */
    .week-table { min-width: 580px; }

    .week-table thead th,
    .week-table tbody th { padding: 7px 2px; }

    .week-table tbody td { padding: 4px 2px; }

    /* Hide day names, keep numbers only */
    .day-name { display: none; }
    .day-number { font-size: 13px; }

    .training-item { padding: 6px; }

    .training-team  { font-size: 11px; }
    .match-opponent { font-size: 11px; }

    /* Hide less critical match info to save space */
    .home-away-badge { display: none; }
    .match-result    { display: none; }
    .training-description { display: none; }

    /* Attendance buttons — full tap targets */
    .attendance-btn-mini {
        padding: 10px 2px;
        font-size: 14px;
        min-height: 38px;
    }

    /* --- Profile --- */
    .profile-card             { padding: 18px; }
    .profile-form .form-row   { grid-template-columns: 1fr; }
    .profile-stats            { grid-template-columns: 1fr; }

    .team-item-readonly  { flex-direction: column; text-align: center; align-items: center; }
    .team-item-icon      { margin: 0 auto; }
    .team-item-content   { align-items: center; }
    .team-item-header    { justify-content: center; flex-direction: column; }
    .team-item-category,
    .team-item-jersey    { justify-content: center; }
    .team-selector-item  { flex-wrap: wrap; }
    .team-jersey-input   { width: 100%; }

    /* --- Modal full-screen --- */
    .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 12px 12px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
}

/* ============================================
   RESPONSIVE — 480px (small phones)
   ============================================ */
@media (max-width: 480px) {
    .container { padding: 0; }

    .main-content { padding: 0 8px; }

    .header,
    .alert,
    .week-navigation,
    .season-nav,
    .legend,
    .stats-card,
    .sidebar { margin-left: 8px; margin-right: 8px; }

    .week-table-container {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .week-table { min-width: 520px; }

    .week-table thead th { padding: 6px 2px; font-size: 10px; }
    .week-table tbody td { padding: 3px 2px; }

    .day-number { font-size: 12px; }

    .legend { gap: 6px; padding: 8px 10px; }

    /* Training item absolute minimum */
    .training-item  { padding: 5px; }
    .training-team  { font-size: 10px; }
    .training-location { display: none; }

    .attendance-btn-mini { min-height: 40px; font-size: 16px; }

    /* Team badges wrap */
    .user-team-badge {
        flex: 1 1 calc(50% - 3px);
        justify-content: center;
        min-width: 0;
    }

    /* Sidebar quick links */
    .stats-card .btn {
        font-size: 13px;
        padding: 10px;
    }
}


/* Form options container for checkbox and forgot password link */
* Form options container for checkbox */
.form-options {
    margin-bottom: 20px;
}

/* Checkbox label styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    font-weight: 400;
}

.checkbox-label:hover {
    color: var(--primary-color);
}



/* Checkbox label styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    font-weight: 400;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

/* Forgot password link */
.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* ============================================
   SCROLL HINT (mobile only)
   ============================================ */
.scroll-hint {
    display: none;
}

@media (max-width: 768px) {
    .scroll-hint {
        display: block;
        text-align: center;
        font-size: 11px;
        color: var(--text-secondary);
        padding: 4px 0 6px;
        opacity: .7;
    }
}

/* ============================================
   INDEX PAGE — extracted inline styles
   ============================================ */

/* Full-width sidebar button with bottom margin */
.btn-block {
    width: 100%;
    text-align: center;
    display: block;
    margin-bottom: 10px;
    position: relative;
}

/* User header — nickname and jersey */
.user-nickname {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: normal;
    margin-left: 8px;
}

.jersey-number {
    margin-left: 4px;
    opacity: 0.8;
}

/* Empty calendar cell */
.td-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Sidebar section dividers */
.sidebar-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.sidebar-section-sm {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

/* Sidebar section heading labels */
.sidebar-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-label-sm {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pending count badge on coach buttons */
.badge-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f44336;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}

/* Modal body helpers */
.modal-intro {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.modal-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}

.modal-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   QUICK LINKS GRID  (sidebar)
   ============================================ */
.quick-links-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 2-column tile grid on tablet/mobile */
@media (max-width: 900px) {
    .quick-links-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 4px;
    }

    .quick-links-grid .btn-block {
        margin-bottom: 0;
        font-size: 12px;
        padding: 10px 6px;
        text-align: center;
        white-space: normal;
        line-height: 1.35;
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Badge inside grid item */
    .quick-links-grid .btn-block .badge-count {
        top: -6px;
        right: -6px;
        font-size: 10px;
        padding: 1px 6px;
    }

    /* Full-width items that should span both columns */
    .quick-links-grid .btn-block.span-full {
        grid-column: 1 / -1;
    }
}

/* ============================================
   STAT ITEMS GRID (sidebar stats card)
   ============================================ */
.stat-items-grid {
    display: contents; /* transparent on desktop */
}

@media (max-width: 900px) {
    .stat-items-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        margin-top: 8px;
    }
}

/* ============================================
   SEASON NAV — always horizontal scroll
   ============================================ */
@media (max-width: 900px) {
    .season-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .season-nav::-webkit-scrollbar { display: none; }
}

@media (max-width: 640px) {
    .season-nav-label { display: none; }
}

/* ============================================
   LEGEND — horizontal scroll + collapsible
   ============================================ */
.legend-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 13px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0 4px;
    font-weight: 700;
    vertical-align: middle;
}

.legend-items {
    display: contents;
}

@media (max-width: 768px) {
    .legend {
        flex-wrap: wrap;
        gap: 6px 12px;
        padding: 10px 12px;
    }

    .legend-toggle {
        display: inline;
    }

    .legend-items {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        width: 100%;
    }

    .legend-item {
        background: #fff;
        border-radius: 8px;
        padding: 8px 10px;
        gap: 6px;
        font-size: 13px;
        justify-content: flex-start;
    }

    .legend-icon {
        font-size: 20px;
    }

    .legend-items.collapsed {
        display: none;
    }
}

/* ============================================
   HEADER — compact on mobile
   ============================================ */
@media (max-width: 640px) {
    .index-page .header h1 {
        font-size: 17px;
    }

    .user-nickname { display: none; }

    .user-teams-list {
        display: none; /* shown elsewhere on mobile */
    }

    .header .user-meta {
        gap: 5px;
        flex-wrap: wrap;
    }

    .mobile-btn, .logout-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
}

@media (max-width: 400px) {
    .index-page .header h1 { display: none; }
    .header { padding: 10px 12px; }
}
/* ============================================
   NEWS CARD
   ============================================ */
.news-card .news-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.news-card .news-item:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}
.news-card .news-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 2px;
    line-height: 1.3;
}
.news-card .news-meta {
    font-size: 11px;
    color: var(--text-secondary, #888);
    margin-bottom: 4px;
}
.news-card .news-content {
    font-size: 12px;
    color: #555;
    line-height: 1.45;
}
.news-card .news-more {
    font-size: 11px;
    color: #e65100;
    text-decoration: none;
    margin-left: 2px;
}
.news-card .news-more:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .stats-card {
        padding: 14px 14px;
    }

    .stats-card h3 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .news-card .news-item {
        padding: 6px 0;
    }
}
