/* ==============================================================================
   TiqueTaque Sync — Premium Dark Theme Design System
   ============================================================================== */

:root {
    --bg-base: #0a0b10;
    --bg-surface: #12141e;
    --bg-surface-elevated: #1a1d2d;
    --bg-glass: rgba(22, 26, 42, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.3);

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --brand-primary: #8b5cf6;
    --brand-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #ec4899 100%);
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow-purple: 0 0 40px -10px rgba(139, 92, 246, 0.35);
    --shadow-glow-emerald: 0 0 35px -10px rgba(16, 185, 129, 0.35);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Ambient glow spheres */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.45;
}

.glow-top {
    width: 500px;
    height: 500px;
    top: -150px;
    left: 20%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
}

.glow-bottom {
    width: 600px;
    height: 600px;
    bottom: -200px;
    right: 10%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
}

.app-container {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ==============================================================================
   Navbar & Header
   ============================================================================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    padding: 14px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: var(--brand-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-text h1 span {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.version-tag {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.live-clock-card {
    text-align: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    padding: 6px 18px;
    border-radius: var(--radius-md);
}

.live-time {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #ffffff;
}

.live-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Status Pill */
.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: var(--transition);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-loading {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-secondary);
    border-color: rgba(107, 114, 128, 0.3);
}
.status-loading .pulse-dot { background: var(--text-secondary); }

.status-working {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}
.status-working .pulse-dot {
    background: #10b981;
    animation: pulseGlow 2s infinite;
}

.status-lunch {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}
.status-lunch .pulse-dot {
    background: #f59e0b;
    animation: pulseGlow 1.5s infinite;
}

.status-completed {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}
.status-completed .pulse-dot { background: #8b5cf6; }

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

/* ==============================================================================
   Buttons
   ============================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--brand-primary);
    color: #c4b5fd;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.btn-icon:hover { color: white; }

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==============================================================================
   Cards & Bento Grid
   ============================================================================== */
.card {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

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

.glow-card {
    position: relative;
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: var(--shadow-glow-purple);
}

.countdown-card {
    border-color: rgba(99, 102, 241, 0.3);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .navbar {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }
}

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

.card-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.badge-alert-type {
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.hero-metric {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 8px;
}

.mono-font {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
}

.stat-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.alert-desc {
    font-size: 0.9rem;
    color: #c4b5fd;
    font-weight: 500;
}

/* Progress bar */
.progress-wrapper {
    margin-top: 10px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-glass);
}

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

/* ==============================================================================
   Split Section: Timeline + Channels
   ============================================================================== */
.content-split {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .content-split {
        grid-template-columns: 1fr;
    }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-glass);
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.counter-badge {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.subtext-pill {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Timeline */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-loading, .timeline-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    transition: var(--transition);
}

.timeline-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.timeline-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timeline-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.timeline-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.timeline-tag {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.timeline-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-source {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.badge-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.status-approved {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Channels List */
.channels-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.channel-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.channel-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.telegram-icon {
    background: rgba(0, 136, 204, 0.2);
    color: #29b6f6;
}

.slack-icon {
    background: rgba(224, 30, 90, 0.15);
    color: #ec4899;
}

.channel-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.channel-status {
    font-size: 0.75rem;
    color: var(--accent-emerald);
}

.channel-status.disabled {
    color: var(--text-muted);
}

.schedule-summary-box {
    margin-top: 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.schedule-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.schedule-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c4b5fd;
}

/* ==============================================================================
   Footer
   ============================================================================== */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    border-top: 1px solid var(--border-glass);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--brand-primary);
}

/* ==============================================================================
   Modal
   ============================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.modal-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-glow);
    box-shadow: var(--shadow-glow-purple);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    padding: 24px;
}

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

.modal-time-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin: 18px 0;
    color: var(--brand-primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: white;
    padding: 8px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
}

.form-group small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ==============================================================================
   Toast Notifications
   ============================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-glass);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    font-size: 0.875rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.success { border-left: 4px solid var(--accent-emerald); }
.toast.error { border-left: 4px solid var(--accent-rose); }
.toast.info { border-left: 4px solid var(--brand-primary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
