/* study-planner.css v3 — Comprehensive CA/CMA/CS Planner */
:root {
    --planner-primary: #6366f1;
    --planner-secondary: #ec4899;
    --planner-green: #10b981;
    --planner-amber: #f59e0b;
    --planner-red: #ef4444;
    --planner-bg: rgba(255, 255, 255, 0.9);
}

/* ── Core Card ── */
.planner-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-main);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.planner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--planner-primary), var(--planner-secondary));
}

/* ── Redesigned Premium Tabs ── */
.planner-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    position: sticky;
    top: -5px;
    /* Slight offset for better feel when stuck */
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.planner-tabs::-webkit-scrollbar {
    display: none;
}

.p-tab {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
}

.p-tab i {
    font-size: 16px;
}

.p-tab.active {
    background: linear-gradient(135deg, var(--planner-primary), var(--planner-secondary));
    color: #fff !important;
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.3);
    opacity: 1;
    transform: scale(1.02);
}

.p-tab:not(.active):hover {
    background: var(--input-bg);
    opacity: 1;
    color: var(--text-primary);
}

/* ── Stats Grid ── */
.stats-grid-planner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-box {
    background: var(--input-bg);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-box .val {
    font-size: 22px;
    font-weight: 900;
    color: var(--planner-primary);
    display: block;
}

.stat-box .lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 2px;
    display: block;
}

/* ── Exam Countdown ── */
.exam-countdown-bar {
    background: linear-gradient(135deg, #1e3a8a, #3730a3);
    border-radius: 16px;
    padding: 16px;
    color: white;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.countdown-num {
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
}

.countdown-info {
    font-size: 12px;
    opacity: .85;
}

.countdown-info strong {
    font-size: 15px;
    display: block;
    margin-bottom: 2px;
}

/* ── Weekly Goal ── */
.weekly-goal-bar {
    background: var(--input-bg);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.goal-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.goal-progress-track {
    height: 10px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(to right, var(--planner-primary), var(--planner-secondary));
    transition: width 0.6s ease;
}

/* ── Pomodoro ── */
.pomodoro-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    text-align: center;
}

.pomo-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 900;
    position: relative;
    background: conic-gradient(var(--planner-primary) var(--pomo-pct, 100%), rgba(255, 255, 255, .1) 0);
    transition: background 1s linear;
}

.pomo-ring::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: #1e293b;
}

.pomo-time {
    position: relative;
    z-index: 1;
}

.pomo-label {
    font-size: 13px;
    opacity: .7;
    margin-bottom: 6px;
}

.pomo-mode-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 16px;
}

.pomo-mode-badge.focus {
    background: rgba(99, 102, 241, .3);
    color: #a5b4fc;
}

.pomo-mode-badge.break {
    background: rgba(16, 185, 129, .3);
    color: #6ee7b7;
}

.pomo-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.pomo-btn {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: transform .2s;
}

.pomo-btn:active {
    transform: scale(.95);
}

.pomo-btn.primary {
    background: var(--planner-primary);
    color: white;
}

.pomo-btn.secondary {
    background: rgba(255, 255, 255, .1);
    color: white;
}

.pomo-cycles {
    font-size: 11px;
    opacity: .5;
    margin-top: 10px;
}

/* ── Active Session Card ── */
.active-plan-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    padding: 22px;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .2);
}

.active-plan-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    align-items: flex-start;
}

.active-plan-subject {
    font-size: 17px;
    font-weight: 800;
}

.active-plan-chapter {
    font-size: 13px;
    opacity: .7;
    margin-top: 2px;
}

.priority-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
}

.priority-HIGH {
    background: rgba(239, 68, 68, .25);
    color: #fca5a5;
}

.priority-MEDIUM {
    background: rgba(245, 158, 11, .25);
    color: #fcd34d;
}

.priority-LOW {
    background: rgba(16, 185, 129, .25);
    color: #6ee7b7;
}

.timer-display {
    font-size: 40px;
    font-weight: 900;
    text-align: center;
    margin: 18px 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, .1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 18px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--planner-primary), var(--planner-secondary));
    width: 0%;
    transition: width 1s linear;
}

.plan-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item span {
    display: block;
    font-size: 10px;
    opacity: .6;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.stat-item b {
    font-size: 13px;
}

.btn-stop-plan {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    background: rgba(244, 63, 94, .2);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, .3);
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

/* ── Form ── */
.planner-form-group {
    margin-bottom: 18px;
}

.planner-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 7px;
}

.planner-input {
    width: 100%;
    padding: 13px;
    border: 2px solid var(--border);
    border-radius: 14px;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all .3s;
}

.planner-input:focus {
    border-color: var(--planner-primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
    outline: none;
}

.time-options {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.time-option {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-secondary);
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    border: 2px solid transparent;
}

.time-option.active {
    background: var(--planner-primary);
    color: white;
}

/* Priority Pills */
.priority-options {
    display: flex;
    gap: 8px;
}

.priority-opt {
    flex: 1;
    padding: 10px 6px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--input-bg);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    color: var(--text-secondary);
}

