/* ═══════════════════════════════════════════════
   PlanAnime — Dark Theme Responsive CSS
   ═══════════════════════════════════════════════ */

:root {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #263548;
    --bg-surface: rgba(30, 41, 59, 0.7);
    --border: rgba(51, 65, 85, 0.5);
    --border-accent: rgba(56, 189, 248, 0.3);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.15);
    --green: #34d399;
    --purple: #a78bfa;
    --radius: 12px;
    --header-h: 56px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ─── HEADER ───────────────────────────────── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    color: var(--accent);
    border-color: var(--border-accent);
    background: var(--accent-glow);
}

.icon-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.hidden {
    display: none !important;
}

/* ─── WEEK BANNER ──────────────────────────── */
.week-banner {
    text-align: center;
    padding: 2rem 1rem 1rem;
}

.week-banner h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
}

.week-stats {
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ─── FILTERS ──────────────────────────────── */
.filters-bar {
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.filters-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0.5rem 0;
}

.filters-inner::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex-shrink: 0;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--text-dim);
    color: var(--text);
}

.filter-chip.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── DAY TABS (mobile) ────────────────────── */
.day-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.day-tab {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 56px;
}

.day-tab .tab-day {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.day-tab .tab-date {
    font-size: 0.65rem;
}

.day-tab .tab-count {
    font-size: 0.6rem;
    background: rgba(100, 116, 139, 0.2);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.day-tab:hover {
    background: var(--bg-card);
    color: var(--text-muted);
}

.day-tab.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

.day-tab.active .tab-count {
    background: rgba(56, 189, 248, 0.2);
}

.day-tab.today {
    position: relative;
}

.day-tab.today::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}

/* ─── PLANNING GRID ────────────────────────── */
.planning-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.day-column {
    display: none;
    margin-bottom: 1rem;
}

.day-column.active {
    display: block;
}

.day-column-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.day-column-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f1f5f9;
    flex: 1;
}

.day-column-header .date-label {
    color: var(--text-dim);
    font-weight: 400;
}

.today-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--green);
    color: #0f172a;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.anime-count {
    font-size: 0.8rem;
    color: var(--text-dim);
    background: rgba(100, 116, 139, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

/* ─── ANIME CARDS ──────────────────────────── */
.anime-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.anime-card {
    position: relative;
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: inherit;
    transition: all 0.2s;
    overflow: hidden;
}

.anime-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.anime-card.liked {
    border-color: rgba(244, 63, 94, 0.3);
}

.anime-card.filtered-out {
    display: none;
}

.card-link {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem;
    padding-right: 2.2rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.card-link:hover {
    text-decoration: none;
}

.card-poster-wrap {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    height: 84px;
    border-radius: 8px;
    overflow: hidden;
}

.card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-time {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
    padding: 0.2rem 0;
}

.card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.meta-tag.season {
    background: rgba(52, 211, 153, 0.1);
    color: var(--green);
}

.meta-tag.lang {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
}

/* ─── LIKE BUTTON ──────────────────────────── */
.like-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: none;
    background: rgba(15, 23, 42, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    z-index: 2;
    transition: transform 0.2s, background 0.2s;
}

.like-btn:hover {
    transform: scale(1.15);
    background: rgba(15, 23, 42, 0.8);
}

.like-btn:active {
    transform: scale(0.9);
}

.heart-icon {
    width: 18px;
    height: 18px;
    fill: var(--text-dim);
    transition: fill 0.2s, filter 0.2s;
}

.like-btn:hover .heart-icon {
    fill: rgba(244, 63, 94, 0.5);
}

.anime-card.liked .like-btn .heart-icon {
    fill: #f43f5e;
    filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.4));
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.35);
    }

    100% {
        transform: scale(1);
    }
}

.like-btn.pop {
    animation: heartPop 0.3s ease;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ─── FOOTER ───────────────────────────────── */
.app-footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

.footer-sub {
    margin-top: 0.3rem;
    font-size: 0.7rem;
}

/* ─── NOTIFICATION TOAST ───────────────────── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    color: var(--text);
    font-size: 0.85rem;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

/* ═══ DESKTOP (>768px) ═══════════════════════ */
@media (min-width: 768px) {
    .day-tabs {
        display: none;
    }

    .planning-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1.25rem;
        align-items: start;
    }

    .day-column {
        display: block !important;
    }

    .day-column {
        background: var(--bg-surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 1rem;
    }

    .day-column.today {
        border-color: var(--border-accent);
    }

    .day-column-header {
        padding: 0.5rem 0.25rem 0.75rem;
    }

    .card-link {
        padding: 0.8rem;
        padding-right: 2.2rem;
    }

    .card-poster-wrap {
        width: 68px;
        height: 95px;
    }
}

@media (min-width: 1400px) {
    .planning-container {
        max-width: 1800px;
    }
}