* {
    box-sizing: border-box;
    user-select: none;
}

body, html {
    margin: 0; 
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: #f0f7f3;
    color: #202124;
    overflow: hidden;
}

body.dark-mode {
    background: #202124;
    color: #f0f7f3;
}

#customCursor {
    position: fixed;
    width: 36px;
    height: 36px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: url('https://cdn.jsdelivr.net/gh/hql287/cursors@latest/ecology/eco-pointer.cur') no-repeat center / contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: transform 0.1s ease;
}

.desktop {
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 56px;
    display: flex;
    flex-wrap: wrap;
    padding: 24px;
    overflow: auto;
    z-index: 1;
}

.wallpaper {
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 56px;
    background-size: cover;
    background-position: center;
    filter: brightness(0.95);
    transition: filter 0.3s ease;
    z-index: 0;
}

.desktop-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    z-index: 2;
}

.desktop-icon {
    width: 80px; 
    height: 96px;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    transition: transform 0.2s ease;
    z-index: 3;
    cursor: pointer;
}

.desktop-icon:hover {
    transform: scale(1.1) translateY(-4px);
}

.desktop-icon .icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.desktop-icon .label {
    font-size: 12px;
    text-align: center;
    background: rgba(255,255,255,0.8);
    padding: 2px 6px;
    border-radius: 4px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.taskbar {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0;
    height: 56px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 -1px 4px rgba(0,0,0,0.1);
    display: flex; 
    align-items: center; 
    padding: 0 16px;
    z-index: 1000;
}

.launcher-btn {
    width: 48px; 
    height: 48px;
    border-radius: 50%;
    background: #4285f4;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.launcher-btn:hover {
    background: #3367d6;
}

.launcher-icon {
    display: grid;
    grid-template-columns: repeat(3, 6px);
    grid-template-rows: repeat(3, 6px);
    gap: 4px;
    margin: auto;
}

.launcher-icon .dot {
    background-color: white;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.running-apps {
    flex: 1;
    margin-left: 12px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.system-tray {
    display: flex; 
    align-items: center; 
    gap: 12px;
    font-size: 14px; 
    color: #5f6368;
}

.tray-icon {
    opacity: 0.7;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.tray-time {
    font-weight: 500;
}

.app-launcher {
    position: fixed; 
    bottom: 64px; 
    left: 16px;
    width: 360px; 
    max-height: 480px;
    background: white; 
    border-radius: 28px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1200;
}

.launcher-grid {
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 16px; 
    padding: 16px;
}

.launcher-app {
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.launcher-app:hover {
    background: #f1f3f4;
}

.app-window {
    position: absolute;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 100;
    background: white;
}

body.dark-mode .app-window {
    background: #333;
}

.window-header {
    background: #f1f3f4; 
    color: #202124;
    padding: 8px 16px; 
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.window-controls {
    display: flex;
    gap: 4px;
}

.window-btn {
    border-radius: 50%; 
    width: 24px; 
    height: 24px;
    border: none;
    cursor: pointer;
}

.window-btn.close-btn {
    background: #ea4335;
    color: white;
}

.window-btn.minimize-btn {
    background: #fbbc04;
    color: white;
}

.window-btn.maximize-btn {
    background: #34a853;
    color: white;
}

.notifications {
    position: fixed; 
    top: 10px; 
    right: 10px; 
    z-index: 2000;
}

.notification {
    background: #4caf50; 
    color: white; 
    padding: 10px; 
    margin: 5px; 
    border-radius: 5px;
    max-width: 300px;
}

.modal {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    display: flex; 
    justify-content: center; 
    align-items: center;
    z-index: 1500;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white; 
    padding: 20px; 
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.modal-content button {
    padding: 10px 20px;
    margin: 5px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.eco-calculator-form {
    display: flex; 
    flex-direction: column; 
    gap: 14px;
}

.eco-calculator-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.calculate-btn {
    padding: 12px 22px; 
    border-radius: 14px; 
    background: linear-gradient(110deg, #00b05e, #61d69b); 
    color: white; 
    border: none;
    cursor: pointer;
}

.calculate-btn:hover {
    background: linear-gradient(120deg, #15ce73, #9cddb0);
}

.calculator-results.hidden {
    display: none;
}

#co2Value {
    font-size: 42px; 
    font-weight: 900; 
    color: #42a162;
}

.eco-tip {
    background: #e0f3e6; 
    padding: 10px 16px; 
    border-radius: 11px;
    margin-top: 10px;
}

.chat-container {
    display: flex; 
    flex-direction: column; 
    height: 100%;
}

.chat-messages {
    flex-grow: 1; 
    overflow-y: auto; 
    background: #f3f9f4; 
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.chat-message {
    display: flex; 
    align-items: flex-start; 
    gap: 10px; 
    margin-bottom: 14px;
}

.chat-message.user-message {
    justify-content: flex-end;
}

.message-content {
    background: #d3f2cf; 
    border-radius: 14px 14px 14px 3px; 
    padding: 8px 14px; 
    max-width: 68%;
}

.chat-message.bot-message .message-content {
    background: #94d785; 
    border-radius: 14px 14px 3px 14px;
}

.chat-input-container {
    display: flex; 
    margin-top: 12px; 
    padding: 8px 14px; 
    background: #d4f3d1; 
    border-radius: 12px;
}

.chat-input {
    flex-grow: 1; 
    border-radius: 16px; 
    border: 1.9px solid #b3d8a7; 
    padding: 10px 14px;
}

.chat-send-btn {
    margin-left: 12px; 
    background: #2cc17e; 
    padding: 11px 22px; 
    border-radius: 16px; 
    color: white; 
    border: none;
    cursor: pointer;
}

.chat-send-btn:hover {
    background: #009e4a;
}

.notes-container {
    display: flex; 
    flex-direction: column; 
    height: 100%;
}

.notes-toolbar {
    display: flex; 
    justify-content: flex-end; 
    margin-bottom: 10px;
}

.notes-btn {
    padding: 10px 20px; 
    background: #35b37e; 
    color: white; 
    border-radius: 16px; 
    border: none;
    cursor: pointer;
}

.notes-btn:hover {
    background: #23894f;
}

.notes-list {
    flex-grow: 1; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 12px;
}

.note-item {
    background: #e5f3e7; 
    padding: 14px 18px; 
    border-radius: 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.note-delete {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

.note-delete:hover {
    color: #b74f26;
}

.gallery-container {
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    gap: 10px;
}

.gallery-header {
    font-weight: 700; 
    font-size: 18px; 
    padding-bottom: 6px; 
    border-bottom: 1.4px solid #ccead0;
}

.gallery-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
    gap: 10px 16px; 
    padding-top: 10px; 
    overflow-y: auto; 
    flex-grow: 1;
}

.gallery-item {
    border-radius: 16px; 
    box-shadow: 0 2px 10px rgb(31 152 75 / 0.29); 
    overflow: hidden; 
    cursor: pointer;
}

.gallery-image {
    width: 100%; 
    height: 110px; 
    object-fit: cover;
}

.news-container {
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    gap: 12px;
}

.news-feed {
    flex-grow: 1; 
    overflow-y: auto; 
    padding-right: 8px;
}

.news-article {
    display: flex; 
    gap: 14px; 
    border-radius: 14px; 
    background: #dcf7db; 
    padding: 14px 13px; 
    box-shadow: 0 5px 15px rgb(41 115 65 / 0.15);
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.news-article:hover {
    box-shadow: 0 6px 22px rgb(37 121 52 / 0.35); 
    transform: translateY(-4px) scale(1.02);
}

.news-image {
    width: 100px; 
    height: 68px; 
    border-radius: 14px; 
    object-fit: cover;
}

.news-title {
    font-weight: 700; 
    font-size: 16px; 
    margin-bottom: 6px; 
    color: #176d44;
}

.news-summary {
    font-size: 13px; 
    opacity: 0.85;
}

.news-date {
    font-size: 11px; 
    opacity: 0.4; 
    font-weight: 600; 
    margin-top: 10px; 
    align-self: flex-end;
}

.dashboard-container {
    display: flex; 
    flex-direction: column; 
    gap: 28px; 
    height: 100%;
}

.dashboard-stats {
    display: flex; 
    justify-content: space-between; 
    gap: 28px;
}

.stat-card {
    flex: 1; 
    background: #d6f0db; 
    border-radius: 19px; 
    padding: 24px 12px; 
    text-align: center; 
    font-weight: 700; 
    color: #206139; 
    font-size: 16px;
}

.stat-value {
    font-size: 36px; 
    font-weight: 900; 
    line-height: 1; 
    margin-bottom: 8px;
}

.stat-label {
    font-weight: 600; 
    opacity: 0.55;
}

.loading-screen {
    position: fixed; 
    top: 0; 
    left: 0; 
    bottom: 0; 
    right: 0; 
    background: #d8f1dd; 
    z-index: 9999; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-direction: column;
}

.loading-content {
    text-align: center; 
    color: #1fbe60;
}

.loading-logo {
    font-size: 48px; 
    margin-bottom: 10px;
}

.loading-text {
    font-weight: 800; 
    font-size: 22px; 
    margin-bottom: 6px;
}

.loading-subtitle {
    font-weight: 600; 
    opacity: 0.7; 
    margin-bottom: 12px;
}

.loading-spinner {
    border: 5px solid #c6e9cb; 
    border-top: 5px solid #34b364; 
    border-radius: 50%; 
    width: 48px; 
    height: 48px; 
    animation: spin 1.1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

@media (max-width: 900px) {
    .app-window {
        width: 90vw !important; 
        height: 80vh !important; 
        top: 8vh !important; 
        left: 5vw !important;
    }

    .desktop {
        padding-left: 24px; 
        padding-right: 24px;
    }

    .app-launcher {
        width: 260px !important; 
        max-height: 360px !important;
    }

    .taskbar {
        height: 56px;
    }
}

@media (max-width: 600px) {
    .desktop-icons {
        gap: 9px 14px;
    }

    .desktop-icon {
        width: 56px; 
        height: 70px; 
        font-size: 10px;
    }

    .desktop-icon .icon {
        font-size: 28px;
    }

    .window-header {
        font-size: 16px;
    }
}

::-webkit-scrollbar {
    width: 8px; 
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(39, 113, 58, 0.25); 
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(39, 113, 58, 0.45);
}

input, textarea, select {
    user-select: text;
}

.desktop-icon:focus,
.launcher-app:focus,
.window-btn:focus,
.chat-input:focus,
.calculate-btn:focus,
.notes-btn:focus {
    outline: 3px solid #35a45e; 
    outline-offset: 3px;
}

button {
    font-family: inherit; 
    font-size: inherit; 
    line-height: 1; 
    outline: none;
}

button:disabled {
    opacity: 0.5; 
    cursor: not-allowed;
}

a {
    color: inherit; 
    text-decoration: none;
}

::selection {
    background-color: #53b779; 
    color: white;
}
