/* ================================
   REALISTIC CLASSROOM WHITEBOARD/CHALKBOARD
   ================================ */

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

/* Theme CSS Variables */
:root {
    --wall-color-1: #8B7355;
    --wall-color-2: #6B5444;
    --board-color-1: #fefefe;
    --board-color-2: #f8f8f8;
    --frame-color-1: #e0e0e0;
    --frame-color-2: #d0d0d0;
    --frame-color-3: #c8c8c8;
    --tray-color-1: #c8c8c8;
    --tray-color-2: #b8b8b8;
    --text-color: #2c3e50;
    --text-secondary: #666;
    --divider-color: #4A90E2;
    --input-border: #4A90E2;
    --eraser-color-1: #333;
    --eraser-color-2: #2a2a2a;
}

/* Dark Theme (Chalkboard) */
body.dark-theme {
    --wall-color-1: #1a1a1a;
    --wall-color-2: #0d0d0d;
    --board-color-1: #2d4a2b;
    --board-color-2: #1f3a1f;
    --frame-color-1: #4a4a4a;
    --frame-color-2: #3a3a3a;
    --frame-color-3: #2a2a2a;
    --tray-color-1: #4a4a4a;
    --tray-color-2: #3a3a3a;
    --text-color: #e8e8d0;
    --text-secondary: #c8c8b0;
    --divider-color: #e8e8d0;
    --input-border: #c8c8b0;
    --eraser-color-1: #f5f5f5;
    --eraser-color-2: #e8e8e8;
}

/* THE CLASSROOM WALL */
body {
    font-family: 'Caveat', 'Patrick Hand', 'Kalam', cursive;
    background: linear-gradient(135deg, var(--wall-color-1) 0%, var(--wall-color-2) 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.6s ease;
}

/* Wall texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            90deg,
            rgba(0,0,0,0.03) 0px,
            transparent 1px,
            transparent 40px,
            rgba(0,0,0,0.03) 41px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(0,0,0,0.03) 0px,
            transparent 1px,
            transparent 40px,
            rgba(0,0,0,0.03) 41px
        );
    pointer-events: none;
    z-index: 0;
}

body.dark-theme::before {
    background-image: 
        repeating-linear-gradient(
            90deg,
            rgba(255,255,255,0.02) 0px,
            transparent 1px,
            transparent 40px,
            rgba(255,255,255,0.02) 41px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.02) 0px,
            transparent 1px,
            transparent 40px,
            rgba(255,255,255,0.02) 41px
        );
}

/* WHITEBOARD WRAPPER (includes frame) */
.container {
    width: calc(100% - 40px);
    max-width: 1600px;
    height: calc(100vh - 40px);
    position: relative;
    z-index: 1;
}

/* THE ALUMINUM FRAME */
.container::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: linear-gradient(145deg, var(--frame-color-1) 0%, var(--frame-color-2) 50%, var(--frame-color-3) 100%);
    border-radius: 8px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    z-index: -1;
    transition: all 0.6s ease;
}

/* THE WHITEBOARD/CHALKBOARD SURFACE */
.whiteboard-surface {
    width: 100%;
    height: calc(100% - 44px);
    background: linear-gradient(135deg, var(--board-color-1) 0%, var(--board-color-2) 100%);
    border-radius: 6px 6px 0 0;
    box-shadow: 
        inset 0 0 100px rgba(0, 0, 0, 0.02),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    position: relative;
    overflow-y: auto;
    padding: 40px 48px;
    transition: all 0.6s ease;
}

body.dark-theme .whiteboard-surface {
    box-shadow: 
        inset 0 0 100px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

/* Board gloss/texture effect */
.whiteboard-surface::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 6px 6px 0 0;
    transition: opacity 0.6s ease;
}

body.dark-theme .whiteboard-surface::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
}

/* Chalk dust texture for dark theme */
body.dark-theme .whiteboard-surface::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" /></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.05"/></svg>');
    pointer-events: none;
    opacity: 0.3;
}

/* BOTTOM MARKER TRAY */
.marker-tray {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: linear-gradient(180deg, var(--tray-color-1) 0%, var(--tray-color-2) 100%);
    border-radius: 0 0 6px 6px;
    box-shadow: 
        inset 0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 -2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 30px;
    transition: all 0.6s ease;
}

