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

:root {
    --bg: #f5f5f0;
    --text: #2c2c2c;
    --desk-wood: #8b7355;
    --desk-wood-dark: #6b5845;
    --notebook-blue: #4a90e2;
    --postit-yellow: #ffd966;
    --plant-green: #5a9367;
    --mug-white: #e8e8e8;
    --shadow: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] {
    --bg: #1a1a1a;
    --text: #e0e0e0;
    --desk-wood: #4a3f35;
    --desk-wood-dark: #3a2f25;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1000;
    cursor: pointer;
}

.toggle-container {
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    position: relative;
    transition: background 0.3s ease;
    border: 2px solid var(--text);
}

.toggle-slider {
    width: 22px;
    height: 22px;
    background: var(--text);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .toggle-slider {
    transform: translateX(30px);
}

/* Back Home */
.back-home {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 200;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--text);
    border-radius: 50px;
    transition: all 0.3s ease;
    text-transform: lowercase;
    background: transparent;
}

.back-home:hover {
    background: var(--text);
    color: var(--bg);
}

/* Zoom Controls */
.zoom-controls {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    gap: 0.5rem;
}

.zoom-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--text);
    background: var(--bg);
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 200;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: var(--text);
    color: var(--bg);
    transform: scale(1.1);
}

/* 3D Scene */
.scene-container {
    width: 100%;
    height: 100vh;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desk-wrapper {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    transform: rotateX(45deg) rotateZ(-15deg) scale(1);
}

/* Desk Surface */
.desk {
    width: 800px;
    height: 600px;
    background: linear-gradient(135deg, var(--desk-wood) 0%, var(--desk-wood-dark) 100%);
    border-radius: 10px;
    position: relative;
    transform-style: preserve-3d;
    box-shadow:
        0 20px 60px var(--shadow),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.desk::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(90deg,
            transparent,
            transparent 80px,
            rgba(0, 0, 0, 0.03) 80px,
            rgba(0, 0, 0, 0.03) 81px);
    border-radius: 10px;
    pointer-events: none;
}

/* Desk Items Base */
.desk-item {
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.desk-item:hover {
    transform: translateZ(20px) scale(1.05);
}

/* Notebook */
.notebook {
    top: 150px;
    left: 100px;
    width: 200px;
    height: 250px;
}

.notebook-cover {
    width: 100%;
    height: 100%;
    background: var(--notebook-blue);
    border-radius: 5px;
    box-shadow:
        0 10px 30px var(--shadow),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.notebook-cover::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(0, 0, 0, 0.2);
}

.notebook-label {
    color: white;
    font-size: 1.2rem;
    font-weight: 300;
    text-transform: lowercase;
    letter-spacing: 0.1em;
}

/* Post-it Notes */
.postit {
    top: 100px;
    right: 150px;
    width: 150px;
    height: 150px;
}

.postit-content {
    width: 100%;
    height: 100%;
    background: var(--postit-yellow);
    box-shadow: 0 8px 20px var(--shadow);
    padding: 1rem;
    position: relative;
}

.postit-lines {
    width: 100%;
    height: 2px;
    background: rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.postit-label {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    font-size: 0.9rem;
    font-weight: 300;
    text-transform: lowercase;
    color: #666;
}

/* Calendar */
.calendar {
    top: 80px;
    left: 350px;
    width: 120px;
    height: 140px;
    pointer-events: none;
}

.calendar-header {
    background: #e74c3c;
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    font-weight: 300;
    border-radius: 5px 5px 0 0;
}

.calendar-date {
    background: white;
    color: #2c2c2c;
    text-align: center;
    font-size: 3rem;
    font-weight: 200;
    padding: 1rem;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 8px 20px var(--shadow);
}

/* Coffee Mug */
.mug {
    bottom: 100px;
    right: 100px;
    width: 80px;
    height: 100px;
    pointer-events: none;
}

.mug-body {
    width: 60px;
    height: 80px;
    background: var(--mug-white);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 20px var(--shadow);
    position: relative;
}

.mug-handle {
    position: absolute;
    right: -15px;
    top: 20px;
    width: 25px;
    height: 40px;
    border: 4px solid var(--mug-white);
    border-left: none;
    border-radius: 0 20px 20px 0;
}

/* Plant */
.plant {
    bottom: 120px;
    left: 120px;
    width: 80px;
    height: 100px;
    pointer-events: none;
}

.pot {
    width: 60px;
    height: 50px;
    background: #c17854;
    border-radius: 0 0 10px 10px;
    margin: 0 auto;
    box-shadow: 0 8px 20px var(--shadow);
}

.leaves {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.leaf {
    width: 30px;
    height: 40px;
    background: var(--plant-green);
    border-radius: 50% 0;
    position: absolute;
    box-shadow: 0 4px 10px var(--shadow);
}

.leaf:nth-child(1) {
    transform: rotate(-30deg);
    left: -15px;
}

.leaf:nth-child(2) {
    transform: rotate(0deg);
    left: 0;
    top: -10px;
}

.leaf:nth-child(3) {
    transform: rotate(30deg);
    left: 15px;
}

/* Pen Holder */
.pen-holder {
    bottom: 150px;
    left: 350px;
    width: 60px;
    height: 80px;
    pointer-events: none;
}

.holder-body {
    width: 50px;
    height: 60px;
    background: #34495e;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 20px var(--shadow);
    margin: 0 auto;
}

.pen {
    width: 6px;
    height: 80px;
    background: linear-gradient(to bottom, #3498db 0%, #3498db 70%, #f39c12 70%);
    position: absolute;
    border-radius: 3px;
    box-shadow: 0 4px 10px var(--shadow);
}

.pen:nth-child(2) {
    left: 15px;
    top: -20px;
}

.pen:nth-child(3) {
    left: 30px;
    top: -15px;
    background: linear-gradient(to bottom, #e74c3c 0%, #e74c3c 70%, #f39c12 70%);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--text);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 300;
    text-transform: lowercase;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text);
    transition: opacity 0.3s ease;
    font-weight: 200;
}

.close-btn:hover {
    opacity: 0.7;
}

/* Notebook Modal */
#notesArea {
    width: 100%;
    min-height: 400px;
    background: transparent;
    border: 2px solid var(--text);
    border-radius: 10px;
    padding: 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 200;
    color: var(--text);
    resize: vertical;
    line-height: 1.8;
}

#notesArea:focus {
    outline: none;
    border-color: var(--notebook-blue);
}

.modal-footer {
    margin-top: 1rem;
    text-align: right;
}

.save-indicator {
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.6;
    font-weight: 200;
}

/* Todo Modal */
.todo-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.todo-input-container input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 2px solid var(--text);
    border-radius: 50px;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 200;
}

.todo-input-container input:focus {
    outline: none;
    border-color: var(--postit-yellow);
}

.todo-input-container button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--text);
    background: var(--text);
    color: var(--bg);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 200;
}

.todo-input-container button:hover {
    transform: scale(1.1);
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 217, 102, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.todo-item:hover {
    background: rgba(255, 217, 102, 0.2);
}

.todo-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.todo-item label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 200;
    cursor: pointer;
}

.todo-item.completed label {
    text-decoration: line-through;
    opacity: 0.5;
}

.todo-item button {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.todo-item button:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .desk {
        width: 400px;
        height: 300px;
    }

    .notebook {
        width: 100px;
        height: 125px;
        top: 75px;
        left: 50px;
    }

    .postit {
        width: 80px;
        height: 80px;
        top: 50px;
        right: 75px;
    }

    .calendar {
        width: 60px;
        height: 70px;
        top: 40px;
        left: 175px;
    }

    .calendar-date {
        font-size: 1.5rem;
    }

    .mug,
    .plant,
    .pen-holder {
        transform: scale(0.7);
    }
}