/**
 * Study Planner - Complete Styles
 * Light & Dark theme support
 */

/* CSS Variables */
.study-planner-container {
    --sp-primary: var(--primary-color, #3498db);
    --sp-primary-rgb: var(--primary-rgb, 52, 152, 219);
    --sp-secondary: var(--secondary-color, #2ecc71);
    --sp-secondary-rgb: var(--secondary-rgb, 46, 204, 113);
    --sp-bg: var(--card-bg-color, #ffffff);
    --sp-surface: var(--background-color, #ffffff);
    --sp-text: var(--text-color, #333333);
    --sp-text-muted: #6c757d;
    --sp-border: var(--border-color, rgba(52, 152, 219, 0.1));
    --sp-shadow: var(--box-shadow, 0 4px 6px rgba(0, 0, 0, 0.1));
    --sp-success: #27ae60;
    --sp-warning: #f39c12;
    --sp-info: #9b59b6;
    --sp-danger: #e74c3c;
    --sp-radius: var(--border-radius-md, 8px);
    --sp-radius-lg: var(--border-radius-lg, 16px);
    --sp-transition: var(--transition-fast, 0.2s ease);
    --sp-gradient: linear-gradient(135deg, var(--sp-primary), var(--sp-secondary));
}

.dark-theme .study-planner-container {
    --sp-text-muted: #9ca3af;
    --sp-bg: var(--card-bg-color, #171a21);
    --sp-surface: var(--background-color, #0f1115);
}

/* Container */
.study-planner-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    font-family: var(--font-family, 'Inter', sans-serif);
    color: var(--sp-text);
}

/* Header */
.study-planner-container .planner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(var(--sp-primary-rgb), 0.1), rgba(var(--sp-secondary-rgb), 0.05));
    border-radius: var(--sp-radius-lg);
    border: 1px solid rgba(var(--sp-primary-rgb), 0.15);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    width: 60px;
    height: 60px;
    background: var(--sp-gradient);
    border-radius: var(--sp-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 8px 24px rgba(var(--sp-primary-rgb), 0.35);
}

.header-text h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--sp-text);
}

.header-text p {
    margin: 0.25rem 0 0;
    opacity: 0.7;
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.study-planner-container .btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--sp-border);
    background: var(--sp-bg);
    color: var(--sp-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--sp-transition);
}

.study-planner-container .btn-icon:hover {
    border-color: var(--sp-primary);
    color: var(--sp-primary);
    background: rgba(var(--sp-primary-rgb), 0.05);
}

/* Privacy Notice */
.study-planner-container .privacy-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(46, 204, 113, 0.05));
    border: 1px solid rgba(39, 174, 96, 0.2);
    border-radius: var(--sp-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.dark-theme .study-planner-container .privacy-notice {
    background: rgba(39, 174, 96, 0.15);
}

.study-planner-container .privacy-notice i {
    color: var(--sp-success);
    font-size: 1.2rem;
}

/* Quick Stats Bar */
.study-planner-container .quick-stats-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    margin-bottom: 1.5rem;
}

.dark-theme .study-planner-container .quick-stats-bar {
    background: rgba(255, 255, 255, 0.03);
}

.quick-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    text-align: center;
}

.quick-stat i {
    font-size: 1.25rem;
    color: var(--sp-primary);
    margin-bottom: 0.25rem;
}

.quick-stat span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sp-text);
}

.quick-stat label {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content Tabs */
.content-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.content-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: var(--sp-radius);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sp-text-muted);
    cursor: pointer;
    transition: var(--sp-transition);
    white-space: nowrap;
}

.content-tab:hover {
    background: var(--sp-surface);
    color: var(--sp-text);
}

.dark-theme .content-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.content-tab.active {
    background: var(--sp-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--sp-primary-rgb), 0.3);
}

/* Content Panels */
.content-panels {
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--sp-shadow);
    min-height: 500px;
}

.content-panel {
    display: none;
}

.content-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sp-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-header h3 i {
    color: var(--sp-primary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    overflow: hidden;
}

.dark-theme .dashboard-card {
    background: rgba(255, 255, 255, 0.03);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(var(--sp-primary-rgb), 0.05);
    border-bottom: 1px solid var(--sp-border);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sp-text);
}

.card-header h3 i {
    color: var(--sp-primary);
}

.card-body {
    padding: 1.25rem;
}