/* Marker cap icons on tray */
.marker {
    width: 12px;
    height: 28px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

.marker::after {
    content: '';
    position: absolute;
    top: 0;
    left: 2px;
    width: 4px;
    height: 28px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.marker-blue {
    background: linear-gradient(145deg, #4A90E2 0%, #357ABD 100%);
}

.marker-green {
    background: linear-gradient(145deg, #50C878 0%, #3da65f 100%);
}

.marker-red {
    background: linear-gradient(145deg, #E74C3C 0%, #c0392b 100%);
}

.marker-black {
    background: linear-gradient(145deg, #2c3e50 0%, #1a252f 100%);
}

body.dark-theme .marker-black {
    background: linear-gradient(145deg, #e8e8d0 0%, #d0d0b8 100%);
}

/* Eraser on tray - INTERACTIVE TOGGLE */
.eraser {
    width: 50px;
    height: 24px;
    background: linear-gradient(145deg, var(--eraser-color-1) 0%, var(--eraser-color-2) 100%);
    border-radius: 4px;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    margin-left: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.eraser:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.eraser:active {
    transform: translateY(0) scale(1);
}

.eraser::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: rgba(200, 200, 200, 0.3);
    border-radius: 2px;
    transition: background 0.3s ease;
}

body.dark-theme .eraser::after {
    background: rgba(100, 100, 100, 0.3);
}

/* ================================
   REMOVE DEFAULT HEADER & TABS
   ================================ */

header {
    display: none;
}

.tabs {
    display: none;
}

/* ================================
   WHITEBOARD CONTENT
   ================================ */

.content-section {
    display: block !important;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

#todos-section,
#habits-section {
    width: 100%;
}

/* Two-column layout with divider */
.whiteboard-layout {
    display: grid;
    grid-template-columns: 1fr 2px 1fr;
    gap: 50px;
    min-height: 100%;
}

/* Vertical divider (marker line) */
.divider {
    background: linear-gradient(180deg, 
        transparent 0%,
        var(--divider-color) 2%,
        var(--divider-color) 98%,
        transparent 100%
    );
    width: 3px;
    opacity: 0.5;
    transition: all 0.6s ease;
}

/* ================================
   SECTION HEADERS WITH INLINE STATS
   ================================ */

.section-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.section-title {
    font-size: 2.8em;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    font-family: 'Caveat', cursive;
    position: relative;
    display: inline-block;
    transition: color 0.6s ease;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 4px;
    background: #4A90E2;
    opacity: 0.4;
    border-radius: 2px;
    transition: background 0.6s ease;
}

body.dark-theme .section-title::after {
    background: var(--text-color);
}

#habits-section .section-title::after {
    background: #50C878;
}

body.dark-theme #habits-section .section-title::after {
    background: var(--text-color);
}

/* ================================
   STATISTICS - INLINE HORIZONTAL
   ================================ */

.stats {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin: 0;
    font-size: 1em;
    color: var(--text-secondary);
    font-family: 'Caveat', cursive;
    padding: 0;
    flex-wrap: wrap;
    transition: color 0.6s ease;
}

.stat-card {
    display: flex;
    align-items: baseline;
    gap: 5px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    transform: none;
}

.stat-card:hover {
    transform: none;
}

.stat-number {
    font-size: 1.4em;
    font-weight: 700;
    margin: 0;
    font-family: 'Caveat', cursive;
    transition: color 0.6s ease;
}

.stat-label {
    font-size: 1em;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-family: 'Caveat', cursive;
    color: var(--text-secondary);
    transition: color 0.6s ease;
}

.stat-card:nth-child(1) .stat-number {
    color: #4A90E2;
}

.stat-card:nth-child(2) .stat-number {
    color: #50C878;
}

.stat-card:nth-child(3) .stat-number {
    color: #E74C3C;
}

body.dark-theme .stat-card:nth-child(1) .stat-number,
body.dark-theme .stat-card:nth-child(2) .stat-number,
body.dark-theme .stat-card:nth-child(3) .stat-number {
    color: var(--text-color);
}

/* ================================
   SEARCH BAR
   ================================ */

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-bottom: 2px solid #95a5a6;
    background: transparent;
    font-size: 1.2em;
    font-family: 'Caveat', cursive;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: var(--text-secondary);
    font-family: 'Caveat', cursive;
    transition: color 0.6s ease;
}

.search-input:focus {
    outline: none;
    border-bottom: 3px solid #95a5a6;
    background: rgba(149, 165, 166, 0.05);
}

body.dark-theme .search-input {
    border-bottom-color: var(--text-secondary);
}

body.dark-theme .search-input:focus {
    border-bottom-color: var(--text-color);
    background: rgba(232, 232, 208, 0.05);
}

.clear-search-btn {
    padding: 8px 16px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Caveat', cursive;
    box-shadow: 0 2px 6px rgba(149, 165, 166, 0.3);
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.clear-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ================================
   CATEGORY FILTERS
   ================================ */

.category-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    font-size: 1.1em;
    color: var(--text-secondary);
    font-weight: 600;
    font-family: 'Caveat', cursive;
    margin-right: 5px;
    transition: color 0.6s ease;
}

.category-filter-btn {
    padding: 6px 14px;
    background: rgba(74, 144, 226, 0.1);
    color: #4A90E2;
    border: 2px solid #4A90E2;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Caveat', cursive;
    box-shadow: none;
}

.category-filter-btn:hover {
    background: rgba(74, 144, 226, 0.2);
    transform: translateY(-1px);
}

.category-filter-btn.active {
    background: #4A90E2;
    color: white;
    box-shadow: 0 3px 8px rgba(74, 144, 226, 0.3);
}

body.dark-theme .category-filter-btn {
    background: rgba(232, 232, 208, 0.1);
    color: var(--text-color);
    border-color: var(--text-color);
}

body.dark-theme .category-filter-btn:hover {
    background: rgba(232, 232, 208, 0.2);
}

body.dark-theme .category-filter-btn.active {
    background: var(--text-color);
    color: var(--board-color-1);
}

.category-filter-btn.all {
    border-color: #95a5a6;
    color: #95a5a6;
    background: rgba(149, 165, 166, 0.1);
}

.category-filter-btn.all.active {
    background: #95a5a6;
    color: white;
}

body.dark-theme .category-filter-btn.all {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

body.dark-theme .category-filter-btn.all.active {
    background: var(--text-secondary);
    color: var(--board-color-1);
}

/* Individual category filter buttons in dark mode */
body.dark-theme .category-filter-btn.work,
body.dark-theme .category-filter-btn.personal,
body.dark-theme .category-filter-btn.shopping,
body.dark-theme .category-filter-btn.school,
body.dark-theme .category-filter-btn.health,
body.dark-theme .category-filter-btn.other {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
    background: rgba(232, 232, 208, 0.05);
}

body.dark-theme .category-filter-btn.work.active,
body.dark-theme .category-filter-btn.personal.active,
body.dark-theme .category-filter-btn.shopping.active,
body.dark-theme .category-filter-btn.school.active,
body.dark-theme .category-filter-btn.health.active,
body.dark-theme .category-filter-btn.other.active {
    background: var(--text-secondary);
    color: var(--board-color-1);
}

/* Light mode specific colors (keep original) */
.category-filter-btn.work {
    border-color: #3498db;
    color: #2980b9;
    background: rgba(52, 152, 219, 0.1);
}

.category-filter-btn.work.active {
    background: #3498db;
    color: white;
}

.category-filter-btn.personal {
    border-color: #2ecc71;
    color: #27ae60;
    background: rgba(46, 204, 113, 0.1);
}

.category-filter-btn.personal.active {
    background: #2ecc71;
    color: white;
}

.category-filter-btn.shopping {
    border-color: #f1c40f;
    color: #d68910;
    background: rgba(241, 196, 15, 0.1);
}

.category-filter-btn.shopping.active {
    background: #f1c40f;
    color: white;
}

.category-filter-btn.school {
    border-color: #9b59b6;
    color: #7d3c98;
    background: rgba(155, 89, 182, 0.1);
}

.category-filter-btn.school.active {
    background: #9b59b6;
    color: white;
}

.category-filter-btn.health {
    border-color: #e74c3c;
    color: #c0392b;
    background: rgba(231, 76, 60, 0.1);
}

.category-filter-btn.health.active {
    background: #e74c3c;
    color: white;
}

.category-filter-btn.other {
    border-color: #95a5a6;
    color: #5d6d7e;
    background: rgba(149, 165, 166, 0.1);
}

.category-filter-btn.other.active {
    background: #95a5a6;
    color: white;
}

/* ================================
   INPUT FORMS
   ================================ */

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    padding: 0;
    background: transparent;
    border: none;
}

input[type="text"],
input[type="date"],
select {
    flex: 1;
    min-width: 180px;
    padding: 10px 14px;
    border: none;
    border-bottom: 2px solid var(--input-border);
    background: transparent;
    font-size: 1.2em;
    font-family: 'Caveat', cursive;
    color: var(--text-color);
    transition: all 0.3s ease;
}

input[type="text"]::placeholder {
    color: var(--text-secondary);
    font-family: 'Caveat', cursive;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-bottom: 3px solid var(--input-border);
    background: rgba(74, 144, 226, 0.05);
}

body.dark-theme input[type="text"]:focus,
body.dark-theme input[type="date"]:focus,
body.dark-theme select:focus {
    background: rgba(232, 232, 208, 0.05);
}

select {
    min-width: 130px;
    flex: 0;
    cursor: pointer;
    font-family: 'Caveat', cursive;
    font-size: 1.1em;
}

#task-category {
    min-width: 150px;
    flex: 0;
}

/* ================================
   BUTTONS
   ================================ */

button {
    padding: 10px 20px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Caveat', cursive;
    box-shadow: 0 3px 8px rgba(74, 144, 226, 0.3);
}

button:hover {
    background: #357ABD;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(74, 144, 226, 0.4);
}

button:active {
    transform: translateY(0);
}

body.dark-theme button {
    background: var(--text-color);
    color: var(--board-color-1);
    box-shadow: 0 3px 8px rgba(232, 232, 208, 0.3);
}

body.dark-theme button:hover {
    background: var(--text-secondary);
    box-shadow: 0 5px 12px rgba(232, 232, 208, 0.4);
}

/* ================================
   ITEMS LIST
   ================================ */

.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-left: 3px solid #4A90E2;
    padding-left: 15px;
    transition: all 0.3s ease;
    box-shadow: none;
}

.item:hover {
    background: rgba(74, 144, 226, 0.05);
    transform: translateX(3px);
}

body.dark-theme .item {
    border-left-color: var(--text-color);
}

body.dark-theme .item:hover {
    background: rgba(232, 232, 208, 0.05);
}

.item.completed {
    opacity: 0.5;
    background: transparent;
}

.item.completed .item-title {
    text-decoration: line-through;
    color: #999;
}

body.dark-theme .item.completed .item-title {
    color: #666;
}

.item.priority-high {
    border-left-color: #E74C3C;
}

.item.priority-medium {
    border-left-color: #F39C12;
}

.item.priority-low {
    border-left-color: #4A90E2;
}

body.dark-theme .item.priority-high,
body.dark-theme .item.priority-medium,
body.dark-theme .item.priority-low {
    border-left-color: var(--text-color);
}

.item-checkbox {
    width: 22px;
    height: 22px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #50C878;
}

body.dark-theme .item-checkbox {
    accent-color: var(--text-color);
}

.item-content {
    flex: 1;
}

.item-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
    font-family: 'Caveat', cursive;
    transition: color 0.6s ease;
}

.item-meta {
    font-size: 1em;
    color: var(--text-secondary);
    font-family: 'Caveat', cursive;
    transition: color 0.6s ease;
}

/* ================================
   OVERDUE TASKS STYLING
   ================================ */

.item.overdue {
    border-left-color: #E74C3C;
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.08) 0%, transparent 10%);
    animation: pulse-overdue 2s ease-in-out infinite;
}

