/**
 * Ping - Motorsport Notifications Styles
 */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-tertiary: #334155;
    --color-text: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-primary: #3b82f6;
    --color-success: #10b981;
    --color-warning: #fbbf24;
    --color-danger: #ef4444;
    --color-border: #475569;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--color-bg-secondary), var(--color-bg-tertiary));
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 2px solid var(--color-primary);
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ping-logo {
    font-size: 3rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.app-subtitle {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

/* Series Tabs */
.series-tabs {
    display: flex;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.series-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    flex: 0 0 auto;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: var(--color-bg);
}

.tab-emoji {
    font-size: 1.5rem;
}

.tab-name {
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 1rem;
}

section {
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Notification Settings */
.notification-settings {
    background: var(--color-bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.preferences {
    margin-top: 1rem;
}

.preferences p {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.checkbox-label {
    display: block;
    margin-bottom: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: var(--color-bg-tertiary);
}

.checkbox-label input {
    margin-right: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--color-success);
    color: white;
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: #059669;
}

/* Category Filter */
.category-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

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

/* Documents */
.documents-section {
    background: var(--color-bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.event-group {
    margin-bottom: 1.5rem;
}

.event-header {
    background: var(--color-bg-tertiary);
    padding: 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.event-header:hover {
    background: var(--color-border);
}

.event-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.event-count {
    background: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.event-documents {
    padding-left: 1rem;
}

.document-item {
    background: var(--color-bg);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.document-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.document-item.category-summons {
    border-left-color: var(--color-warning);
}

.document-item.category-decision {
    border-left-color: var(--color-success);
}

.document-item.category-infringement {
    border-left-color: var(--color-danger);
}

.document-item.category-other {
    border-left-color: var(--color-border);
}

.document-item.unread {
    background: var(--color-bg-tertiary);
}

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.document-title {
    font-weight: 600;
    flex: 1;
}

.document-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.badge-summons {
    background: var(--color-warning);
    color: #000;
}

.badge-decision {
    background: var(--color-success);
    color: #fff;
}

.badge-infringement {
    background: var(--color-danger);
    color: #fff;
}

.badge-other {
    background: var(--color-border);
    color: #fff;
}

.document-meta {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 4px;
}

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

.btn-pdf:hover {
    background: #2563eb;
}

.btn-mark-read {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

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

/* Loading & Empty States */
.loading {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 2rem;
}

.empty-state {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Footer */
.app-footer {
    background: var(--color-bg-secondary);
    padding: 1.5rem;
    text-align: center;
    color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border);
}

.app-footer a {
    color: var(--color-primary);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-title {
        font-size: 2rem;
    }

    .ping-logo {
        font-size: 2.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .document-header {
        flex-direction: column;
    }

    .document-badge {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .tab {
        min-width: 100px;
    }
}
