/* ============================================
   RESET Y FUENTES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Ubuntu', 'Cantarell', 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #2e3436;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ============================================
   FONDO DE ESCRITORIO
   ============================================ */
.wallpaper {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c5e88 0%, #5a9bd5 100%);
    position: relative;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 60%),
        linear-gradient(135deg, #2c5e88 0%, #5a9bd5 100%);
}

/* ============================================
   BARRA SUPERIOR (Top Bar)
   ============================================ */
.top-bar {
    height: 26px;
    background: linear-gradient(to bottom, #3d444d 0%, #2e3436 100%);
    color: #eeeeec;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    z-index: 1000;
    position: relative;
}

.top-left, .top-right {
    display: flex;
    gap: 15px;
}

.top-left span, .top-right span {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.top-left span:hover, .top-right span:hover {
    background-color: rgba(255,255,255,0.1);
}

.top-center {
    font-weight: normal;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ============================================
   VENTANA DEL NAVEGADOR
   ============================================ */
.browser-window {
    width: 800px;
    height: 550px;
    background-color: #f0f0f0;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #5c616c;
    z-index: 100; /* Asegura que esté sobre el fondo pero bajo los iconos en móvil si es necesario */
}

.title-bar {
    height: 30px;
    background: linear-gradient(to bottom, #eaeaea 0%, #dcdcdc 100%);
    border-bottom: 1px solid #bfbfbf;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    border-radius: 6px 6px 0 0;
}

.window-icon { font-size: 16px; margin-right: 8px; }
.window-title {
    font-weight: bold;
    color: #2e3436;
    text-shadow: 0 1px 0 #ffffff;
    flex-grow: 1;
    text-align: center;
    margin-right: 40px;
}

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

.win-btn {
    width: 20px;
    height: 20px;
    border: 1px solid #a0a0a0;
    background: linear-gradient(to bottom, #f0f0f0 0%, #d0d0d0 100%);
    border-radius: 3px;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    color: #555;
    box-shadow: inset 0 1px 0 #fff;
}

.win-btn.close {
    background: linear-gradient(to bottom, #e08080 0%, #c05050 100%);
    border-color: #a04040;
    color: white;
    font-weight: bold;
}

.win-btn:active {
    background: #b0b0b0;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.menu-bar {
    background-color: #f5f5f5;
    padding: 4px 10px;
    border-bottom: 1px solid #dcdcdc;
    font-size: 12px;
}

.menu-bar span {
    margin-right: 12px;
    cursor: pointer;
    color: #2e3436;
}

.menu-bar span:hover {
    color: #204a87;
    text-decoration: underline;
}

.browser-toolbar {
    background: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
    padding: 6px 10px;
    border-bottom: 1px solid #dcdcdc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-buttons { display: flex; gap: 2px; }

.tool-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    color: #2e3436;
}

.tool-btn:hover {
    background-color: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
}

.url-bar-container {
    flex-grow: 1;
    display: flex;
    gap: 5px;
}

.url-bar {
    flex-grow: 1;
    background-color: white;
    border: 1px solid #a0a0a0;
    border-radius: 3px;
    display: flex;
    align-items: center;
    padding: 2px 5px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.lock-icon { margin-right: 5px; font-size: 12px; }

.url-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 13px;
    color: #333;
    background: transparent;
}

.go-btn {
    background: linear-gradient(to bottom, #4a90d9 0%, #357abd 100%);
    color: white;
    border: 1px solid #2a5f91;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.go-btn:hover {
    background: linear-gradient(to bottom, #5aa0e9 0%, #458acd 100%);
}

.search-box { display: flex; gap: 2px; }

.search-box select, .search-box input {
    border: 1px solid #a0a0a0;
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 12px;
}

.search-box input { width: 120px; }

.bookmarks-bar {
    background-color: #f5f5f5;
    padding: 4px 10px;
    border-bottom: 1px solid #dcdcdc;
    font-size: 12px;
    display: flex;
    gap: 15px;
}

.bookmark-folder, .bookmark-link {
    cursor: pointer;
    color: #204a87;
}

.bookmark-folder:hover, .bookmark-link:hover {
    text-decoration: underline;
}

.tabs-bar {
    background-color: #e0e0e0;
    padding: 5px 5px 0 5px;
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #bfbfbf;
}

.tab {
    background: linear-gradient(to bottom, #f5f5f5 0%, #e0e0e0 100%);
    border: 1px solid #bfbfbf;
    border-bottom: none;
    padding: 6px 12px;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
    position: relative;
    top: 1px;
}

.tab.active {
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 100%);
    border-color: #a0a0a0;
    font-weight: bold;
    z-index: 10;
}

.tab-close {
    margin-left: 5px;
    font-size: 14px;
    color: #888;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    text-align: center;
    line-height: 12px;
}

.tab-close:hover {
    background-color: #ffaaaa;
    color: white;
}

.tab-new {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #555;
    cursor: pointer;
    padding: 0 8px;
    line-height: 20px;
}

.tab-new:hover { color: #204a87; }

.web-content {
    flex-grow: 1;
    background-color: white;
    border: 1px solid #dcdcdc;
    margin: 0 5px 5px 5px;
    overflow-y: auto;
    position: relative;
}

.fake-webpage {
    padding: 20px;
    font-family: 'Times New Roman', serif;
    color: #000;
}

.status-bar {
    height: 22px;
    background-color: #f0f0f0;
    border-top: 1px solid #dcdcdc;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 11px;
    color: #555;
}

#status-text { animation: blink 2s infinite; }

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

/* ============================================
   ICONOS DE ESCRITORIO (Lógica Corregida)
   ============================================ */
/* Contenedor para los iconos en modo escritorio */
.desktop-icons-wrapper {
    position: absolute;
    top: 40px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 200; /* Por encima de la ventana */
}

.desktop-icon {
    width: 80px;
    text-align: center;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    cursor: pointer;
    /* No usamos position: absolute aquí, usamos flexbox del wrapper */
}

.icon-img {
    font-size: 48px;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.desktop-icon span {
    background-color: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

.desktop-icon:hover span {
    background-color: rgba(0,0,0,0.5);
}

/* ============================================
   RESPONSIVE - MÓVIL (Solución al solapamiento)
   ============================================ */
@media (max-width: 850px) {
    /* La ventana se ajusta */
    .browser-window {
        width: 95%;
        height: 60vh;
        top: 40px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* CAMBIO CRÍTICO: El wrapper de iconos cambia de posición absoluta a relativa/flex */
    .desktop-icons-wrapper {
        position: fixed; /* Se queda pegado abajo */
        top: auto;
        bottom: 10px;
        left: 0;
        right: 0;
        flex-direction: row; /* Iconos en fila horizontal */
        justify-content: center;
        gap: 15px;
        padding: 0 10px;
        background: rgba(0,0,0,0.2); /* Fondo sutil para que se vean */
        border-radius: 10px 10px 0 0;
    }

    .desktop-icon {
        width: auto; /* Se ajustan al contenido */
        margin: 0;
    }
    
    .icon-img {
        font-size: 36px; /* Más pequeños en móvil */
    }
    
    .desktop-icon span {
        font-size: 11px;
        padding: 1px 4px;
    }
}