/* =========================================
   TYT/AYT/LGS Plus - Premium CSS
   ========================================= */

:root {
    /* Color Palette */
    --primary: #6366f1;
    /* Indigo */
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    /* Pink */
    --accent: #8b5cf6;
    /* Violet */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Backgrounds */
    --bg-base: #0f172a;
    /* Slate 900 */
    --bg-glass: rgba(30, 41, 59, 0.7);
    /* Slate 800 with opacity */
    --bg-glass-light: rgba(255, 255, 255, 0.05);
    --bg-glass-card: rgba(15, 23, 42, 0.6);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders & Shadows */
    --border-glass: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.4);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Animated Background Shapes --- */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: float 20s infinite alternate ease-in-out;
}

.shape1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    opacity: 0.2;
}

.shape2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -150px;
    right: -100px;
    opacity: 0.15;
    animation-delay: -5s;
}

.shape3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 40%;
    left: 40%;
    opacity: 0.1;
    animation-duration: 25s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* --- Base Layout --- */
.screen {
    width: 100vw;
    height: 100vh;
    padding: 2rem;
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: flex;
    flex-direction: column;
}

.screen.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.screen.active {
    opacity: 1;
    transform: scale(1);
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Glassmorphism Utils --- */
.glass-container {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-soft);
}

/* --- Top Navigation --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    margin-bottom: 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#back-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

#back-btn:hover {
    color: var(--text-primary);
}

.countdown-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
}

.countdown-widget:hover {
    background: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-glow);
}

.countdown-widget i {
    font-size: 1.5rem;
    color: var(--primary);
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.time-block .number {
    font-size: 1.1rem;
    font-weight: 700;
}

.time-block .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

/* --- Dashboard Header Stats --- */
.header-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-stats-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.5);
    padding: 0.3rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-glass);
}

.date-widget i {
    font-size: 1.2rem;
    color: var(--accent);
}

.date-widget span {
    font-weight: 600;
    font-size: 0.95rem;
}

.streak-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(245, 158, 11, 0.2));
    padding: 0.3rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(249, 115, 22, 0.4);
    cursor: help;
}

.streak-widget i {
    font-size: 1.3rem;
    color: #f97316;
    filter: drop-shadow(0 0 5px rgba(249, 115, 22, 0.8));
}

.streak-widget span {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.progress-stats-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(30, 41, 59, 0.5);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-glass);
}

.progress-stats-widget>div {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.progress-stats-widget i {
    font-size: 1.1rem;
}

.stat-divider {
    width: 1px;
    height: 1.5rem;
    background: var(--border-glass);
}

/* --- Selection Screen --- */
#selection-screen {
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.logo-area {
    text-align: center;
    margin-bottom: 4rem;
}

.logo-area i {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.logo-area h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-area p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.exam-cards {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.exam-card {
    position: relative;
    background: var(--bg-glass-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    width: 280px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.exam-card .card-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    transition: transform 0.4s ease;
}

.exam-card[data-exam="tyt"] .card-icon {
    color: var(--primary);
}

.exam-card[data-exam="ayt"] .card-icon {
    color: var(--secondary);
}

.exam-card[data-exam="lgs"] .card-icon {
    color: var(--success);
}

.exam-card h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.exam-card p {
    color: var(--text-secondary);
    font-weight: 300;
}

.exam-card .glow {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.5s ease;
    pointer-events: none;
}

.exam-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.exam-card:hover .card-icon {
    transform: scale(1.1);
}

.exam-card:hover .glow {
    transform: translate(-50%, -50%) scale(2);
}

/* --- Buttons --- */
button {
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-icon {
    background: var(--bg-glass-light);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 1px solid var(--border-glass);
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(15deg);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* --- Filters --- */
.subject-filters-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

#dynamic-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    margin-left: 0.5rem;
    min-width: 20px;
    font-weight: 700;
}

.filter-btn.active .badge {
    background: white;
    color: var(--primary);
}

/* --- Kanban Board --- */
.kanban-board {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    overflow-y: hidden;
}

.kanban-column {
    flex: 1;
    background: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-height: 500px;
    height: calc(100vh - 220px);
}

.column-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#col-todo h3 i {
    color: var(--secondary);
}

#col-doing h3 i {
    color: var(--warning);
}

#col-done h3 i {
    color: var(--success);
}

.count-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.kanban-dropzone {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: background 0.3s ease;
}

/* Scrollbar Styling */
.kanban-dropzone::-webkit-scrollbar {
    width: 6px;
}

.kanban-dropzone::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-dropzone::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.kanban-dropzone.drag-over {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.05);
}

/* --- Subject Groups & Accordions --- */
.subject-group {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: all 0.3s;
    flex-shrink: 0;
}

.subject-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    user-select: none;
    transition: background 0.2s;
}

.subject-group-header:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 25px -3px rgba(255, 255, 255, 0.35);
}

.sg-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subject-group-header i {
    font-size: 1.25rem;
    transition: transform 0.3s;
}

.subject-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.subject-group.expanded .subject-group-content {
    max-height: 2000px;
    padding: 0.5rem;
    gap: 0.4rem;
}

