/* Variáveis e reset */
:root {
    --taskbar-height: 40px;
    --taskbar-color: rgba(48, 48, 48, 0.85);
    --accent-color: #0078d7;
    --window-header-height: 30px;
}

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

/* Estilos gerais */
body {
    background: url('assets/images/wallpaper.jpeg') no-repeat center center fixed;
    background-size: cover;
    background-color: #000; /* Cor de fallback caso a imagem falhe */
    overflow: hidden;
    height: 100vh;
}

.desktop {
    height: calc(100vh - var(--taskbar-height));
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px); /* Aumentado de 70px para 80px */
    grid-template-rows: repeat(auto-fill, 80px);     /* Aumentado de 70px para 80px */
    gap: 25px; /* Aumentado de 20px para 25px */
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centraliza verticalmente */
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    padding: 15px 10px; /* AUMENTADO: mais espaço vertical e horizontal */
    border-radius: 8px; /* Arredondamento mais suave */
    transition: background-color 0.2s;
    user-select: none;
    width: 100%; /* Ocupa todo o espaço da célula da grid */
    height: 100%; /* Ocupa todo o espaço da célula da grid */
    box-sizing: border-box; /* Inclui padding na largura/altura */
}

.desktop-icon:hover {
    background-color: rgba(255, 255, 255, 0.15); /* Um pouco mais escuro para melhor contraste */
}

.desktop-icon i {
    display: block;
    text-align: center;
    font-size: 24px;
    margin-bottom: 8px; /* Aumenta o espaçamento entre ícone e texto */
}

.desktop-icon span {
    font-size: 12px;
    text-align: center;
    line-height: 1.2;
}

/* Barra de tarefas */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--taskbar-height);
    background-color: var(--taskbar-color);
    display: flex;
    align-items: center;
    padding: 0 5px;
    z-index: 1000;
}

.start-button {
    height: 35px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    color: white;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s;
    gap: 8px;
}

.start-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.start-button i {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.taskbar-apps {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 10px;
}

.taskbar-app {
    height: 35px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    color: white;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s;
    margin-right: 2px;
}

.taskbar-app:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.taskbar-app.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid var(--accent-color);
}

.taskbar-app i {
    font-size: 18px;
    margin-right: 5px;
}

/* Área de notificação */
.system-tray {
    margin-left: auto;
    display: flex;
    align-items: center;
    color: white;
    height: 100%;
    padding: 0 5px;
}

.tray-icon {
    padding: 5px 8px;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    height: 100%;
    display: flex;
    align-items: center;
}

.tray-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.time-date {
    padding: 0 12px;
    font-size: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1.2;
}

.time-date:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#currentTime {
    font-weight: bold;
}

#currentDate {
    font-size: 11px;
}

/* Janelas */
.window {
    position: absolute;
    background-color: #f0f0f0;
    border-radius: 5px 5px 0 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 400px;
    min-height: 300px;
    resize: both;
}

.window-header {
    height: var(--window-header-height);
    background-color: #ededed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    cursor: move;
    user-select: none;
}

.window-title {
    font-size: 13px;
    color: #444;
    display: flex;
    align-items: center;
}

