/* --- RESET BÁSICO --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    background-color: #1a1a1a;
    transition: background-color 0.5s;
}

body.light-mode {
    background-color: #f0f0f0;
    color: #333;
}

/* --- UI ELEMENTS (Overlay) --- */
#loading-screen {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100vh;
    background-color: #000000; /* Negro puro */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Necesario para que no se vea scroll al animar */
}

.loader-text {
    font-family: 'Poppins', sans-serif; /* Tu fuente actual */
    font-size: 2.5rem; /* Tamaño legible pero no gigante */
    font-weight: 300; /* Ligero (Light) se ve más elegante que Bold */
    color: #ffffff;
    letter-spacing: 10px; /* Mucho espaciado para toque 'cine' */
    text-transform: uppercase;
    opacity: 0; /* Empieza invisible */
    transform: translateY(30px); /* Empieza un poco abajo */
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    transition: all 0.5s ease;
}
.light-mode .theme-toggle { color: #333; border-color: rgba(0,0,0,0.1); }

.instructions {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    z-index: 100;
    pointer-events: none;
}
.light-mode .instructions { color: rgba(0,0,0,0.6); }

.nav-bar {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.nav-item {
    width: 45px;
    height: 45px;
    background: rgba(0,0,0,0.5);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
}

.nav-item:hover {
    background: #00d2ff;
    transform: scale(1.1);
}

/* --- ESTILOS PARA EL CONTENIDO DENTRO DE LAS PANTALLAS 3D --- */

/* Estilo base compartido para todas las pantallas */
.screen-base {
    backface-visibility: hidden; 
    overflow: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    cursor: pointer; 
    transition: box-shadow 0.3s;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5); 
    user-select: none; 
    pointer-events: auto; 
}

.screen-base:hover {
    box-shadow: inset 0 0 20px rgba(255,255,255,0.2); 
    border: 2px solid rgba(255,255,255,0.3);
}

/* 1. MONITOR (Sobre Mí) */
.screen-monitor {
    background: linear-gradient(135deg, #000000, #000000, #000000);
    color: rgb(0, 0, 0);
    justify-content: center;
    align-items: center;
    text-align: center;
}

.screen-monitor h1 {  
    color: #000000; 
    margin-bottom: 0.2em; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
}

.screen-monitor p { 
    line-height: 1.4; 
    color: #000000; 
}
.screen-monitor .highlight { font-weight: bold; 
}


/* 2. PARED (Habilidades) - Estilo tipo "Dashboard Futurista" */
.screen-pared {
    background: rgba(0, 0, 0, 0.9); 
    color: #ff0077;
    justify-content: center;
    align-items: flex-start;
    padding: 60px;
    border: 5px solid rgba(255, 0, 149, 0.3);
}
.screen-pared h2 { font-size: 5em; margin-bottom: 40px; text-shadow: 0 0 20px rgba(197, 15, 136, 0.5); }
.skills-container { display: flex; flex-wrap: wrap; gap: 30px; }
.skill-badge {
    background: rgba(245, 2, 164, 0.1);
    border: 2px solid #ff0077;
    padding: 15px 30px;
    font-size: 2em;
    border-radius: 50px;
    color: white;
    box-shadow: 0 0 15px rgba(255, 0, 191, 0.2);
}

/* 3. IPAD (Proyectos) */
.screen-ipad {
    background: #000000;
    color: rgb(207, 13, 142);
    border-radius: 29px;
}

.screen-ipad .ipad-content {
    transform: rotate(-180deg) rotateY(-180deg) scale(0.5) ; 
    transform-origin: center center; 
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}


.screen-ipad h2 {
    font-size: 2em;
    color: rgb(207, 13, 142);
    margin-bottom: 15px;
    border-bottom: 2px solid rgb(207, 13, 142);
    padding-bottom: 10px;
    transform: rotate(-180deg) rotateY(-180deg);
    transform-origin: center center;
    text-align: center;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    height: 100%;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    height: 100%;
}

.project-card {
    background: rgba(255, 255, 255, 0.212);
    border-radius: 10px;
    padding: 65px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.project-card i { font-size: 2.5em; margin-bottom: 10px; color: rgb(207, 13, 142); }
.project-card h3 { font-size: 1em; margin-bottom: 5px; }



.screen-ipad .project-link {
    color: inherit; 
    text-decoration: none; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: transform 0.2s;
}

.screen-ipad .project-link:hover {
    transform: scale(1.05); 
}

/* 4. TV (Contacto)*/
.screen-tv {
    background-color: #000000;
    color: #ff3366;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    width: 100%;
    height: 100%;
    gap: 30px;
    pointer-events: auto;
}

/* Rotamos solo el contenido interno */
.screen-tv .tv-content {
    transform: rotate(-90deg); 
    transform-origin: center center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    pointer-events: auto;
}


.screen-tv h2 {
    font-size: 3.5em;
    font-family: 'Courier New', monospace;
    border-bottom: 4px solid #ff3366;
    padding-bottom: 10px;
    margin: 0;
    margin-bottom: 40px; 
    pointer-events: none;
}


.screen-tv .social-icon {
    display: inline-block;
    font-size: 4em;
    color: #ff3366;
    transition: color 0.3s, transform 0.3s;
    margin-bottom: 40px;
    pointer-events: auto;
}

.screen-tv .social-icon:hover {
    color: #ff99cc;
    transform: scale(1.1);
}


.screen-tv .contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 80%;
    max-width: 400px;
    margin-top: 20px;
    pointer-events: auto;
}

.screen-tv .contact-form input,
.screen-tv .contact-form textarea {
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ff3366;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 4px;
    pointer-events: auto;
}

.screen-tv .contact-form button {
    padding: 10px;
    font-size: 1em;
    background-color: #ff3366;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    pointer-events: auto;
}

.screen-tv .contact-form button:hover {
    background-color: #ff6699;
}

/* =========================================
   DISEÑO RESPONSIVO (Mobile & Tablet)
   ========================================= */

@media screen and (max-width: 768px) {

    /* --- UI ELEMENTS (Overlay) --- */
    
    .nav-bar {
        flex-direction: row; 
        left: 50%;
        top: auto;
        bottom: 20px; 
        transform: translateX(-50%);
        width: 90%;
        justify-content: space-around;
        padding: 10px;
        border-radius: 20px;
        backdrop-filter: blur(10px);
    }

    .nav-item {
        width: 40px;
        height: 40px;
        font-size: 0.9em;
    }

    
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
    }

    .instructions {
        bottom: 90px; 
        font-size: 0.8em;
        width: 100%;
        text-align: center;
    }

    /* --- CONTENIDO INTERNO DE PANTALLAS 3D --- */


    /* 1. MONITOR (Sobre Mí) */
    .screen-monitor {
        padding: 10px;
    }
    .screen-monitor h1 {
        font-size: 1.5em; 
        letter-spacing: 1px;
    }
    .screen-monitor p {
        font-size: 0.8em; 
    }

    /* 2. PARED (Habilidades) */
    .screen-pared {
        padding: 20px; 
    }
    .screen-pared h2 {
        font-size: 2.5em; 
        margin-bottom: 20px;
    }
    .skills-container {
        gap: 10px;
        justify-content: center;
    }
    .skill-badge {
        font-size: 1em; 
        padding: 8px 15px;
        border-width: 1px;
    }

    /* 3. IPAD (Proyectos) */
    .screen-ipad .project-grid {
        grid-template-columns: 1fr; 
        gap: 10px;
        overflow-y: auto; 
    }
    
    .project-card {
        padding: 15px; 
        flex-direction: row; 
        gap: 15px;
        text-align: left;
    }
    
    .project-card i {
        font-size: 1.5em;
        margin-bottom: 0;
    }
    
    .screen-ipad h2 {
        font-size: 1.2em;
        margin-bottom: 10px;
    }

    /* 4. TV (Contacto) */
    .screen-tv {
        padding: 10px;
    }
    .screen-tv h2 {
        font-size: 1.8em; /* Reducir de 3.5em */
        margin-bottom: 20px;
    }
    .screen-tv .social-icon {
        font-size: 2em; /* Reducir iconos gigantes */
        margin-bottom: 20px;
    }
    .screen-tv .contact-form {
        width: 100%;
    }
    .screen-tv .contact-form input,
    .screen-tv .contact-form textarea {
        padding: 8px;
        font-size: 0.8em;
    }
}

/* Pequeño ajuste para pantallas muy pequeñas (iPhone SE, etc) */
@media screen and (max-width: 380px) {
    .nav-item { width: 35px; height: 35px; }
    .screen-pared h2 { font-size: 1.8em; }
}