/* Base custom colors per subject for header */
.subject-matematik .subject-group-header {
    border-left: 4px solid #a5b4fc;
}

.subject-turkce .subject-group-header {
    border-left: 4px solid #f9a8d4;
}

.subject-fizik .subject-group-header {
    border-left: 4px solid #6ee7b7;
}

.subject-kimya .subject-group-header {
    border-left: 4px solid #fcd34d;
}

.subject-biyoloji .subject-group-header {
    border-left: 4px solid #c4b5fd;
}

.subject-tarih .subject-group-header {
    border-left: 4px solid #fca5a5;
}

.subject-cografya .subject-group-header {
    border-left: 4px solid #67e8f9;
}

.subject-fen .subject-group-header {
    border-left: 4px solid #6ee7b7;
}

.subject-inkilap .subject-group-header {
    border-left: 4px solid #fca5a5;
}

.subject-edebiyat .subject-group-header {
    border-left: 4px solid #f9a8d4;
}

.subject-felsefe .subject-group-header {
    border-left: 4px solid #d8b4fe;
}

.subject-din .subject-group-header {
    border-left: 4px solid #6ee7b7;
}

.subject-ingilizce .subject-group-header {
    border-left: 4px solid #93c5fd;
}

.topic-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.topic-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
    box-shadow: 0 8px 25px -3px rgba(255, 255, 255, 0.4);
}

.topic-item:active {
    cursor: grabbing;
}

.topic-item.dragging {
    opacity: 0.5;
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
}

.topic-actions {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.topic-item:hover .topic-actions {
    opacity: 1;
}

.action-move {
    width: 28px !important;
    height: 28px !important;
    font-size: 1.2rem !important;
}

.delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* --- Modals --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal.hidden .modal-content {
    transform: scale(0.9);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
}

/* Plan Specific */
.plan-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-box.highlight {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.stat-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-box.highlight .stat-value {
    color: var(--primary);
}

.plan-recommendation {
    background: rgba(236, 72, 153, 0.1);
    border-left: 4px solid var(--secondary);
    padding: 1rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.check-list {
    list-style: none;
    padding-top: 0.5rem;
}

.check-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.check-list li::before {
    content: "\eb7b";
    font-family: 'boxicons';
    color: var(--primary);
    font-size: 1.2rem;
}

/* Settings Form */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 500;
}

.glass-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.glass-input:focus {
    border-color: var(--primary);
}

select.glass-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.65rem auto;
}

select.glass-input option {
    background: var(--bg-base);
    color: var(--text-primary);
}

/* Date picker specific styling for dark theme */
::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-glass);
    margin: 1.5rem 0;
}

/* Toggle Switch */
.notification-group {
    background: rgba(99, 102, 241, 0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.toggle-switch-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border: 1px solid var(--border-glass);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Responsive */
@media (min-width: 1024px) {
    .kanban-board {
        flex-direction: row;
    }

    .kanban-column {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 1rem 0.5rem;
    }

    .header-stats .date-widget,
    .header-stats .streak-widget {
        justify-content: center;
        width: 100%;
    }

    .progress-stats-widget {
        flex-direction: column;
        gap: 0.5rem;
    }

    .progress-stats-widget>div {
        justify-content: center;
    }

    .kanban-column {
        min-height: auto;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .kanban-board {
        flex-direction: column;
        overflow-y: auto;
    }

    .kanban-column {
        height: 400px;
        flex: none;
    }

    .top-nav {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 1rem;
    }

    .nav-brand {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .header-stats {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .progress-stats-widget {
        flex-wrap: wrap;
        justify-content: center;
        border-radius: var(--radius-md);
        padding: 0.8rem;
    }

    .stat-divider {
        display: none;
    }

    .nav-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 0.5rem;
    }

    .nav-actions button {
        justify-content: center;
        font-size: 0.9rem;
        padding: 0.75rem 0.5rem;
        width: 100%;
    }

    .nav-actions .btn-icon {
        width: 100%;
        height: auto;
        padding: 0.75rem 0.5rem;
    }
}

/* ==================================
   CALENDAR WIDGET
   ================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.2rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
    z-index: 2;
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
}

.calendar-day.active-day {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
}

.calendar-day.today {
    border: 2px solid var(--accent);
}

.calendar-date-num {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 2px;
}

.calendar-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    width: 100%;
}

.cal-subj-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* Tooltip for Calendar */
.day-tooltip {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-glass);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: #fff;
    white-space: nowrap;
    z-index: 100;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.calendar-day:hover .day-tooltip {
    opacity: 1;
    visibility: visible;
}

/* --- AI Assistant --- */
.ai-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.ai-fab:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(236, 72, 153, 0.6);
}

.ai-modal-content {
    max-width: 500px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
}

.ai-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-glass);
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    animation: fadeIn 0.3s ease-out;
}

.chat-message.bot {
    flex-direction: row;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.15rem;
    border: 1px solid var(--border-glass);
    flex-shrink: 0;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.chat-message.user .chat-avatar {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

.chat-bubble {
    padding: 0.8rem 1rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 85%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.chat-message.bot .chat-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-right-radius: 4px;
    color: white;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0.8rem;
    align-items: center;
    background: transparent;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

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