/* --- 90s Desktop Theme Design Tokens --- */
:root {
    --font-sans: 'Outfit', sans-serif;
    --font-retro: 'VT323', monospace;
    --font-code: 'Courier Prime', monospace;

    /* Calibrated CSS Variables */
    --mon-width: 815px;
    --mon-right: 342px;
    --mon-bottom: -257px;
    
    --scr-top: 28.7%;
    --scr-left: 27%;
    --scr-width: 45.9%;
    --scr-height: 23.1%;
    
    /* ROBALOND Brand Colors */
    --brand-teal: #1e4d5a;
    --brand-green: #596f3b;
    --brand-tan: #b39768;
    
    /* Retro Glass Screen Tint - Bright White */
    --glass-tint: #ffffff;
}

/* --- Base Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: var(--font-sans);
    background-color: #1c1917; /* Replaced retro blue #4b6b94 with a warm dark stone color matching FONDO.jpg */
}

/* --- Desktop Environment --- */
.desktop-environment {
    height: 100vh;
    width: 100vw;
    background-image: url('FONDO.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Scanning lines over wallpaper for retro authenticity */
.wallpaper-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.08) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 3px 100%;
    z-index: 2;
    pointer-events: none;
}

/* --- Retro Top Header Bar --- */
.retro-header {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 0.6rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

.retro-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    font-family: var(--font-sans);
}

.time-widget {
    font-family: var(--font-code);
    font-weight: 700;
    font-size: 0.95rem;
    color: #cbd5e1;
    letter-spacing: 0.05em;
}

/* --- Desktop Grid System --- */
.desktop-grid {
    flex: 1;
    position: relative;
    padding: 2.5rem;
    z-index: 3;
}

/* --- Desktop Icons (Folders) --- */
.desktop-icons {
    position: absolute;
    top: 2.5rem;
    left: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 5;
}

.desktop-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 140px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.6rem 0.4rem;
    transition: all 0.2s ease;
    user-select: none;
    outline: none;
}

.desktop-icon-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(3px);
}

.desktop-icon-item:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.pixel-folder {
    transition: transform 0.2s ease;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.desktop-icon-item:hover .pixel-folder {
    transform: scale(1.06);
}

.icon-label {
    margin-top: 0.6rem;
    font-family: var(--font-sans);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    text-shadow: 2px 2px 0px #000, 
                 -1px -1px 0px #000, 
                 1px -1px 0px #000, 
                 -1px 1px 0px #000;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

/* --- Retro CRT Monitor Container --- */
.monitor-container {
    position: absolute;
    bottom: var(--mon-bottom);
    right: var(--mon-right);
    width: var(--mon-width);
    z-index: 4;
}

/* Container for user's official monitor image bezel */
.monitor-image-frame {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.monitor-bezel-img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 20px 45px rgba(0,0,0,0.6));
    pointer-events: none;
    user-select: none;
}

/* Glowing screen overlay inside the image frame screen area */
.crt-screen {
    position: absolute;
    top: var(--scr-top);
    left: var(--scr-left);
    width: var(--scr-width);
    height: var(--scr-height);
    background-color: var(--glass-tint);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        inset 0 0 12px rgba(0, 0, 0, 0.15),
        inset 0 0 5px rgba(0, 0, 0, 0.1);
    z-index: 6;
    
    /* Apply a subtle 3D skew to match the television perspective */
    transform: perspective(1000px) rotateY(-2deg) rotateX(1deg);
}

/* Subtle Vignette around screen edges to simulate tube recession without opacity issues */
.crt-screen::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 85%, rgba(0, 0, 0, 0.12) 100%);
    pointer-events: none;
    z-index: 12;
}

/* Scanline Animation overlay - Tweak to be very subtle and clean */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(255, 255, 255, 0) 50%, 
        rgba(0, 0, 0, 0.04) 50%
    );
    background-size: 100% 3.5px;
    z-index: 15;
    pointer-events: none;
    animation: flicker 0.15s infinite;
    opacity: 0.08;
}