@keyframes pulse-overdue {
    0%, 100% {
        background: linear-gradient(90deg, rgba(231, 76, 60, 0.08) 0%, transparent 10%);
    }
    50% {
        background: linear-gradient(90deg, rgba(231, 76, 60, 0.12) 0%, transparent 10%);
    }
}

.item.overdue:hover {
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.12) 0%, transparent 10%);
}

body.dark-theme .item.overdue {
    border-left-color: #ff6b6b;
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.15) 0%, transparent 10%);
}

.overdue-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 700;
    background: #E74C3C;
    color: white;
    margin-right: 8px;
    font-family: 'Caveat', cursive;
    letter-spacing: 0.5px;
    animation: blink-overdue 1.5s ease-in-out infinite;
}

@keyframes blink-overdue {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

body.dark-theme .overdue-badge {
    background: #ff6b6b;
}

/* ================================
   PRIORITY & CATEGORY BADGES
   ================================ */

.priority-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-right: 8px;
    font-weight: 600;
    font-family: 'Caveat', cursive;
}

.priority-badge.priority-high {
    background: rgba(231, 76, 60, 0.15);
    color: #E74C3C;
}

.priority-badge.priority-medium {
    background: rgba(243, 156, 18, 0.15);
    color: #F39C12;
}

.priority-badge.priority-low {
    background: rgba(52, 152, 219, 0.15);
    color: #4A90E2;
}

