:root {
    --primary-yellow: #FFD700;
    --primary-orange: #FFA500;
    --success-green: #28a745;
    --danger-red: #dc3545;
    --dark: #2c2c2c;
    --gray: #666;
    --light-gray: #f5f5f5;
    --border: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--light-gray);
    color: var(--dark);
}

/* ========== SCREENS ========== */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* ========== LOGIN ========== */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container h1 {
    font-size: 36px;
    color: var(--primary-yellow);
    margin-bottom: 10px;
}

.login-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-card h2 {
    margin-bottom: 10px;
}

.subtitle {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 20px;
}

.login-card input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 15px;
}

.login-card input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-yellow);
}

/* ========== BUTTONS ========== */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%);
    color: var(--dark);
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    padding: 8px 16px;
    background: white;
    color: var(--dark);
    border: 2px solid var(--border);
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--light-gray);
}

.btn-attendance {
    padding: 8px 16px;
    background: var(--success-green);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-attendance:hover {
    opacity: 0.9;
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--dark);
}

.icon-btn:hover {
    background: var(--light-gray);
}

.icon-btn.active {
    background: var(--primary-yellow);
    color: var(--dark);
}

/* ========== HEADER ========== */
.header {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left h1 {
    font-size: 20px;
    color: var(--dark);
}

.header-left .subtitle {
    font-size: 12px;
    color: var(--dark);
    opacity: 0.8;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    font-size: 14px;
    color: var(--dark);
    font-weight: 600;
}

/* ========== ACTIVITY SIDEBAR ========== */
.activity-sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    width: 280px;
    height: calc(100vh - 70px);
    background: white;
    border-right: 2px solid var(--border);
    overflow-y: auto;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 2px solid var(--border);
    background: var(--light-gray);
}

.sidebar-header h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--dark);
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--gray);
}

.activity-list {
    padding: 10px;
}

.activity-item {
    padding: 12px;
    margin-bottom: 8px;
    background: var(--light-gray);
    border-radius: 8px;
    border-left: 4px solid var(--success-green);
    cursor: pointer;
    transition: all 0.2s;
}

.activity-item:hover {
    background: #ebebeb;
    transform: translateX(4px);
}

.activity-item.drop {
    border-left-color: var(--danger-red);
}

.activity-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 4px;
}

.activity-item-gear {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 4px;
}

.activity-item-class {
    font-size: 11px;
    color: var(--gray);
    opacity: 0.8;
}

.activity-item-date {
    font-size: 10px;
    color: var(--gray);
    margin-top: 4px;
    font-style: italic;
}

.activity-loading {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 14px;
}

.activity-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    font-size: 14px;
}

/* ========== CONTAINER ========== */
.container {
    max-width: 1000px;
    margin: 0 auto 0 280px;
    padding: 20px;
}

/* ========== CLASS SELECTOR ========== */
.class-selector {
    display: block;
}

.search-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-yellow);
}

.class-list {
    display: grid;
    gap: 10px;
}

.class-item {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.class-item:hover {
    border-color: var(--primary-yellow);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.class-item-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.class-item-info {
    font-size: 14px;
    color: var(--gray);
}

/* ========== CLASS DETAIL ========== */
.class-detail {
    display: none;
}

.actions-bar {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.actions-bar .search-input {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ========== ATTENDANCE BANNER ========== */
.attendance-banner {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.attendance-banner.active {
    display: flex;
}

/* ========== ROSTER LIST ========== */
.roster-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 15px;
    transition: all 0.2s;
}

.player-item.flagged {
    border-color: #ff6b6b;
}

.player-item.league-player {
    border-left: 4px solid var(--primary-yellow);
}

.player-item.present {
    background: #e8f5e9;
    border-color: var(--success-green);
}

.player-item.inactive {
    opacity: 0.6;
    background: #f9f9f9;
    border-color: #ccc;
}

.player-item.inactive .player-name {
    text-decoration: line-through;
    color: #999;
}

.player-item.inactive .player-details,
.player-item.inactive .player-contact {
    color: #aaa;
}

.player-checkbox {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.player-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.attendance-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid var(--border);
}

.attendance-indicator.present {
    background: var(--success-green);
    color: white;
    border-color: var(--success-green);
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.player-details {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 5px;
}

.player-contact {
    font-size: 13px;
    color: var(--gray);
}

.player-contact a {
    color: #0066cc;
    text-decoration: none;
}

.player-contact a:hover {
    text-decoration: underline;
}

.player-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light-gray);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--border);
}

.action-btn.danger:hover {
    background: #ffe0e0;
    color: var(--danger-red);
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-league {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-gray {
    background: #e0e0e0;
    color: #666;
    border: 1px solid #ccc;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.badge-new {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 700;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
    }
}

/* ========== ADD/DROP COUNT BADGES ========== */
.add-count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: #d1f4e0;
    color: #0f5132;
    border: 1px solid #badbcc;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.drop-count {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 6px;
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

/* ========== NEW PLAYER HIGHLIGHT ========== */
.player-item.new-player {
    background: linear-gradient(to right, #f8f9ff, white);
    border-left: 4px solid #667eea;
}

.player-item.new-player:hover {
    background: linear-gradient(to right, #f0f2ff, #f8f9ff);
}

.gear-order-info {
    margin-top: 4px;
    padding: 6px 10px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    font-size: 12px;
    color: #0369a1;
}

.gear-order-info strong {
    color: #0c4a6e;
}

/* ========== MESSAGE ========== */
.message {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--gray);
}

.close:hover {
    color: var(--dark);
}

.notes-player-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-yellow);
}

.notes-history {
    margin-bottom: 15px;
}

.note-item {
    background: var(--light-gray);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.note-meta {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.note-text {
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 20px;
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
    }

    .header-left h1 {
        font-size: 16px;
    }

    .user-info {
        display: none;
    }

    .container {
        padding: 15px;
    }

    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-bar .search-input {
        width: 100%;
    }

    .player-item {
        flex-direction: column;
        gap: 10px;
    }

    .player-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }
}