@keyframes flicker {
    0% { opacity: 0.97; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

/* Screen reflection glare effect */
.screen-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.07) 42%, rgba(255, 255, 255, 0.16) 45%, rgba(255, 255, 255, 0.05) 48%, transparent 58%),
        radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
    z-index: 14;
    pointer-events: none;
}

/* --- Retro Simulated Web Browser --- */
.browser-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 5;
    position: relative;
    background-color: var(--glass-tint);
}

/* Navbar */
.browser-navbar {
    background: #cbd5e1;
    border-bottom: 2px solid #94a3b8;
    padding: 0.35rem 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-sans);
    flex-shrink: 0;
    z-index: 8;
}

.browser-nav-buttons {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-arrow {
    background: #f1f5f9;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    padding: 0.15rem 0.35rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.1s;
}

.nav-arrow:hover {
    background: #e2e8f0;
}

.nav-sep {
    color: #94a3b8;
    font-size: 0.8rem;
    margin: 0 0.1rem;
}

.nav-url {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 0.15rem 0.6rem;
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: #475569;
    border-radius: 4px;
    min-width: 180px;
    display: inline-block;
}

.browser-status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 6px #22c55e;
}

/* Web Content Body */
.browser-body {
    flex: 1;
    background: #ffffff;
    overflow-y: auto;
    position: relative;
    z-index: 7;
}

/* Scrollbar styling inside Retro browser */
.browser-body::-webkit-scrollbar {
    width: 8px;
}
.browser-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.browser-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 1px solid #94a3b8;
    border-radius: 4px;
}

/* Website States */
.web-state {
    display: none;
    height: 100%;
}

.web-state.active {
    display: block;
}

/* Loading Layout inside browser (Splash Screen style) */
.web-loader {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    background: #ffffff; /* Reverted to white background */
    padding: 1.5rem;
    text-align: center;
}

.loader-logo {
    max-height: 140px; /* Conserved size */
    width: 85%;        /* Conserved size */
    max-width: 300px;  /* Conserved size */
    object-fit: contain;
    margin-bottom: 1.2rem;
    /* Reverted filter, showing original brand colors */
}

.loader-sub {
    font-family: var(--font-code);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-green); /* Reverted to brand green */
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

/* Progress bar inside browser loader */
.progress-bar-container {
    width: 80%;
    max-width: 200px;
    height: 15px;
    border: 2px solid var(--brand-teal); /* Brand teal border */
    margin: 0.8rem 0;
    padding: 2px;
    background: #e2e8f0; /* Light grey background to show empty state clearly */
    border-radius: 0px; /* Sharp retro container */
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--brand-teal); /* Reverted to solid brand teal fill from the beginning */
    box-shadow: none;
    transition: none; /* Removed transition to avoid rendering lag with real-time JS width changes */
}

/* Page Container Styling */
.web-page-container {
    padding: 1.2rem;
    color: #334155;
    font-family: var(--font-sans);
}

.web-logo-header {
    display: flex;
    justify-content: center;
    margin-bottom: 0.8rem;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 0.6rem;
}

.web-brand-logo {
    max-height: 75px; /* Increased from 48px to make it larger */
    width: auto;
}

.web-main-content h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-teal);
    margin-bottom: 0.5rem;
}

.web-p {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #475569;
    margin-bottom: 1rem;
}

.web-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.web-col {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    padding: 0.6rem;
    border-radius: 8px;
}

.web-col h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-green);
    margin-bottom: 0.25rem;
}

.web-col p {
    font-size: 0.72rem;
    line-height: 1.4;
    color: #64748b;
}

/* Services solutions layout */
.solutions-showcase {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.showcase-card {
    display: flex;
    gap: 0.8rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    padding: 0.6rem;
    border-radius: 8px;
    align-items: center;
}

.card-icon {
    font-size: 1.4rem;
}

.card-text h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-teal);
}

.card-text p {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.4;
}

/* Contact layout inside browser */
.web-contact-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.web-btn-link {
    display: block;
    text-align: center;
    padding: 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: transform 0.1s;
}