body.dark-theme .priority-badge.priority-high,
body.dark-theme .priority-badge.priority-medium,
body.dark-theme .priority-badge.priority-low {
    background: rgba(232, 232, 208, 0.2);
    color: var(--text-color);
}

.category-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    margin-right: 10px;
    font-family: 'Caveat', cursive;
    letter-spacing: 0.3px;
}

/* Category colors - Light mode */
.category-work {
    background: rgba(52, 152, 219, 0.2);
    color: #2980b9;
    border: 1px solid #3498db;
}

.category-personal {
    background: rgba(46, 204, 113, 0.2);
    color: #27ae60;
    border: 1px solid #2ecc71;
}

.category-shopping {
    background: rgba(241, 196, 15, 0.2);
    color: #d68910;
    border: 1px solid #f1c40f;
}

.category-school {
    background: rgba(155, 89, 182, 0.2);
    color: #7d3c98;
    border: 1px solid #9b59b6;
}

.category-health {
    background: rgba(231, 76, 60, 0.2);
    color: #c0392b;
    border: 1px solid #e74c3c;
}

.category-other {
    background: rgba(149, 165, 166, 0.2);
    color: #5d6d7e;
    border: 1px solid #95a5a6;
}

/* Category colors - Dark mode */
body.dark-theme .category-work,
body.dark-theme .category-personal,
body.dark-theme .category-shopping,
body.dark-theme .category-school,
body.dark-theme .category-health,
body.dark-theme .category-other {
    background: rgba(232, 232, 208, 0.15);
    color: var(--text-color);
    border: 1px solid var(--text-secondary);
}

