:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --bg-card-hover: #1f2a40;
    --border: #2a3654;
    --text-primary: #e8ecf4;
    --text-secondary: #8b95a8;
    --text-muted: #5a6478;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

/* ===== TABS NAVIGATION ===== */
.tabs-nav {
    position: fixed;
    top: 20px;
    right: 30px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(12, 17, 27, 0.88);
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    direction: rtl;
}
.tab-btn {
    background: transparent;
    color: #8a9099;
    text-decoration: none;
    border: none;
    padding: 7px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.tab-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}
.tab-btn.active {
    color: #fff;
    background: linear-gradient(145deg, #1976d2, #0d47a1);
    box-shadow: 0 2px 10px rgba(25, 118, 210, 0.4);
    view-transition-name: active-tab;
}

@view-transition {
    navigation: auto;
}

.nav-btn-backup {
    background: rgba(255, 255, 255, 0.08);
    color: #e8eaed;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav-btn-export {
    color: #4fc3f7;
    border-color: rgba(41, 182, 246, 0.35);
    background: rgba(41, 182, 246, 0.12);
}

.nav-btn-export:hover {
    background: rgba(41, 182, 246, 0.25);
    border-color: rgba(41, 182, 246, 0.6);
    transform: translateY(-1px);
}

.nav-btn-import {
    color: #ce93d8;
    border-color: rgba(171, 71, 188, 0.35);
    background: rgba(171, 71, 188, 0.12);
}

.nav-btn-import:hover {
    background: rgba(171, 71, 188, 0.25);
    border-color: rgba(171, 71, 188, 0.6);
    transform: translateY(-1px);
}
.tab-content {
    display: none;
    width: 100%;
    height: 100vh;
}
.tab-content.active {
    display: block;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1350px) {
    .tabs-nav {
        right: 15px;
        left: 15px;
        justify-content: center;
        top: 12px;
    }
}
@media (max-width: 768px) {
    .tabs-nav {
        right: 8px;
        left: 8px;
        top: 8px;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
        padding: 5px 8px;
        border-radius: 16px;
    }
    .tab-btn {
        font-size: 0.76rem;
        padding: 5px 10px;
    }
    .nav-btn-backup {
        padding: 5px 8px;
        font-size: 0.72rem;
    }
}

/* Page Transition Animations */
@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-right {
    animation: slideInRight 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.slide-left {
    animation: slideInLeft 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
.tab-btn {
    position: relative;
    z-index: 1;
}
.tab-btn.active {
    background: transparent !important;
    box-shadow: none !important;
}
.tab-btn.active::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(145deg, #1976d2, #0d47a1);
    box-shadow: 0 2px 10px rgba(25, 118, 210, 0.4);
    border-radius: 20px;
    z-index: -1;
}

/* Index page: slide pill from left (scheduler) to right (tree) */
body.page-index .tab-btn.active::before {
    animation: slidePillFromLeft 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
@keyframes slidePillFromLeft {
    from {
        transform: translateX(-110%);
        border-radius: 20px;
    }
    to {
        transform: translateX(0);
    }
}

/* Scheduler page: slide pill from right (tree) to left (scheduler) */
body.page-scheduler .tab-btn.active::before {
    animation: slidePillFromRight 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
@keyframes slidePillFromRight {
    from {
        transform: translateX(110%);
        border-radius: 20px;
    }
    to {
        transform: translateX(0);
    }
}