.web-btn-link:hover {
    transform: translateY(-1px);
}

.btn-wa {
    background: #22c55e;
    color: #ffffff;
}

.btn-mail {
    background: var(--brand-teal);
    color: #ffffff;
}

.btn-tel {
    background: #f1f5f9;
    color: var(--brand-teal);
    border: 1.5px solid #cbd5e1;
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .desktop-grid {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        overflow-y: auto;
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }
    
    .desktop-icons {
        position: relative;
        top: 0;
        left: 0;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.8rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .desktop-icon-item {
        width: 100px;
        padding: 0.4rem 0.2rem;
    }
    
    .monitor-container {
        position: relative;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 550px;
        margin-top: 0px;
    }

    .monitor-bezel-img {
        display: none !important; /* Hide the physical monitor bezel on mobile/tablet */
    }

    .crt-screen {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: 52vh !important; /* Make browser mockup tall enough for reading content */
        transform: none !important; /* Remove 3D skew to make text flat and legible */
        border: 4px solid #94a3b8 !important; /* Add a clean windows border */
        border-radius: 8px !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.4) !important;
    }

    .sticky-note {
        display: none !important; /* Hide sticky notes to prevent layout blocking */
    }
}

@media (max-width: 480px) {
    .retro-header h1 {
        font-size: 0.8rem;
        letter-spacing: 0.05em;
    }
    
    .time-widget {
        display: none;
    }

    .desktop-icon-item {
        width: 90px;
    }

    .icon-label {
        font-size: 0.75rem;
    }

    .crt-screen {
        height: 48vh !important; /* Adjust screen height slightly on very small phones */
    }
}

/* --- Handwritten Office Sticky Notes --- */
.sticky-note {
    position: absolute;
    width: 75px;
    height: 75px;
    padding: 6px 4px;
    box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.sticky-note:hover {
    transform: scale(1.1) rotate(0deg) !important;
    box-shadow: 4px 8px 12px rgba(0, 0, 0, 0.35), 0 3px 6px rgba(0, 0, 0, 0.25);
    z-index: 20;
    cursor: pointer;
}

.note-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    text-align: center;
}

.note-text {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    margin-top: 1px;
}

.note-drawing {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-drawing svg {
    width: 82%;
    height: auto;
    max-height: 34px;
    opacity: 0.85;
}

/* Individual post-it notes configurations around monitor bezel */
.note-imagina {
    background: #bbf7d0; /* Green */
    top: 41%;
    right: 18.5%;
    transform: rotate(-6deg);
    border-bottom-right-radius: 8px 3px;
    color: #102a43;
}

.note-disena {
    background: #bfdbfe; /* Blue */
    top: 36%;
    left: 19%;
    transform: rotate(5deg);
    border-bottom-left-radius: 9px 3px;
    color: #0b2e13;
}

.note-crea {
    background: #fbcfe8; /* Pink */
    top: 28%;
    right: 19%;
    transform: rotate(6deg);
    border-bottom-right-radius: 8px 2px;
    color: #4a0e2e;
}

.note-programa {
    background: #fed7aa; /* Orange/Peach */
    bottom: 42%;
    left: 20.5%;
    transform: rotate(-4deg);
    border-bottom-right-radius: 7px 4px;
    color: #1a202c;
}

.note-construye {
    background: #fef9c3; /* Yellow */
    bottom: 42%;
    right: 19%;
    transform: rotate(8deg);
    border-bottom-left-radius: 10px 3px;
    color: #4c1d95;
}

/* Responsive adjustments for notes */
@media (max-width: 900px) {
    .sticky-note {
        width: 65px;
        height: 65px;
        padding: 4px;
    }
    .note-text {
        font-size: 0.9rem;
    }
    .note-drawing svg {
        max-height: 28px;
    }
    .note-imagina { right: 17%; left: auto; }
    .note-disena { left: 17.5%; }
    .note-crea { right: 18%; left: auto; }
    .note-programa { left: 19%; }
    .note-construye { right: 17%; }
}