.date-badge {
    background: var(--sp-gradient);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge {
    background: rgba(var(--sp-primary-rgb), 0.1);
    color: var(--sp-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--sp-warning);
}

.today-schedule-card {
    grid-column: span 2;
}

.weekly-overview-card {
    grid-column: span 3;
}

/* Progress Circle */
.progress-circle-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.progress-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: var(--sp-border);
    stroke-width: 8;
}

.dark-theme .progress-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.progress-fill {
    fill: none;
    stroke: url(#progressGrad);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-center-text span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sp-primary);
    display: block;
}

.progress-center-text small {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
}

/* Progress Legend */
.progress-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--sp-text-muted);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.completed {
    background: var(--sp-success);
}

.legend-color.pending {
    background: var(--sp-border);
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 1rem;
}

.mode-btn {
    flex: 1;
    padding: 1rem;
    background: var(--sp-bg);
    border: 2px solid var(--sp-border);
    border-radius: var(--sp-radius);
    cursor: pointer;
    text-align: center;
    transition: var(--sp-transition);
}

.mode-btn:hover {
    border-color: var(--sp-primary);
}

.mode-btn.active {
    border-color: var(--sp-primary);
    background: rgba(var(--sp-primary-rgb), 0.1);
}

.mode-btn i {
    font-size: 1.5rem;
    color: var(--sp-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.mode-btn span {
    font-weight: 600;
    color: var(--sp-text);
    display: block;
}

.mode-btn small {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
}

/* Week Days Grid */
.week-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
}

.week-day-item {
    padding: 1rem;
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    text-align: center;
    transition: var(--sp-transition);
}

.week-day-item.today {
    border-color: var(--sp-primary);
    background: rgba(var(--sp-primary-rgb), 0.1);
}

.week-day-item.completed {
    border-color: var(--sp-success);
}

.week-day-item .day-name {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.week-day-item .day-date {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sp-text);
    margin-bottom: 0.5rem;
}

.week-day-item .day-sessions {
    font-size: 0.8rem;
    color: var(--sp-text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--sp-text-muted);
}

.empty-state.small {
    padding: 1.5rem;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state.small i {
    font-size: 2rem;
}

.empty-state h4 {
    font-size: 1.1rem;
    color: var(--sp-text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.empty-state.success i {
    color: var(--sp-success);
    opacity: 1;
}

/* Goal Cards */
.goal-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: var(--sp-transition);
}

.dark-theme .goal-card {
    background: rgba(255, 255, 255, 0.03);
}

.goal-card:hover {
    border-color: rgba(var(--sp-primary-rgb), 0.3);
}

.goal-card.completed {
    opacity: 0.7;
}

.goal-card.overdue {
    border-color: var(--sp-danger);
}

.goal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.goal-header-row h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sp-text);
}

.goal-type-badge {
    padding: 0.25rem 0.75rem;
    background: rgba(var(--sp-primary-rgb), 0.1);
    color: var(--sp-primary);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.goal-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.goal-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--sp-text-muted);
}

.goal-detail i {
    color: var(--sp-primary);
}

.goal-detail.danger {
    color: var(--sp-danger);
}

.goal-detail.danger i {
    color: var(--sp-danger);
}

.goal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Session Items in Dashboard */
.session-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    margin-bottom: 0.5rem;
    transition: var(--sp-transition);
}

.dark-theme .session-item {
    background: rgba(255, 255, 255, 0.02);
}

.session-item.completed {
    opacity: 0.6;
}

.session-item .session-color {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.session-item .session-info {
    flex: 1;
}

.session-item .session-title {
    font-weight: 600;
    color: var(--sp-text);
    font-size: 0.9rem;
}

.session-item .session-time {
    font-size: 0.8rem;
    color: var(--sp-text-muted);
}

/* Backlog & Revision Mini Items */
.backlog-item,
.revision-item-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--sp-bg);
    border-radius: var(--sp-radius);
    margin-bottom: 0.5rem;
}

.backlog-color,
.revision-color {
    width: 4px;
    height: 30px;
    border-radius: 2px;
    flex-shrink: 0;
}

.backlog-info,
.revision-info {
    flex: 1;
}

.backlog-info .subject-name,
.revision-info .topic-name {
    font-weight: 600;
    color: var(--sp-text);
    font-size: 0.85rem;
    display: block;
}

.backlog-info .missed-date,
.revision-info .due-date {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
}

/* Revision Info */
.revision-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.revision-info .page-description,
.panel-header .revision-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--sp-text-muted);
}

.revision-info i {
    color: var(--sp-warning);
}

