/* SandaruOS Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: radial-gradient(circle at top left, rgba(0, 255, 153, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(0, 153, 255, 0.12), transparent 30%),
        #050505;
    color: white;
    min-height: 100vh;
    overflow: hidden;
}

/* Boot Screen */
.boot-screen {
    position: fixed;
    inset: 0;
    background: #050505;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    color: #00ff99;
    transition: opacity 0.5s ease;
}

.boot-console {
    width: 450px;
    text-align: left;
}

.typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #00ff99;

    /* Rigid left-aligned layout constraints */
    display: block;
    width: max-content;
    margin: 0;
    margin-bottom: 10px;
    font-size: 16px;
    text-align: left;
    animation: typing 1s steps(40, end) forwards, blink 0.7s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Desktop & Wallpaper */
.desktop {
    display: none;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Blockchain Particle Background */
#cyberParticleCanvas {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    background: transparent !important;
}

/* Foreground Robot Character */
#desktop-robot-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    z-index: 2;
    /* On top of canvas */
    pointer-events: none;
    /* Let clicks pass through */
    animation: floatAnimation 4s ease-in-out infinite;
}

@keyframes floatAnimation {
    0% {
        transform: translate(-50%, -50%) translateY(0px);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-15px);
    }

    100% {
        transform: translate(-50%, -50%) translateY(0px);
    }
}

.wallpaper-glow {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 255, 153, 0.08) 0%, transparent 60%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
}

/* Topbar / Taskbar */
.topbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55px;
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100000;
}

.start-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: 0.3s;
}

.start-btn:hover {
    background: rgba(0, 255, 153, 0.15);
    border-color: #00ff99;
}

.logo {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #00ff99;
    font-size: 18px;
}

#systemTray {
    display: flex;
    gap: 15px;
    font-size: 13px;
    opacity: 0.85;
    font-family: 'JetBrains Mono', monospace;
}

#taskbar {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.task-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.task-active {
    border-bottom: 2px solid #00ff99;
    background: rgba(0, 255, 153, 0.1);
}

.clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
}

/* Desktop Icons */
.desktop-icons {
    position: absolute;
    top: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    z-index: 10;
}

.icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon:hover {
    transform: scale(1.05);
}

.icon img {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.icon div {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Windows (Frosted Glassmorphic) */
.window {
    position: absolute;
    width: 800px;
    height: 500px;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: windowOpen 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes windowOpen {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.window-header {
    height: 45px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    cursor: grab;
    user-select: none;
    font-weight: 600;
    font-size: 15px;
    color: #00ff99;
}

.window-header:active {
    cursor: grabbing;
}

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

.control {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}

/* Invisible 32px hitbox for controls to prevent misclicks */
.control::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    z-index: 10;
}

.control:hover {
    filter: brightness(1.2);
    transform: scale(1.1);
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

/* Universal Infinite Vertical Scrolling Architecture */
body, .window-body, .window-content, .app-body, .app-iframe, iframe {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}

.window-body, .window-content, .app-body, .app-iframe, iframe {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
}

.app-iframe, iframe {
    border: none !important;
    background: transparent !important;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Universal Micro Neon Scrollbar Architecture - LOCK */
::-webkit-scrollbar {
    width: 6px !important;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 4px !important;
}
::-webkit-scrollbar-thumb {
    background: #00ff99 !important; /* Neon Green Thumb */
    border-radius: 4px !important;
    box-shadow: 0 0 10px #00ff99 !important;
}
::-webkit-scrollbar-thumb:hover {
    background: #00cc88 !important;
}

/* Terminal */
.terminal {
    flex: 1;
    background: rgba(5, 5, 5, 0.8);
    color: #00ff99;
    font-family: 'JetBrains Mono', monospace;
    padding: 20px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.5;
}

.terminal-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.terminal-input input {
    background: transparent;
    border: none;
    color: #00ff99;
    font-family: inherit;
    font-size: inherit;
    flex: 1;
    outline: none;
}

/* Internship Panel */
.internship-panel {
    position: absolute;
    right: 30px;
    top: 30px;
    width: 320px;
    background: rgba(15, 15, 15, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 153, 0.25);
    border-radius: 16px;
    padding: 25px;
    z-index: 50;
    isolation: isolate;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Maximized Window — Always on top of the profile card */
.window.maximized {
    z-index: 9999 !important;
}

.internship-header {
    color: #00ff99;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #00ff99;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 153, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 153, 0);
    }
}

.internship-panel h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

.internship-text {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 20px;
    line-height: 1.6;
}

.internship-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.internship-tags span {
    background: rgba(0, 255, 153, 0.1);
    border: 1px solid rgba(0, 255, 153, 0.2);
    color: #00ff99;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.internship-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.info-box h3 {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.info-box p {
    font-size: 14px;
    font-weight: 600;
}

.hire-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #00ff99, #00bfff);
    color: black;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    font-size: 15px;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.hire-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 255, 153, 0.3);
}

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

    .internship-panel {
        display: none;
    }

    .desktop-icons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        top: auto;
        bottom: 80px;
        left: 0;
        right: 0;
    }

    .topbar {
        padding: 0 10px;
    }

    .logo,
    #systemTray {
        display: none;
    }
}

/* General Styling inherited by iframes */
.hero-title,
h1,
h2,
h3 {
    background: linear-gradient(90deg, #00ff99, #00bfff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.profile-section {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    border: 2px solid #00ff99;
}

.profile-info h1 {
    font-size: 32px;
}

.project-card,
.skill-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

/* Window Resize Handles */
.resize-handle {
    position: absolute;
    z-index: 100;
}
.resize-handle.n { top: -5px; left: 10px; right: 10px; height: 10px; cursor: n-resize; }
.resize-handle.s { bottom: -5px; left: 10px; right: 10px; height: 10px; cursor: s-resize; }
.resize-handle.e { right: -5px; top: 10px; bottom: 10px; width: 10px; cursor: e-resize; }
.resize-handle.w { left: -5px; top: 10px; bottom: 10px; width: 10px; cursor: w-resize; }
.resize-handle.ne { top: -5px; right: -5px; width: 15px; height: 15px; cursor: ne-resize; }
.resize-handle.nw { top: -5px; left: -5px; width: 15px; height: 15px; cursor: nw-resize; }
.resize-handle.se { bottom: -5px; right: -5px; width: 15px; height: 15px; cursor: se-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; width: 15px; height: 15px; cursor: sw-resize; }