.priority-opt.sel-HIGH {
    border-color: #ef4444;
    background: #fef2f2;
    color: #ef4444;
}

.priority-opt.sel-MEDIUM {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #d97706;
}

.priority-opt.sel-LOW {
    border-color: #10b981;
    background: #f0fdf4;
    color: #059669;
}

/* ── Buttons ── */
.btn-start-plan {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--planner-primary), var(--planner-secondary));
    color: white;
    font-weight: 800;
    font-size: 15px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(99, 102, 241, .3);
    transition: transform .2s;
}

.btn-start-plan:active {
    transform: scale(.96);
}

/* ── History ── */
.history-item {
    display: flex;
    flex-direction: column;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 10px;
    gap: 8px;
}

.history-status {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--success-bg);
    color: var(--success-text);
    white-space: nowrap;
}

/* ── Revision Chips ── */
.revision-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(99, 102, 241, .1);
    color: var(--planner-primary);
    font-size: 11px;
    font-weight: 700;
    margin: 3px;
    border: 1px solid rgba(99, 102, 241, .2);
}

/* ── Quote & Booster Box ── */
.quote-box {
    background: var(--info-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.booster-box {
    background: linear-gradient(135deg, var(--info-bg), var(--background));
    text-align: left;
    border-left: 4px solid var(--planner-primary);
}

.box-label {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 9px;
    font-weight: 900;
    opacity: .4;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.quote-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 6px;
}

.booster-body {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-style: normal;
}

.quote-author {
    font-size: 11px;
    color: var(--planner-primary);
    font-weight: 700;
    margin-top: 10px;
}

/* ── Public Feed ── */
.public-list {
    display: flex;
    flex-direction: column;
}

.planner-card.active-session {
    background: var(--info-bg);
    border: 1px solid var(--planner-primary);
}

/* ── Nav button ── */
.nav-item.nav-add-plan {
    position: relative;
    z-index: 10;
}

.nav-item.nav-add-plan i {
    font-size: 22px;
    color: white;
    background: linear-gradient(135deg, var(--planner-primary), var(--planner-secondary));
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(99, 102, 241, .4);
    transition: transform .3s cubic-bezier(.175, .885, .32, 1.275);
}

@keyframes pulse-plan {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, .4);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.nav-item.nav-add-plan.session-active i {
    animation: pulse-plan 2s infinite;
}

/* Dark mode adjustments */
@media (prefers-color-scheme:dark) {
    .priority-opt.sel-HIGH {
        background: rgba(239, 68, 68, .15);
    }

    .priority-opt.sel-MEDIUM {
        background: rgba(245, 158, 11, .15);
    }

    .priority-opt.sel-LOW {
        background: rgba(16, 185, 129, .15);
    }
}

/* ── Onboarding Tour Premium Styles ── */
#tour-container {
    position: fixed;
    inset: 0;
    z-index: 5000;
    pointer-events: none;
    transition: opacity .3s ease;
}

.tour-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(1px);
    pointer-events: none; /* Make it non-blocking so user can interact with the page */
    transition: clip-path 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-tooltip {
    position: absolute;
    width: 280px;
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    pointer-events: all;
    z-index: 5001;
    border: 1px solid var(--border);
    animation: tourPop .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tourPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.tour-title {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--planner-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tour-content {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tour-dots {
    display: flex;
    gap: 4px;
}

.tour-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    transition: all .3s;
}

.tour-dot.active {
    width: 14px;
    background: var(--planner-primary);
}

.tour-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all .2s;
}

.tour-btn-next {
    background: linear-gradient(135deg, var(--planner-primary), var(--planner-secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}

.tour-btn-skip {
    background: transparent;
    color: var(--text-secondary);
}

.tour-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--input-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all .2s;
    line-height: 1;
}

.tour-close-btn:hover {
    background: var(--border);
    color: var(--planner-red);
}

.tour-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.tour-arrow-top { border-bottom-color: var(--surface); bottom: 100%; left: 50%; transform: translateX(-50%); }
.tour-arrow-bottom { border-top-color: var(--surface); top: 100%; left: 50%; transform: translateX(-50%); }
.tour-arrow-left { border-right-color: var(--surface); right: 100%; top: 50%; transform: translateY(-50%); }
.tour-arrow-right { border-left-color: var(--surface); left: 100%; top: 50%; transform: translateY(-50%); }

/* High-end Arrow Indicator */
.tour-pointer {
    position: absolute;
    z-index: 100002;
    color: white;
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    animation: tourFloat 1s ease-in-out infinite alternate;
}

@keyframes tourFloat {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.tour-ripple {
    position: absolute;
    border: 2px solid var(--planner-primary);
    border-radius: 50%;
    animation: tourRipple 2s infinite;
    pointer-events: none;
}

@keyframes tourRipple {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.tour-nav-elevated {
    z-index: 6000 !important;
    pointer-events: all;
}
