/* =====================================================
   CRIMINAL CODE - SCI-FI LOGIN LOADING SCREEN
   Tampilan loading seperti film intelijen/sci-fi
   ===================================================== */

/* ===== LOADING OVERLAY ===== */
.login-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #0d1117 50%, #0a0a0a 100%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== SCAN LINES EFFECT ===== */
.login-loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 255, 0, 0.03) 0px,
            rgba(0, 255, 0, 0.03) 1px,
            transparent 1px,
            transparent 4px);
    pointer-events: none;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 4px;
    }
}

/* ===== MAIN CONTAINER ===== */
.loading-container {
    width: 90%;
    max-width: 600px;
    text-align: center;
    position: relative;
}

/* ===== LOGO AREA ===== */
.loading-logo {
    margin-bottom: 40px;
    position: relative;
}

.loading-logo img {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 20px rgba(0, 255, 0, 0.5));
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 20px rgba(0, 255, 0, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 40px rgba(0, 255, 0, 0.8));
    }
}

.loading-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: #00ff00;
    text-transform: uppercase;
    letter-spacing: 8px;
    margin-top: 20px;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

/* ===== USER INFO BOX ===== */
.loading-user-box {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.loading-user-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.1), transparent);
    animation: scan-sweep 2s linear infinite;
}

@keyframes scan-sweep {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 20, 0, 0.6);
    border: 2px solid #00ff00;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
    animation: avatar-pulse 1.5s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes avatar-pulse {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(0, 255, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 50px rgba(0, 255, 0, 0.7);
    }
}

/* Avatar Icon Image */
.avatar-icon {
    width: 60%;
    height: 60%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.8));
    animation: icon-float 3s ease-in-out infinite;
}

@keyframes icon-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.user-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 5px;
}

.user-role {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #00ff00;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* ===== STATUS MESSAGES ===== */
.loading-status {
    margin-bottom: 30px;
}

.status-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.status-line.active {
    color: #00ff00;
    opacity: 1;
    transform: translateY(0);
}

.status-line.completed {
    color: #00cc00;
    opacity: 0.7;
}

.status-line .status-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-line .status-icon::before {
    content: '○';
    color: #333;
}

.status-line.active .status-icon::before {
    content: '◉';
    color: #00ff00;
    animation: blink 0.5s ease-in-out infinite;
}

.status-line.completed .status-icon::before {
    content: '✓';
    color: #00cc00;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ===== PROGRESS BAR ===== */
.loading-progress {
    position: relative;
    height: 4px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff00, #00cc00, #00ff00);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
    animation: progress-glow 1s linear infinite;
}

@keyframes progress-glow {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 200% 0%;
    }
}

.loading-percentage {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #00ff00;
    margin-top: 10px;
}

/* ===== TERMINAL OUTPUT ===== */
.loading-terminal {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 4px;
    padding: 15px;
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #00ff00;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.terminal-line {
    margin-bottom: 4px;
    opacity: 0;
    animation: fadeInLine 0.2s ease forwards;
}

.terminal-line .prefix {
    color: #00cc00;
}

.terminal-line .timestamp {
    color: #666;
    margin-right: 10px;
}

.terminal-line .message {
    color: #00ff00;
}

.terminal-line .success {
    color: #00ff00;
}

.terminal-line .warning {
    color: #ffcc00;
}

@keyframes fadeInLine {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== ACCESS GRANTED ===== */
.access-granted {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
}

.access-granted.show {
    opacity: 1;
    transform: scale(1);
}

.access-granted-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: #00ff00;
    text-transform: uppercase;
    letter-spacing: 10px;
    text-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
    animation: access-flash 0.5s ease-in-out 3;
}

@keyframes access-flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.access-sublabel {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #00cc00;
    margin-top: 10px;
    letter-spacing: 2px;
}

/* ===== CORNER DECORATIONS ===== */
.corner-decor {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: rgba(0, 255, 0, 0.3);
    border-style: solid;
}

.corner-decor.top-left {
    top: 20px;
    left: 20px;
    border-width: 2px 0 0 2px;
}

.corner-decor.top-right {
    top: 20px;
    right: 20px;
    border-width: 2px 2px 0 0;
}

.corner-decor.bottom-left {
    bottom: 20px;
    left: 20px;
    border-width: 0 0 2px 2px;
}

.corner-decor.bottom-right {
    bottom: 20px;
    right: 20px;
    border-width: 0 2px 2px 0;
}

/* ===== GLITCH EFFECT ===== */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    color: #ff0000;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    color: #0000ff;
    z-index: -1;
}

@keyframes glitch-1 {
    0% {
        clip-path: inset(20% 0 60% 0);
        transform: translate(-3px, 0);
    }

    20% {
        clip-path: inset(70% 0 10% 0);
        transform: translate(3px, 0);
    }

    40% {
        clip-path: inset(10% 0 80% 0);
        transform: translate(-3px, 0);
    }

    60% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(3px, 0);
    }

    80% {
        clip-path: inset(30% 0 50% 0);
        transform: translate(-3px, 0);
    }

    100% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(3px, 0);
    }
}

@keyframes glitch-2 {
    0% {
        clip-path: inset(60% 0 20% 0);
        transform: translate(3px, 0);
    }

    20% {
        clip-path: inset(10% 0 70% 0);
        transform: translate(-3px, 0);
    }

    40% {
        clip-path: inset(80% 0 10% 0);
        transform: translate(3px, 0);
    }

    60% {
        clip-path: inset(30% 0 50% 0);
        transform: translate(-3px, 0);
    }

    80% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(3px, 0);
    }

    100% {
        clip-path: inset(5% 0 80% 0);
        transform: translate(-3px, 0);
    }
}

/* ===== HEX GRID BACKGROUND ===== */
.hex-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%2300ff00' fill-opacity='0.03'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .loading-title {
        font-size: 1.2rem;
        letter-spacing: 4px;
    }

    .access-granted-text {
        font-size: 1.5rem;
        letter-spacing: 5px;
    }

    .loading-terminal {
        font-size: 0.6rem;
        max-height: 80px;
    }

    .user-name {
        font-size: 1rem;
    }
}