* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
    user-select: none;
}

:root {
    --primary: #2196F3;
    --primary-dark: #1976D2;
    --secondary: #FF4081;
    --background: #1E1E1E;
    --surface: #2D2D2D;
    --text: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    background: var(--background);
    height: 100vh;
    overflow: hidden;
}

.desktop {
    width: 100%;
    height: 100%;
    position: relative;
    background-image: url('https://images.unsplash.com/photo-1557683316-973673baf926?ixlib=rb-4.0.3');
    background-size: cover;
    background-position: center;
    filter: brightness(0.8);
}

/* Desktop Icons */
.desktop-icons {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 20px;
}

.desktop-icon {
    width: 80px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text);
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.desktop-icon i {
    font-size: 32px;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.desktop-icon span {
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Taskbar */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(45, 45, 45, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.start-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    color: var(--text);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.start-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.taskbar-apps {
    flex: 1;
    display: flex;
    gap: 8px;
    margin: 0 15px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.taskbar-apps::-webkit-scrollbar {
    display: none;
}

.taskbar-time {
    color: var(--text);
    padding: 0 15px;
    white-space: nowrap;
    font-size: 14px;
}

/* Start Menu */
.start-menu {
    position: fixed;
    bottom: 48px;
    left: 0;
    width: 300px;
    background: rgba(45, 45, 45, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 15px;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.start-menu.hidden {
    display: none;
}

.start-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.start-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

/* Windows */
.windows-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 48px;
    pointer-events: none;
}

.window {
    position: absolute;
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    min-height: 200px;
    pointer-events: auto;
    max-width: 95vw;
    max-height: 90vh;
    transition: var(--transition);
}

.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: var(--primary);
    color: var(--text);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    cursor: move;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-controls button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.window-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.window-content {
    padding: 20px;
    height: calc(100% - 44px);
    overflow: auto;
    color: var(--text);
}

/* Todo App Styles */
.todo-input {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.task-input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    transition: var(--transition);
}

.task-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.add-task-btn {
    padding: 12px 20px;
    background: var(--primary);
    color: var(--text);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.add-task-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.task-list {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    border-radius: var(--border-radius);
    flex-wrap: wrap;
    transition: var(--transition);
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.task-item.completed {
    background: rgba(76, 175, 80, 0.1);
}

.task-item.completed span {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.delete-btn {
    background: var(--secondary);
    color: var(--text);
    border: none;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-left: auto;
    transition: var(--transition);
}

.delete-btn:hover {
    background: #F50057;
    transform: translateY(-1px);
}

/* Notepad Styles */
.notepad-textarea {
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: transparent;
    color: var(--text);
    padding: 10px;
}

.notepad-textarea:focus {
    outline: none;
}

/* Calculator Styles */
.calculator-window {
    width: 300px;
}

.calculator-display {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    text-align: right;
    font-size: 24px;
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    white-space: nowrap;
    color: var(--text);
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calculator-buttons button {
    padding: 15px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.calculator-buttons button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.clear-btn {
    grid-column: span 4;
    background: var(--secondary) !important;
    color: var(--text);
}

.clear-btn:hover {
    background: #F50057 !important;
}

/* MathSolver Styles */
.mathsolver-window {
    width: 800px;
    height: 600px;
}

.mathsolver-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 20px;
}

.camera-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
}

#camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.camera-frame {
    width: 80%;
    height: 60%;
    border: 2px solid var(--primary);
    border-radius: var(--border-radius);
    box-shadow: 0 0 0 5px rgba(33, 150, 243, 0.2);
}

.capture-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.capture-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.result-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    overflow: auto;
}

.equation-display, .solution-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.equation-label, .solution-label {
    font-weight: bold;
    color: var(--primary);
    min-width: 80px;
}

.equation-text, .solution-text {
    font-family: 'Consolas', monospace;
    font-size: 16px;
    overflow-x: auto;
    white-space: nowrap;
    color: var(--text);
}

.steps-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: auto;
}

.steps-container h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.solution-steps {
    padding-left: 20px;
}

.solution-steps li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--text);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .desktop-icons {
        grid-template-columns: repeat(auto-fill, 60px);
        gap: 10px;
        padding: 10px;
    }
    
    .desktop-icon {
        width: 60px;
        height: 70px;
    }
    
    .desktop-icon i {
        font-size: 24px;
    }
    
    .desktop-icon span {
        font-size: 10px;
    }
    
    .start-menu {
        width: 250px;
    }
    
    .window {
        min-width: 250px;
    }
    
    .calculator-window {
        width: 250px;
    }
    
    .mathsolver-window {
        width: 95vw;
        height: 80vh;
    }
    
    .camera-container {
        height: 200px;
    }
    
    .equation-display, .solution-display {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .equation-label, .solution-label {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .desktop-icons {
        grid-template-columns: repeat(auto-fill, 50px);
        gap: 5px;
        padding: 5px;
    }
    
    .desktop-icon {
        width: 50px;
        height: 60px;
    }
    
    .desktop-icon i {
        font-size: 20px;
    }
    
    .desktop-icon span {
        font-size: 8px;
    }
    
    .start-menu {
        width: 200px;
    }
    
    .window {
        min-width: 200px;
    }
    
    .calculator-window {
        width: 200px;
    }
    
    .calculator-buttons button {
        padding: 8px;
        font-size: 14px;
    }
    
    .camera-container {
        height: 150px;
    }
    
    .capture-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .equation-text, .solution-text {
        font-size: 14px;
    }
    
    .window-header {
        padding: 3px 5px;
    }
    
    .window-controls button {
        width: 20px;
        height: 20px;
    }
    
    .window-content {
        padding: 10px;
    }
    
    .taskbar {
        height: 35px;
    }
    
    .start-button {
        padding: 3px 5px;
        font-size: 12px;
    }
    
    .taskbar-time {
        font-size: 12px;
    }
}

/* Study Timer App */
.studytimer-window {
    width: 500px;
    height: 600px;
}

.studytimer-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    gap: 20px;
}

.timer-display {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.timer-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-background {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: #4caf50;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
}

.timer-phase {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1em;
    color: #666;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.timer-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.start-btn {
    background-color: #4caf50;
    color: white;
}

.start-btn:hover {
    background-color: #45a049;
}

.pause-btn {
    background-color: #ff9800;
    color: white;
}

.pause-btn:hover {
    background-color: #f57c00;
}

.reset-btn {
    background-color: #f44336;
    color: white;
}

.reset-btn:hover {
    background-color: #d32f2f;
}

.timer-controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.timer-settings {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setting-group label {
    font-size: 0.9em;
    color: #666;
}

.setting-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.timer-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background-color: #fff;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-item span:first-child {
    font-size: 0.9em;
    color: #666;
}

.stat-item span:last-child {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

/* Calendar App */
.calendar-window {
    width: 800px;
    height: 600px;
}

.calendar-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    gap: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}

.calendar-header button {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.calendar-header button:hover {
    background-color: #f0f0f0;
}

.current-month {
    font-size: 1.5em;
    margin: 0;
    color: #333;
}

.calendar-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: #666;
}

.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    flex: 1;
}

.day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.day:hover {
    background-color: #f0f0f0;
}

.day.today {
    background-color: #e3f2fd;
    font-weight: bold;
}

.day.selected {
    background-color: #bbdefb;
}

.day.has-events::after {
    content: '';
    position: absolute;
    bottom: 5px;
    width: 6px;
    height: 6px;
    background-color: #2196f3;
    border-radius: 50%;
}

.day.other-month {
    color: #ccc;
}

.event-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.event-form input,
.event-form textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.event-form textarea {
    height: 60px;
    resize: vertical;
}

.add-event-btn {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-event-btn:hover {
    background-color: #45a049;
}

.events-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #fff;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.events-list h3 {
    margin-top: 0;
    color: #333;
}

.events {
    list-style: none;
    padding: 0;
    margin: 0;
}

.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.event-item:last-child {
    border-bottom: none;
}

.event-info {
    flex: 1;
}

.event-title {
    font-weight: bold;
    color: #333;
}

.event-time {
    color: #666;
    font-size: 0.9em;
}

.event-description {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.delete-event-btn {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    padding: 5px;
    font-size: 1.2em;
    transition: color 0.2s;
}

.delete-event-btn:hover {
    color: #d32f2f;
} 