/* ============================================================
   PRELOADER - Professional
   ============================================================ */

/* ===== Overlay ===== */
#preloader {
    position: fixed;
    inset: 0;
    background: #0d1117;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#preloader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ===== Loader Container ===== */
.loader {
    text-align: center;
    width: 360px;
    max-width: 92%;
}

/* ===== VS Code Terminal Style ===== */
.loader-terminal {
    background: #1e1e1e;
    border: 1px solid #2d2d2d;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    font-family: 'Consolas', 'Cascadia Code', 'Fira Code', monospace;
}

/* ===== Terminal Header ===== */
.terminal-header {
    height: 34px;
    background: #252526;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid #2d2d2d;
    gap: 6px;
}

.terminal-header .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.terminal-header .dot:hover {
    transform: scale(1.15);
}

.terminal-header .red { background: #ff5f56; }
.terminal-header .yellow { background: #ffbd2e; }
.terminal-header .green { background: #27c93f; }

.terminal-title {
    color: #858585;
    font-size: 11px;
    margin-left: auto;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0.5px;
    user-select: none;
}

.terminal-title .icon {
    margin-right: 4px;
}

/* ===== Terminal Body ===== */
.terminal-body {
    padding: 22px 24px;
    min-height: 90px;
    display: flex;
    align-items: center;
    background: #1e1e1e;
}

.terminal-text {
    color: #d4d4d4;
    font-size: 14px;
    font-family: 'Consolas', 'Cascadia Code', monospace;
    line-height: 1.6;
}

.terminal-text .highlight {
    color: #c586c0;
}

.terminal-text .highlight-blue {
    color: #569cd6;
}

.terminal-text .highlight-green {
    color: #6a9955;
}

/* ===== Terminal Cursor ===== */
.terminal-cursor {
    display: inline-block;
    width: 2px;
    height: 17px;
    background: #ffffff;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== Loading Dots ===== */
.loader-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.loader-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #007acc;
    animation: bounce 1.4s ease-in-out infinite;
}

.loader-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== Progress Bar ===== */
.loader-progress {
    width: 100%;
    height: 3px;
    background: #2d2d30;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 18px;
}

.loader-progress .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #007acc, #569cd6, #c586c0);
    border-radius: 10px;
    transition: width 0.15s ease;
}

.loader-percent {
    color: #6e7681;
    font-size: 12px;
    font-family: 'Consolas', monospace;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* ===== Logo Animation ===== */
.loader-logo {
    font-size: 44px;
    margin-bottom: 20px;
    animation: float 2.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .loader-terminal {
        border-radius: 8px;
    }

    .terminal-header {
        height: 30px;
        padding: 0 10px;
    }

    .terminal-header .dot {
        width: 9px;
        height: 9px;
    }

    .terminal-title {
        font-size: 10px;
    }

    .terminal-body {
        padding: 16px 18px;
        min-height: 70px;
    }

    .terminal-text {
        font-size: 12px;
    }

    .terminal-cursor {
        height: 14px;
    }

    .loader {
        width: 95%;
    }

    .loader-logo {
        font-size: 36px;
    }
}

@media (max-width: 400px) {
    .terminal-body {
        padding: 12px 14px;
        min-height: 60px;
    }

    .terminal-text {
        font-size: 11px;
    }

    .terminal-cursor {
        height: 12px;
    }

    .terminal-header {
        height: 26px;
        padding: 0 8px;
    }

    .terminal-header .dot {
        width: 7px;
        height: 7px;
    }

    .terminal-title {
        font-size: 9px;
    }
}