:root {
    /* Light Mode (Default) */
    --at-bg: #f3f4f6;
    --at-bg-card: #ffffff;
    --at-bg-header: rgba(255, 255, 255, 0.9);
    --at-text: #1f2937;
    --at-text-muted: #6b7280;
    --at-primary: #3b82f6;
    --at-accent: #f472b6;
    --at-border: #e5e7eb;
    --at-score-bg: rgba(0, 0, 0, 0.8);
    /* Keep dark for badges */
    --at-score-text: #fbbf24;
}

[data-theme="dark"] {
    /* Dark Mode */
    --at-bg: #0B1622;
    --at-bg-card: #151f2e;
    --at-bg-header: rgba(11, 22, 34, 0.9);
    --at-text: #ffffff;
    --at-text-muted: #9ca3af;
    --at-primary: #60a5fa;
    --at-accent: #f472b6;
    --at-border: #1f2937;
}

body {
    background-color: var(--at-bg) !important;
    color: var(--at-text) !important;
    font-family: 'Inter', sans-serif !important;
    transition: background-color 0.3s, color 0.3s;
}

/* Common Overrides */
#tie-container,
#tie-wrapper,
.background-overlay,
.anitime-footer {
    background-color: var(--at-bg) !important;
}

a {
    color: var(--at-text);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--at-primary);
}

/* Header */
.anitime-header {
    background: var(--at-bg-header);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--at-border);
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 15px 0;
    transition: background-color 0.3s, border-color 0.3s;
}

.at-logo {
    color: var(--at-text);
}

.at-logo span {
    color: var(--at-primary);
}

.at-search-input {
    background: var(--at-bg);
    border: 1px solid var(--at-border);
    color: var(--at-text);
}

.at-search-input:focus {
    border-color: var(--at-primary);
}

.at-menu a {
    color: var(--at-text-muted);
}

.at-menu a:hover {
    color: var(--at-primary);
}

/* Theme Toggle Button */
.at-theme-toggle {
    background: none;
    border: 1px solid var(--at-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--at-text);
    margin-left: 15px;
}

.at-theme-toggle:hover {
    background: var(--at-bg-card);
    color: var(--at-primary);
}

/* Cards & Grids */
.at-char-card,
.anitime-card,
.schedule-card {
    background: var(--at-bg-card);
    border: 1px solid var(--at-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.at-char-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.at-char-name,
.sc-title {
    color: var(--at-text);
}

/* Countdown Overlay */
.at-poster-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.at-countdown {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #bef264;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    padding: 4px;
    backdrop-filter: blur(2px);
}

.at-countdown.airing {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

/* Single Page Specifics */
.at-char-bio,
.at-synopsis {
    color: var(--at-text);
    line-height: 1.6;
}

.at-title {
    color: var(--at-text) !important;
}

/* Footer */
.anitime-footer {
    background: var(--at-bg-card);
    border-top: 1px solid var(--at-border);
}

.af-copy {
    color: var(--at-text-muted);
}