/* Buttons */
.study-planner-container .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--sp-radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--sp-transition);
}

.study-planner-container .btn-primary {
    background: var(--sp-gradient);
    color: white;
}

.study-planner-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--sp-primary-rgb), 0.3);
}

.study-planner-container .btn-outline {
    background: transparent;
    border: 2px solid var(--sp-border);
    color: var(--sp-text);
}

.study-planner-container .btn-outline:hover {
    border-color: var(--sp-primary);
    color: var(--sp-primary);
}

.study-planner-container .btn-danger {
    background: var(--sp-danger);
    color: white;
}

.study-planner-container .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.study-planner-container .btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Forms */
.goal-setup-card,
.subject-form-card,
.chapter-form-card,
.session-form-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.dark-theme .goal-setup-card,
.dark-theme .subject-form-card,
.dark-theme .chapter-form-card,
.dark-theme .session-form-card {
    background: rgba(255, 255, 255, 0.03);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(var(--sp-primary-rgb), 0.05);
    border-bottom: 1px solid var(--sp-border);
}

.form-header h4 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sp-text);
}

.form-header h4 i {
    color: var(--sp-primary);
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: var(--sp-text-muted);
    cursor: pointer;
    line-height: 1;
}

.btn-close:hover {
    color: var(--sp-danger);
}

.form-body {
    padding: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sp-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--sp-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--sp-border);
    border-radius: var(--sp-radius);
    font-size: 0.95rem;
    background: var(--sp-bg);
    color: var(--sp-text);
    transition: var(--sp-transition);
}

.dark-theme .form-group input,
.dark-theme .form-group select,
.dark-theme .form-group textarea {
    background: rgba(255, 255, 255, 0.05);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 3px rgba(var(--sp-primary-rgb), 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sp-border);
}

/* Color Picker */
.color-picker-grid {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: var(--sp-transition);
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: var(--sp-text);
    box-shadow: 0 0 0 2px var(--sp-bg);
}

/* Subjects Grid */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.subject-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    overflow: hidden;
    transition: var(--sp-transition);
}

.dark-theme .subject-card {
    background: rgba(255, 255, 255, 0.03);
}

.subject-card:hover {
    border-color: rgba(var(--sp-primary-rgb), 0.3);
    transform: translateY(-2px);
}

.subject-color-bar {
    height: 4px;
}

.subject-content {
    padding: 1.25rem;
}

.subject-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.subject-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sp-text);
    margin: 0;
}

.subject-meta {
    display: flex;
    gap: 0.5rem;
}

.subject-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.subject-badge.easy {
    background: rgba(39, 174, 96, 0.1);
    color: var(--sp-success);
}

.subject-badge.medium {
    background: rgba(243, 156, 18, 0.1);
    color: var(--sp-warning);
}

.subject-badge.hard {
    background: rgba(231, 76, 60, 0.1);
    color: var(--sp-danger);
}

.subject-progress {
    margin-bottom: 1rem;
}

.subject-progress-bar {
    height: 6px;
    background: var(--sp-border);
    border-radius: 3px;
    overflow: hidden;
}

.dark-theme .subject-progress-bar {
    background: rgba(255, 255, 255, 0.1);
}

.subject-progress-fill {
    height: 100%;
    background: var(--sp-gradient);
    transition: width 0.3s ease;
}

.subject-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--sp-text-muted);
    margin-top: 0.5rem;
}

.subject-actions {
    display: flex;
    gap: 0.5rem;
}

.subject-actions button {
    padding: 0.5rem;
    border: 1px solid var(--sp-border);
    background: var(--sp-bg);
    border-radius: var(--sp-radius);
    color: var(--sp-text-muted);
    cursor: pointer;
    transition: var(--sp-transition);
}

.subject-actions button:hover {
    border-color: var(--sp-primary);
    color: var(--sp-primary);
}

/* Schedule */
.schedule-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.view-toggle,
.planner-mode-toggle {
    display: flex;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    overflow: hidden;
}

.dark-theme .view-toggle,
.dark-theme .planner-mode-toggle {
    background: rgba(255, 255, 255, 0.03);
}

.view-btn,
.mode-toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sp-text-muted);
    cursor: pointer;
    transition: var(--sp-transition);
}

.view-btn.active,
.mode-toggle-btn.active {
    background: var(--sp-primary);
    color: white;
}

.week-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.week-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sp-text);
    min-width: 200px;
    text-align: center;
}

.schedule-container {
    overflow-x: auto;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    min-width: 900px;
    gap: 1px;
    background: var(--sp-border);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    overflow: hidden;
}