.window-title img {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.window-controls {
    display: flex;
}

.window-control {
    width: 30px;
    height: var(--window-header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 16px;
}

.window-control:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.window-control.close:hover {
    background-color: #e81123;
    color: white;
}

.window-content {
    flex: 1;
    overflow: auto;
    padding: 10px;
}

.outlook-window {
    width: 600px;
    height: 500px;
    left: 100px;
    top: 50px;
}

.chrome-window {
    width: 700px;
    height: 450px;
    left: 300px;
    top: 100px;
}

.file-explorer-window {
    width: 800px;
    height: 500px;
    left: 200px;
    top: 80px;
}

.calculator-window {
    width: 320px;
    height: 480px;
    left: 500px;
    top: 100px;
    min-width: 320px;
    min-height: 480px;
}

/* Utilitários */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Barra de pesquisa */
.search-box {
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 20px;
    color: white;
    padding: 8px 15px;
    margin: 15px;
    width: calc(100% - 30px);
}

.search-box::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Área de notificação expandida */
.notification-panel {
    position: fixed;
    bottom: var(--taskbar-height);
    right: 0;
    width: 350px;
    height: 400px;
    background-color: rgba(33, 33, 33, 0.97);
    display: none;
    flex-direction: column;
    border-radius: 5px 0 0 0;
    z-index: 998;
    backdrop-filter: blur(5px);
}

.notification-header {
    padding: 15px;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    color: white;
}

/* Efeitos visuais */
.window.maximized {
    width: 100% !important;
    height: calc(100vh - var(--taskbar-height)) !important;
    top: 0 !important;
    left: 0 !important;
    border-radius: 0;
}

/* --- ESTILOS PARA CALCULADORA SIMPLES --- */
.calculator-simple {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.calc-display {
    background: #2c3e50;
    color: white;
    font-size: 2.5rem;
    padding: 20px;
    text-align: right;
    font-family: 'Courier New', monospace;
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    overflow: hidden;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #ddd;
    padding: 5px;
}

.calc-buttons button {
    border: none;
    padding: 20px 5px;
    font-size: 1.2rem;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
    font-weight: 500;
}

.calc-buttons button:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.calc-buttons button:active {
    transform: translateY(0);
}

.calc-buttons button:nth-child(4n+1) {
    background: #f8f9fa;
}

.calc-buttons .equals {
    background: #007bff !important;
    color: white;
}

.calc-buttons .equals:hover {
    background: #0056b3 !important;
}

.calc-buttons .double {
    grid-column: span 2;
}

/* --- MENU INICIAR REVISADO --- */
.start-menu {
    position: fixed;
    bottom: var(--taskbar-height);
    left: 0;
    width: 360px;
    height: 520px;
    background-color: rgba(33, 33, 33, 0.97);
    display: none;
    flex-direction: column;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    z-index: 999;
    backdrop-filter: blur(5px);
    padding: 0;
}

.start-menu-header {
    padding: 15px;
    color: white;
    background-color: rgba(25, 25, 25, 0.95);
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
}

.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #0078d7;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: white;
    font-size: 18px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-status {
    font-size: 12px;
    opacity: 0.8;
}

.start-menu-search {
    padding: 15px;
}

.start-menu-tiles {
    flex: 1;
    overflow-y: auto;
    padding: 0 15px 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.start-menu-footer {
    padding: 10px 15px;
    background-color: rgba(25, 25, 25, 0.95);
}

.power-option {
    display: flex;
    align-items: center;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
}

.power-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.power-option i {
    margin-right: 10px;
    font-size: 16px;
}

/* --- PAINEL DE WI-FI --- */

.wifi-panel {
    position: fixed;
    bottom: 55px; /* Mesma altura do painel de volume */
    right: 145px; /* Ajustado para ficar ao lado do ícone de Wi-Fi */
    width: 300px;
    background: rgba(33, 33, 33, 0.97);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    backdrop-filter: blur(5px);
    color: white;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wifi-panel.visible {
    display: block;
}

.wifi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.wifi-scan {
    cursor: pointer;
    color: #0078d7;
    font-size: 12px;
}

.wifi-scan:hover {
    text-decoration: underline;
}

.wifi-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.wifi-item {
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wifi-item:hover {
    background: rgba(255,255,255,0.1);
}

.wifi-item.disabled {
    color: #aaa;
    cursor: not-allowed;
}

.wifi-footer {
    text-align: right;
}

.btn {
    background: #0078d7;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.btn:hover {
    background: #005a9e;
}

.tile {
    height: 80px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: white; /* Cor do texto */
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.tile i {
    color: white; /* Cor do ícone */
    margin-bottom: 8px;
}

.tile:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.outlook-content {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* --- PAINEL DE CONTROLE DE ÁUDIO (ESTILO WINDOWS - HORIZONTAL) --- */
.volume-panel {
    position: fixed;
    bottom: 55px; /* 15px acima da barra de tarefas */
    right: 85px; /* Alinhado com o ícone de volume */
    min-width: 280px;
    height: 60px;
    background: rgba(33, 33, 33, 0.97);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(8px);
    color: white;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.volume-panel.visible {
    display: flex;
}

.volume-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.volume-content i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    flex: 1;
    background: #444;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0078d7;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0078d7;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    cursor: pointer;
}

.volume-content span {
    font-size: 14px;
    font-weight: 500;
    min-width: 45px;
    text-align: right;
}