/* ================================
   EDIT & DELETE BUTTONS
   ================================ */

.edit-btn {
    padding: 6px 14px;
    background: #50C878;
    font-size: 0.95em;
    margin-right: 8px;
    box-shadow: 0 2px 6px rgba(80, 200, 120, 0.3);
}

.edit-btn:hover {
    background: #3da65f;
}

body.dark-theme .edit-btn {
    background: var(--text-color);
    color: var(--board-color-1);
}

body.dark-theme .edit-btn:hover {
    background: var(--text-secondary);
}

.delete-btn {
    padding: 6px 14px;
    background: #E74C3C;
    font-size: 0.95em;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.delete-btn:hover {
    background: #c0392b;
}

body.dark-theme .delete-btn {
    background: #ff6b6b;
}

body.dark-theme .delete-btn:hover {
    background: #ff5252;
}

/* ================================
   EDIT MODE
   ================================ */

.input-group.edit-mode {
    background: rgba(243, 156, 18, 0.1);
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #F39C12;
}

body.dark-theme .input-group.edit-mode {
    background: rgba(232, 232, 208, 0.1);
    border-color: var(--text-secondary);
}

.edit-mode-label {
    display: none;
    color: #d68910;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1.3em;
    font-family: 'Caveat', cursive;
}

body.dark-theme .edit-mode-label {
    color: var(--text-color);
}

.input-group.edit-mode .edit-mode-label {
    display: block;
}

.cancel-btn {
    background: #95a5a6;
    box-shadow: 0 2px 6px rgba(149, 165, 166, 0.3);
}

.cancel-btn:hover {
    background: #7f8c8d;
}

/* ================================
   HABITS - STREAK COUNTER
   ================================ */

.habit-item {
    border-left-color: #50C878;
}

body.dark-theme .habit-item {
    border-left-color: var(--text-color);
}

.streak-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 15px;
    background: transparent;
    border: none;
    padding: 0;
}