.time-column {
    display: flex;
    flex-direction: column;
}

.day-header-cell {
    height: 60px;
    background: var(--sp-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--sp-text);
}

.dark-theme .day-header-cell {
    background: rgba(255, 255, 255, 0.03);
}

.time-slot {
    height: 60px;
    background: var(--sp-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--sp-text-muted);
    border-top: 1px solid var(--sp-border);
}

.day-column {
    display: flex;
    flex-direction: column;
}

.day-header {
    height: 60px;
    background: var(--sp-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--sp-text);
}

.dark-theme .day-header {
    background: rgba(255, 255, 255, 0.03);
}

.day-header.today {
    background: rgba(var(--sp-primary-rgb), 0.1);
}

.day-header .day-name {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
    text-transform: uppercase;
}

.day-header .day-date {
    font-size: 1rem;
}

.schedule-cell {
    height: 60px;
    background: var(--sp-bg);
    border-top: 1px solid var(--sp-border);
    position: relative;
    cursor: pointer;
    transition: var(--sp-transition);
}

.schedule-cell:hover {
    background: rgba(var(--sp-primary-rgb), 0.05);
}

.schedule-cell.droppable {
    background: rgba(var(--sp-success-rgb), 0.1);
}

.session-block {
    position: absolute;
    left: 2px;
    right: 2px;
    background: var(--sp-gradient);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    color: white;
    font-size: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
}

.session-block:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.session-block.completed {
    opacity: 0.7;
}

.session-block .session-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-block .session-time {
    font-size: 0.65rem;
    opacity: 0.8;
}

/* Syllabus Tree */
.syllabus-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.syllabus-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background: var(--sp-bg);
    color: var(--sp-text);
}

.syllabus-tree {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chapter-item {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    overflow: hidden;
}

.dark-theme .chapter-item {
    background: rgba(255, 255, 255, 0.03);
}

.chapter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: var(--sp-transition);
}

.chapter-header:hover {
    background: rgba(var(--sp-primary-rgb), 0.05);
}

.chapter-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sp-text-muted);
    transition: transform 0.2s;
}

.chapter-toggle.expanded {
    transform: rotate(90deg);
}

.chapter-color {
    width: 4px;
    height: 40px;
    border-radius: 2px;
}

.chapter-info {
    flex: 1;
}

.chapter-name {
    font-weight: 600;
    color: var(--sp-text);
    margin-bottom: 0.25rem;
}

.chapter-meta {
    font-size: 0.8rem;
    color: var(--sp-text-muted);
}

.chapter-progress {
    width: 120px;
}

.chapter-progress-bar {
    height: 6px;
    background: var(--sp-border);
    border-radius: 3px;
    overflow: hidden;
}

.chapter-progress-fill {
    height: 100%;
    background: var(--sp-success);
    transition: width 0.3s;
}

.chapter-progress-text {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
    text-align: right;
    margin-top: 0.25rem;
}

.chapter-actions button {
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--sp-text-muted);
    cursor: pointer;
}

.chapter-actions button:hover {
    color: var(--sp-primary);
}

.topics-list {
    padding: 0 1.25rem 1rem 3.5rem;
    display: none;
}

.topics-list.expanded {
    display: block;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--sp-radius);
    transition: var(--sp-transition);
}

.topic-item:hover {
    background: rgba(var(--sp-primary-rgb), 0.05);
}

.topic-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--sp-border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--sp-transition);
    background: transparent;
    color: transparent;
}

.topic-checkbox:hover {
    border-color: var(--sp-success);
}

.topic-checkbox.checked {
    background: var(--sp-success);
    border-color: var(--sp-success);
    color: white;
}

.topic-name {
    flex: 1;
    color: var(--sp-text);
}

.topic-item.completed .topic-name {
    text-decoration: line-through;
    opacity: 0.6;
}

.topic-revision {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
}

/* Revisions */
.revision-intervals {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    flex-wrap: wrap;
}

.dark-theme .revision-intervals {
    background: rgba(255, 255, 255, 0.03);
}

.interval-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
}

.interval-icon {
    width: 40px;
    height: 40px;
    background: var(--sp-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.interval-info h5 {
    margin: 0 0 0.25rem;
    color: var(--sp-text);
    font-size: 0.9rem;
}

.interval-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--sp-text-muted);
}

.interval-arrow {
    color: var(--sp-text-muted);
}

.revisions-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.revision-group h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sp-text);
}

