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

body {
    background: 
        radial-gradient(ellipse at center, rgba(0, 255, 255, 0.1) 0%, transparent 70%),
        linear-gradient(135deg, #0a0a0a 0%, #0d1520 50%, #0a0a0a 100%);
    color: #00ffff;
    font-family: 'JetBrains Mono', monospace;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Matrix Rain Background */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
}

.terminal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    z-index: 1;
}

/* Enhanced CRT Effects */
.terminal-window::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        to bottom,
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 3px;
    z-index: 50;
    pointer-events: none;
    border-radius: 10px;
}

.terminal-window::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 50;
    pointer-events: none;
    border-radius: 10px;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.027; }
    5% { opacity: 0.048; }
    10% { opacity: 0.021; }
    15% { opacity: 0.063; }
    20% { opacity: 0.018; }
    25% { opacity: 0.054; }
    30% { opacity: 0.022; }
    35% { opacity: 0.047; }
    40% { opacity: 0.019; }
    45% { opacity: 0.058; }
    50% { opacity: 0.024; }
    55% { opacity: 0.042; }
    60% { opacity: 0.020; }
    65% { opacity: 0.051; }
    70% { opacity: 0.023; }
    75% { opacity: 0.045; }
    80% { opacity: 0.017; }
    85% { opacity: 0.056; }
    90% { opacity: 0.025; }
    95% { opacity: 0.043; }
    100% { opacity: 0.021; }
}

/* Screen curvature effect */
.terminal-window {
    position: relative;
    width: 85%;
    max-width: 1000px;
    height: 80vh;
    background: 
        linear-gradient(135deg, rgba(5, 10, 15, 0.75) 0%, rgba(10, 20, 30, 0.70) 100%),
        url('photos/hacker.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid rgba(0, 255, 255, 0.4);
    border-radius: 10px;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.2),
        0 0 60px rgba(0, 255, 255, 0.1),
        inset 0 0 30px rgba(0, 255, 255, 0.05),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(3px);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    animation: bootup 1.5s ease-out forwards;
    transform-origin: center;
    overflow: hidden;
}

/* Matrix rain inside terminal */
.terminal-matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.15;
    pointer-events: none;
}

/* ASCII Art Styling */
.ascii-art {
    color: #00ffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    line-height: 1.2;
    margin: 10px 0;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    white-space: pre;
    overflow-x: auto;
}

/* Achievement Unlock Styling */
.achievement-unlock {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.05) 100%);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    padding: 15px 20px;
    margin: 15px 0;
    animation: achievementPulse 0.5s ease-out;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.achievement-icon {
    font-size: 2.5rem;
    animation: achievementBounce 0.6s ease-out;
}

.achievement-text {
    flex: 1;
}

.achievement-title {
    color: #ffd700;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.achievement-name {
    color: #ffa500;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 3px;
}

.achievement-desc {
    color: #aaa;
    font-size: 0.8rem;
}

@keyframes achievementPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes achievementBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes bootup {
    0% { 
        transform: scale(0.5) rotateX(20deg); 
        opacity: 0; 
        filter: blur(20px) brightness(0); 
    }
    50% { 
        transform: scale(1.1) rotateX(-5deg); 
        opacity: 0.8; 
        filter: blur(5px) brightness(1.5); 
    }
    100% { 
        transform: scale(1) rotateX(0deg); 
        opacity: 1; 
        filter: blur(0px) brightness(1); 
    }
}

/* Maximize State */
.terminal-window.maximized {
    width: 100%;
    max-width: none;
    height: 100vh;
    border-radius: 0;
    border: none;
}

/* Minimize State */
.terminal-window.minimized {
    height: 50px;
    overflow: hidden;
    transform: translateY(calc(50vh - 25px));
    border-radius: 10px;
}
.terminal-window.minimized .terminal-body,
.terminal-window.minimized .terminal-input-line {
    opacity: 0;
    pointer-events: none;
}

