/* FF Alerts - Dark Theme Styles */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --tier-urgent: #ef4444;
    --tier-important: #f59e0b;
    --tier-fyi: #6b7280;
    --success: #22c55e;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tier-fyi);
    animation: pulse 2s infinite;
}

.status-dot.live {
    background: var(--success);
}

.status-dot.paused {
    background: var(--tier-fyi);
    animation: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 60px;
    z-index: 99;
}

.tab-btn {
    flex: 1;
    padding: 14px 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.tab-btn:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    padding: 16px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards */
.section-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.section-card h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.section-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Stats Card */
.stats-card {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Games List */
.games-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.game-teams {
    font-weight: 600;
}

.game-status {
    font-size: 0.875rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

.game-score {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: var(--shadow);
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

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

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

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

/* Player Row with Headshot */
.player-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-headshot {
    width: 48px;
    height: 35px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-hover);
    flex-shrink: 0;
}

/* Player List */
.player-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

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

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

.player-actions {
    display: flex;
    gap: 8px;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--tier-urgent);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-remove:hover {
    opacity: 1;
}

.group-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 0.75rem;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-style: italic;
}

/* Alerts */
.alerts-list,
.alerts-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--tier-fyi);
}

.alert-item.tier-1 {
    border-left-color: var(--tier-urgent);
    background: rgba(239, 68, 68, 0.1);
}

.alert-item.tier-2 {
    border-left-color: var(--tier-important);
}

.alert-item.tier-3 {
    border-left-color: var(--tier-fyi);
}

.alert-item.unread {
    background: rgba(59, 130, 246, 0.1);
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.alert-player {
    font-weight: 600;
}

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

.alert-message {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

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

.alert-tier {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.tier-1 .alert-tier {
    background: var(--tier-urgent);
    color: white;
}

.tier-2 .alert-tier {
    background: var(--tier-important);
    color: black;
}

.tier-3 .alert-tier {
    background: var(--tier-fyi);
    color: white;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-header h2 {
    margin-bottom: 0;
}

/* Settings */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row label {
    color: var(--text-secondary);
}

.setting-row select,
.setting-row input[type="number"] {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
}

.section-card input[type="url"] {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    margin-bottom: 12px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.9rem;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

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

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-success {
    background: var(--success);
    color: white;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--tier-urgent);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive */
@media (max-width: 400px) {
    .tab-btn {
        font-size: 0.75rem;
        padding: 12px 4px;
    }

    .stats-card {
        flex-wrap: wrap;
        gap: 16px;
    }

    .stat {
        flex: 0 0 45%;
    }
}