.revision-group h4 i {
    color: var(--sp-primary);
}

.revision-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.revision-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
}

.dark-theme .revision-item {
    background: rgba(255, 255, 255, 0.03);
}

.revision-item.overdue {
    border-color: var(--sp-danger);
    background: rgba(231, 76, 60, 0.05);
}

.revision-color {
    width: 4px;
    height: 30px;
    border-radius: 2px;
}

.revision-info {
    flex: 1;
}

.revision-topic {
    font-weight: 600;
    color: var(--sp-text);
    font-size: 0.9rem;
}

.revision-subject {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
}

.revision-date {
    font-size: 0.8rem;
    color: var(--sp-text-muted);
}

.revision-actions button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--sp-success);
    background: transparent;
    color: var(--sp-success);
    border-radius: var(--sp-radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--sp-transition);
}

.revision-actions button:hover {
    background: var(--sp-success);
    color: white;
}

/* Analytics */
.period-selector {
    display: flex;
    gap: 0.5rem;
}

.period-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--sp-border);
    background: transparent;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sp-text-muted);
    cursor: pointer;
    transition: var(--sp-transition);
}

.period-btn:hover {
    border-color: var(--sp-primary);
    color: var(--sp-primary);
}

.period-btn.active {
    background: var(--sp-primary);
    border-color: var(--sp-primary);
    color: white;
}

.analytics-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
}

.dark-theme .stat-card {
    background: rgba(255, 255, 255, 0.03);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--sp-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.primary .stat-icon {
    background: rgba(var(--sp-primary-rgb), 0.1);
    color: var(--sp-primary);
}

.stat-card.success .stat-icon {
    background: rgba(39, 174, 96, 0.1);
    color: var(--sp-success);
}

.stat-card.info .stat-icon {
    background: rgba(155, 89, 182, 0.1);
    color: var(--sp-info);
}

.stat-card.warning .stat-icon {
    background: rgba(243, 156, 18, 0.1);
    color: var(--sp-warning);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sp-text);
    display: block;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--sp-text-muted);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 1.25rem;
}

.dark-theme .chart-card {
    background: rgba(255, 255, 255, 0.03);
}

.chart-card h4 {
    font-size: 1rem;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sp-text);
}

.chart-card h4 i {
    color: var(--sp-primary);
}

.bar-chart {
    height: 200px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    padding: 1rem 0;
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

.chart-bar {
    width: 30px;
    background: var(--sp-gradient);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s;
    min-height: 4px;
    margin-top: auto;
}

.chart-label {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
    margin-top: 0.5rem;
}

.subject-distribution {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dist-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.dist-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--sp-text);
}

.dist-bar {
    flex: 2;
    height: 8px;
    background: var(--sp-border);
    border-radius: 4px;
    overflow: hidden;
}

.dist-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.dist-percent {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sp-text-muted);
    width: 50px;
    text-align: right;
}

/* Streak Section */
.streak-section {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 1.5rem;
}

.dark-theme .streak-section {
    background: rgba(255, 255, 255, 0.03);
}

.streak-section h4 {
    font-size: 1rem;
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sp-text);
}

.streak-section h4 i {
    color: var(--sp-warning);
}

.streak-display {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.streak-current,
.streak-best,
.streak-total {
    text-align: center;
}

.streak-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--sp-primary);
    display: block;
}

.streak-label {
    font-size: 0.85rem;
    color: var(--sp-text-muted);
}

.calendar-heatmap {
    display: grid;
    grid-template-columns: repeat(52, 1fr);
    gap: 3px;
    margin-bottom: 1rem;
}

.heatmap-day {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
    background: var(--sp-border);
}

.dark-theme .heatmap-day {
    background: rgba(255, 255, 255, 0.1);
}

.heatmap-day.level-1 {
    background: rgba(var(--sp-primary-rgb), 0.3);
}

.heatmap-day.level-2 {
    background: rgba(var(--sp-primary-rgb), 0.5);
}

.heatmap-day.level-3 {
    background: rgba(var(--sp-primary-rgb), 0.7);
}

.heatmap-day.level-4 {
    background: var(--sp-primary);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--sp-text-muted);
}

.legend-box {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-box.level-0 {
    background: var(--sp-border);
}

.legend-box.level-1 {
    background: rgba(var(--sp-primary-rgb), 0.3);
}

.legend-box.level-2 {
    background: rgba(var(--sp-primary-rgb), 0.5);
}

.legend-box.level-3 {
    background: rgba(var(--sp-primary-rgb), 0.7);
}

.legend-box.level-4 {
    background: var(--sp-primary);
}

/* Modals */
.study-planner-container .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--sp-bg);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sp-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sp-text);
}