.terminal-header {
    background: linear-gradient(180deg, #1a2a3a 0%, #0d1520 100%);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.terminal-buttons {
    display: flex;
    gap: 10px;
    position: absolute;
    z-index: 10;
}

.terminal-buttons .btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.terminal-buttons .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn.close::before { content: '×'; color: #000; font-size: 12px; font-weight: bold; }
.btn.minimize::before { content: '−'; color: #000; font-size: 10px; font-weight: bold; }
.btn.maximize::before { content: '+'; color: #000; font-size: 12px; font-weight: bold; }

.terminal-buttons .btn:hover {
    transform: scale(1.3);
}

.terminal-buttons .btn:hover::before {
    opacity: 1;
}

.btn.close { 
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%); 
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.6);
}
.btn.minimize { 
    background: linear-gradient(135deg, #ffd93d 0%, #f0c929 100%); 
    box-shadow: 0 0 15px rgba(255, 217, 61, 0.6);
}
.btn.maximize { 
    background: linear-gradient(135deg, #6bcb77 0%, #5ab866 100%); 
    box-shadow: 0 0 15px rgba(107, 203, 119, 0.6);
}

.terminal-title {
    width: 100%;
    text-align: center;
    color: #00ffff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1px;
    position: relative;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    animation: glitchText 4s infinite;
}

@keyframes glitchText {
    0%, 100% { 
        text-shadow: 0 0 0 transparent, 0 0 10px rgba(0, 255, 255, 0.5); 
        transform: translateX(0);
    }
    1% { 
        text-shadow: 2px 0 0 rgba(255,0,255,0.8), -2px 0 0 rgba(0,255,255,0.8); 
        transform: translateX(-2px);
    }
    2% { 
        text-shadow: -2px 0 0 rgba(255,0,255,0.8), 2px 0 0 rgba(0,255,255,0.8); 
        transform: translateX(2px);
    }
    3% { 
        text-shadow: 0 0 0 transparent, 0 0 10px rgba(0, 255, 255, 0.5); 
        transform: translateX(0);
    }
    97% { 
        text-shadow: 0 0 0 transparent, 0 0 10px rgba(0, 255, 255, 0.5); 
        transform: translateX(0);
    }
    98% { 
        text-shadow: 3px 0 0 rgba(255,0,255,0.8), -3px 0 0 rgba(0,255,255,0.8); 
        transform: translateX(-1px);
    }
    99% { 
        text-shadow: -3px 0 0 rgba(255,0,255,0.8), 3px 0 0 rgba(0,255,255,0.8); 
        transform: translateX(1px);
    }
}

.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.terminal-input-line {
    display: flex;
    padding: 0 20px 20px 20px;
    align-items: center;
}

.prompt {
    color: #00ff00;
    margin-right: 10px;
    white-space: nowrap;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

#terminal-input {
    background: transparent;
    border: none;
    color: #00ffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    flex: 1;
    outline: none;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
    caret-color: #00ffff;
}

#terminal-input::placeholder {
    color: rgba(0, 255, 255, 0.3);
}

/* Custom scrollbar for terminal */
.terminal-body::-webkit-scrollbar {
    width: 10px;
}
.terminal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}
.terminal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.4) 0%, rgba(0, 255, 255, 0.2) 100%);
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}
.terminal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.6) 0%, rgba(0, 255, 255, 0.4) 100%);
}

/* Colors for terminal output */
.text-magenta { color: #ff00ff; text-shadow: 0 0 8px rgba(255, 0, 255, 0.5); }
.text-cyan { color: #00ffff; text-shadow: 0 0 8px rgba(0, 255, 255, 0.5); }
.text-green { color: #00ff00; text-shadow: 0 0 8px rgba(0, 255, 0, 0.5); }
.text-white { color: #ffffff; text-shadow: 0 0 8px rgba(255, 255, 255, 0.5); }
.text-red { color: #ff0000; text-shadow: 0 0 8px rgba(255, 0, 0, 0.5); }
.text-yellow { color: #ffff00; text-shadow: 0 0 8px rgba(255, 255, 0, 0.5); }

/* Image block for developer */
.dev-image-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.dev-image {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #00ffff;
    background: radial-gradient(circle, rgba(20, 40, 30, 1) 0%, rgba(5, 15, 10, 1) 70%, rgba(0, 0, 0, 1) 100%);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6), 0 0 60px rgba(0, 255, 255, 0.3);
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.6), 0 0 60px rgba(0, 255, 255, 0.3);
    }
    100% {
        box-shadow: 0 0 50px rgba(0, 255, 255, 0.8), 0 0 100px rgba(0, 255, 255, 0.5);
    }
}

.dev-desc {
    margin: 15px 0;
    max-width: 800px;
}

.nav-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.nav-item {
    padding: 12px;
    border: 1px solid rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    border-radius: 5px;
}

.nav-item:hover {
    background: rgba(0, 255, 255, 0.15);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4), inset 0 0 20px rgba(0, 255, 255, 0.1);
    transform: translateY(-2px);
}

.command-help {
    margin-top: 15px;
    color: #888;
    padding: 10px;
    background: rgba(0, 255, 255, 0.05);
    border-left: 3px solid #00ffff;
    border-radius: 0 5px 5px 0;
}

/* Popup Modal Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-modal {
    background: linear-gradient(135deg, #0d1520 0%, #1a2a3a 100%);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.4),
        0 0 60px rgba(0, 255, 255, 0.2),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    transform: scale(0.8) translateY(-50px);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.popup-overlay.active .popup-modal {
    transform: scale(1) translateY(0);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.popup-title {
    color: #00ffff;
    font-size: 1.3rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.popup-close {
    background: #ff5f56;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(255, 95, 86, 0.5);
}

.popup-close:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 95, 86, 0.8);
}

.popup-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 20px;
}

.popup-content p {
    margin-bottom: 10px;
}

.popup-content .highlight {
    color: #00ffff;
    font-weight: bold;
}

.popup-content .warning {
    color: #ff5f56;
    font-weight: bold;
}

.popup-content .success {
    color: #6bcb77;
    font-weight: bold;
}

.popup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.popup-btn {
    padding: 10px 20px;
    border: 1px solid #00ffff;
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.popup-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

.popup-btn.primary {
    background: rgba(0, 255, 255, 0.2);
}

.popup-btn.primary:hover {
    background: rgba(0, 255, 255, 0.3);
}

.popup-btn.danger {
    border-color: #ff5f56;
    color: #ff5f56;
    background: rgba(255, 95, 86, 0.1);
}

.popup-btn.danger:hover {
    background: rgba(255, 95, 86, 0.2);
    box-shadow: 0 0 15px rgba(255, 95, 86, 0.4);
}

/* Typing cursor animation */
.typing-cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background: #00ffff;
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* System status indicators */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    font-size: 0.8rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: #6bcb77;
    box-shadow: 0 0 10px rgba(107, 203, 119, 0.6);
}

.status-dot.offline {
    background: #ff5f56;
    box-shadow: 0 0 10px rgba(255, 95, 86, 0.6);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Scan line effect overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: 0.3;
}