.streak-number {
    font-size: 1.6em;
    font-weight: 700;
    color: #E74C3C;
    font-family: 'Caveat', cursive;
    transition: color 0.6s ease;
}

body.dark-theme .streak-number {
    color: #ff6b6b;
}

.streak-label {
    font-size: 1em;
    color: var(--text-secondary);
    font-weight: 400;
    text-transform: none;
    font-family: 'Caveat', cursive;
    transition: color 0.6s ease;
}

/* ================================
   EMPTY STATE & MESSAGES
   ================================ */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
    font-size: 1.3em;
    font-style: italic;
    background: transparent;
    border: 2px dashed #ddd;
    border-radius: 8px;
    font-family: 'Caveat', cursive;
    transition: all 0.6s ease;
}

body.dark-theme .empty-state {
    color: var(--text-secondary);
    border-color: var(--text-secondary);
}

.no-tasks-filtered {
    text-align: center;
    padding: 30px 20px;
    color: #aaa;
    font-size: 1.2em;
    font-style: italic;
    font-family: 'Caveat', cursive;
    transition: color 0.6s ease;
}

body.dark-theme .no-tasks-filtered {
    color: var(--text-secondary);
}

.no-search-results {
    text-align: center;
    padding: 30px 20px;
    color: #aaa;
    font-size: 1.2em;
    font-style: italic;
    font-family: 'Caveat', cursive;
    transition: color 0.6s ease;
}

body.dark-theme .no-search-results {
    color: var(--text-secondary);
}

.search-highlight {
    background: rgba(241, 196, 15, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
}

body.dark-theme .search-highlight {
    background: rgba(232, 232, 208, 0.3);
}

/* ================================
   STATISTICS DASHBOARD
   ================================ */

.dashboard-toggle-btn {
    width: 100%;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Caveat', cursive;
    box-shadow: 0 3px 10px rgba(155, 89, 182, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dashboard-toggle-btn:hover {
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}

body.dark-theme .dashboard-toggle-btn {
    background: linear-gradient(135deg, var(--text-color) 0%, var(--text-secondary) 100%);
    color: var(--board-color-1);
    box-shadow: 0 3px 10px rgba(232, 232, 208, 0.3);
}

body.dark-theme .dashboard-toggle-btn:hover {
    box-shadow: 0 5px 15px rgba(232, 232, 208, 0.4);
}

#dashboard-toggle-icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.dashboard-toggle-btn.active #dashboard-toggle-icon {
    transform: rotate(180deg);
}

/* Dashboard Panel */
.dashboard-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: all 0.4s ease;
    border: 2px solid transparent;
}

body.dark-theme .dashboard-panel {
    background: rgba(232, 232, 208, 0.05);
}

.dashboard-panel.open {
    max-height: 2000px;
    opacity: 1;
    margin-bottom: 25px;
    padding: 25px;
    border-color: #9b59b6;
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.2);
}

body.dark-theme .dashboard-panel.open {
    border-color: var(--text-secondary);
    box-shadow: 0 8px 25px rgba(232, 232, 208, 0.1);
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(155, 89, 182, 0.3);
}

body.dark-theme .dashboard-header {
    border-bottom-color: var(--text-secondary);
}