.modal-header h3 i {
    color: var(--sp-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 1.75rem;
    color: var(--sp-text-muted);
    cursor: pointer;
    line-height: 1;
    border-radius: 50%;
    transition: var(--sp-transition);
}

.modal-close:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--sp-danger);
}

.modal-body {
    padding: 1.5rem;
}

/* Pomodoro Modal */
.pomodoro-modal-content {
    max-width: 400px;
}

.pomo-session-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.pomo-tab {
    padding: 0.5rem 1rem;
    border: 2px solid var(--sp-border);
    background: transparent;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sp-text-muted);
    cursor: pointer;
    transition: var(--sp-transition);
}

.pomo-tab.active {
    background: var(--sp-primary);
    border-color: var(--sp-primary);
    color: white;
}

.pomo-timer-display {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
}

.pomo-progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pomo-ring-bg {
    fill: none;
    stroke: var(--sp-border);
    stroke-width: 8;
}

.dark-theme .pomo-ring-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.pomo-ring-progress {
    fill: none;
    stroke: var(--sp-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.5s;
}

.pomo-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--sp-text);
}

.pomo-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pomo-controls .btn-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pomo-session-info {
    text-align: center;
    color: var(--sp-text-muted);
    font-size: 0.9rem;
}

/* Export Modal */
.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.export-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--sp-surface);
    border: 2px solid var(--sp-border);
    border-radius: var(--sp-radius);
    cursor: pointer;
    transition: var(--sp-transition);
}

.dark-theme .export-option {
    background: rgba(255, 255, 255, 0.03);
}

.export-option:hover {
    border-color: var(--sp-primary);
    transform: translateY(-2px);
}

.export-option i {
    font-size: 2rem;
    color: var(--sp-primary);
}

.export-option span {
    font-weight: 600;
    color: var(--sp-text);
}

.export-option small {
    font-size: 0.8rem;
    color: var(--sp-text-muted);
}

/* Settings */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h4 {
    font-size: 1rem;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--sp-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sp-text);
}

.settings-section h4 i {
    color: var(--sp-primary);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--sp-border);
}

.setting-row label {
    color: var(--sp-text);
    font-size: 0.95rem;
}

.setting-row input[type="number"],
.setting-row input[type="time"] {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    text-align: center;
    background: var(--sp-bg);
    color: var(--sp-text);
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--sp-border);
    border-radius: 26px;
    transition: var(--sp-transition);
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--sp-transition);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--sp-primary);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

.setting-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sp-border);
}

/* Help Modal */
.help-section {
    margin-bottom: 1.5rem;
}

.help-section h4 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sp-text);
}

.help-section h4 i {
    color: var(--sp-primary);
}

.help-section p {
    color: var(--sp-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.help-section ul {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--sp-text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

.help-section li {
    margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .today-schedule-card {
        grid-column: span 2;
    }

    .weekly-overview-card {
        grid-column: span 2;
    }
}

@media (max-width: 992px) {
    .study-planner-container .quick-stats-bar {
        grid-template-columns: repeat(3, 1fr);
    }

    .analytics-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .streak-display {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .study-planner-container {
        padding: 1rem;
    }

    .study-planner-container .planner-header {
        flex-direction: column;
        text-align: center;
    }

    .header-content {
        flex-direction: column;
    }

    .study-planner-container .quick-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-stat span {
        font-size: 1.25rem;
    }

    .content-tabs {
        gap: 0.25rem;
        padding: 0.25rem;
    }

    .content-tab {
        padding: 0.75rem 1rem;
    }

    .content-tab span {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .today-schedule-card,
    .weekly-overview-card {
        grid-column: span 1;
    }

    .week-days-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .schedule-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-grid {
        min-width: 600px;
    }

    .analytics-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .streak-display {
        flex-direction: column;
        gap: 1rem;
    }

    .streak-number {
        font-size: 2rem;
    }

    .export-options {
        grid-template-columns: 1fr;
    }

    .setting-actions-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-height: 80vh;
        margin: 1rem;
    }

    .revision-intervals {
        flex-direction: column;
    }

    .interval-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .study-planner-container .quick-stats-bar {
        grid-template-columns: 1fr;
    }

    .mode-selector {
        flex-direction: column;
    }

    .week-days-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}