.dashboard-header h3 {
    font-size: 2em;
    font-weight: 700;
    color: var(--text-color);
    font-family: 'Caveat', cursive;
    margin: 0;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

body.dark-theme .chart-container {
    background: rgba(232, 232, 208, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chart-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

body.dark-theme .chart-container:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.chart-container h4 {
    font-size: 1.4em;
    font-weight: 600;
    color: var(--text-color);
    font-family: 'Caveat', cursive;
    margin: 0 0 15px 0;
    text-align: center;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    min-height: 250px;
    max-height: 300px;
}

/* Empty dashboard state */
.dashboard-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.2em;
    font-style: italic;
    font-family: 'Caveat', cursive;
}

/* ================================
   DRAG & DROP FUNCTIONALITY
   ================================ */

/* Drag & Drop Toggle Button */
.drag-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

body.dark-theme .drag-toggle-container {
    background: rgba(232, 232, 208, 0.05);
    border-color: rgba(232, 232, 208, 0.2);
}

.drag-toggle-container.active {
    background: rgba(52, 152, 219, 0.15);
    border-color: #3498db;
}

body.dark-theme .drag-toggle-container.active {
    background: rgba(232, 232, 208, 0.1);
    border-color: var(--text-secondary);
}

.drag-toggle-label {
    flex: 1;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
    font-family: 'Caveat', cursive;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drag-icon {
    font-size: 1.3em;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: #95a5a6;
    border-radius: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: #3498db;
}

body.dark-theme .toggle-switch.active {
    background: var(--text-color);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(24px);
}

/* Drag Handle */
.drag-handle {
    cursor: grab;
    padding: 5px 8px;
    margin-right: 10px;
    color: #95a5a6;
    font-size: 1.2em;
    opacity: 0;
    transition: opacity 0.3s ease;
    user-select: none;
}

.drag-mode .drag-handle {
    opacity: 1;
}

.drag-handle:hover {
    color: #7f8c8d;
}

.drag-handle:active {
    cursor: grabbing;
}

body.dark-theme .drag-handle {
    color: var(--text-secondary);
}

body.dark-theme .drag-handle:hover {
    color: var(--text-color);
}

/* Item being dragged */
.item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    border: 2px dashed #3498db;
    background: rgba(52, 152, 219, 0.1);
}

body.dark-theme .item.dragging {
    border-color: var(--text-color);
    background: rgba(232, 232, 208, 0.1);
}

/* Drop zone indicator */
.item.drag-over {
    border-top: 3px solid #3498db;
    margin-top: 8px;
}

body.dark-theme .item.drag-over {
    border-top-color: var(--text-color);
}

/* Disable other interactions while in drag mode */
.drag-mode .item:not(.dragging) .item-checkbox,
.drag-mode .item:not(.dragging) .edit-btn,
.drag-mode .item:not(.dragging) .delete-btn {
    pointer-events: none;
    opacity: 0.5;
}

/* Help text */
.drag-help-text {
    font-size: 0.95em;
    color: var(--text-secondary);
    font-style: italic;
    font-family: 'Caveat', cursive;
    margin-left: 10px;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 968px) {
    .whiteboard-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .divider {
        display: none;
    }
    
    .whiteboard-surface {
        padding: 30px 25px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        width: calc(100% - 20px);
        height: calc(100vh - 20px);
    }
    
    .section-title {
        font-size: 2.2em;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    input[type="text"],
    select {
        min-width: 100%;
    }
    
    .item {
        flex-wrap: wrap;
    }
    
    .edit-btn,
    .delete-btn {
        margin-top: 8px;
    }
    
    .marker-tray {
        gap: 12px;
        padding: 0 20px;
    }
    
    .marker {
        width: 10px;
        height: 24px;
    }
    
    .eraser {
        width: 40px;
        height: 20px;
        margin-left: 10px;
    }
    
    .category-filters {
        gap: 6px;
    }
    
    .category-filter-btn {
        padding: 5px 12px;
        font-size: 0.9em;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .clear-search-btn {
        width: 100%;
    }
}

/* ================================
   TOAST NOTIFICATIONS
   ================================ */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast {
    background: white;
    color: #2c3e50;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Caveat', cursive;
    font-size: 1.2em;
    border-left: 4px solid #3498db;
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 2.7s;
    opacity: 1;
}

body.dark-theme .toast {
    background: #2c3e50;
    color: #e8e8d0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Toast Types */
.toast.success {
    border-left-color: #50C878;
}

.toast.error {
    border-left-color: #E74C3C;
}

.toast.info {
    border-left-color: #3498db;
}

.toast.warning {
    border-left-color: #F39C12;
}

/* Toast Icon */
.toast-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

/* Toast Message */
.toast-message {
    flex: 1;
    font-weight: 600;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
    box-shadow: none;
    flex-shrink: 0;
    line-height: 1;
    font-family: Arial, sans-serif;
    font-weight: 300;
}

.toast-close:hover {
    opacity: 1;
    transform: none;
    background: none;
    box-shadow: none;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    #toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        font-size: 1.1em;
        padding: 14px 16px;
    }
}