/* ==========================================
   VARIABLES & RESET
   ========================================== */

:root {
    --purple: #60519b;
    --light: #bfc0d1;
    --bg: #0a0a0f;
    --terminal-color: #8b7dc3;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Courier New', monospace;
    background: var(--bg);
    color: var(--terminal-color);
    position: relative;
}

/* Particules violettes */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: 0.3;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--purple);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 15s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 25%; animation-delay: 2s; animation-duration: 15s; }
.particle:nth-child(3) { left: 40%; animation-delay: 4s; animation-duration: 18s; }
.particle:nth-child(4) { left: 55%; animation-delay: 1s; animation-duration: 14s; }
.particle:nth-child(5) { left: 70%; animation-delay: 3s; animation-duration: 16s; }
.particle:nth-child(6) { left: 85%; animation-delay: 5s; animation-duration: 13s; }
.particle:nth-child(7) { left: 15%; animation-delay: 6s; animation-duration: 17s; }
.particle:nth-child(8) { left: 90%; animation-delay: 2.5s; animation-duration: 19s; }

@keyframes particleFloat {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* Scanline effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(96, 81, 155, 0.02) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
    animation: scanline 10s linear infinite;
}

@keyframes scanline {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

/* ==========================================
   LAYOUT
   ========================================== */

.container {
    height: 100vh;
    display: flex;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: 80px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(96, 81, 155, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
    gap: 40px;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, var(--purple) 30%, var(--purple) 70%, transparent 100%);
    opacity: 0.4;
    animation: slideGlow 3s ease-in-out infinite;
}

@keyframes slideGlow {
    0%, 100% { opacity: 0.2; transform: translateY(0); }
    50% { opacity: 0.6; transform: translateY(20px); }
}

.back-link {
    font-size: 1.5rem;
    color: var(--purple);
    text-decoration: none;
    transition: all 0.3s;
    opacity: 0.7;
}

.back-link:hover {
    opacity: 1;
    transform: translateX(-5px);
    text-shadow: 0 0 10px var(--purple);
}

.divider {
    width: 30px;
    height: 1px;
    background: rgba(96, 81, 155, 0.3);
}

.year {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--purple);
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-transform: uppercase;
}

/* Main */
.main {
    flex: 1;
    padding: 40px 60px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   TERMINAL
   ========================================== */

.terminal {
    flex: 1;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(96, 81, 155, 0.4);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(96, 81, 155, 0.2);
    display: flex;
    flex-direction: column;
    animation: terminalBoot 0.5s ease-out;
}

@keyframes terminalBoot {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.terminal-header {
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(96, 81, 155, 0.3);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(96, 81, 155, 0.3);
}

.btn-close { background: rgba(255, 0, 0, 0.3); }
.btn-minimize { background: rgba(255, 255, 0, 0.3); }
.btn-maximize { background: rgba(96, 81, 155, 0.5); }

.terminal-title {
    font-size: 0.9rem;
    color: var(--terminal-color);
    opacity: 0.7;
}

.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
}

.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(96, 81, 155, 0.4);
    border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 81, 155, 0.6);
}

.ascii-art {
    color: var(--purple);
    font-size: 0.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    opacity: 0.8;
    text-shadow: 0 0 5px rgba(96, 81, 155, 0.5);
}

.welcome-text {
    margin-bottom: 30px;
}

.welcome-text p {
    margin-bottom: 5px;
}

#output {
    margin-bottom: 10px;
}

.output-line {
    margin-bottom: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.input-line {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: cursorBlink 1s infinite;
}

.prompt {
    color: var(--purple);
    font-weight: bold;
    flex-shrink: 0;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--terminal-color);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    caret-color: var(--purple);
}

#terminal-input::selection {
    background: rgba(96, 81, 155, 0.3);
}

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

/* Command output styles */
.command-output {
    color: var(--terminal-color);
}

.error-output {
    color: #ff5555;
}

.success-output {
    color: #a78bfa;
}

.info-output {
    color: #bfc0d1;
}

/* ==========================================
   MODAL
   ========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(96, 81, 155, 0.4);
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    animation: modalZoom 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes modalZoom {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(96, 81, 155, 0.4);
    border-radius: 10px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--purple);
    font-size: 2.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.6;
    line-height: 1;
}

.modal-close:hover {
    opacity: 1;
    transform: rotate(90deg);
    text-shadow: 0 0 10px var(--purple);
}

/* ==========================================
   DOWNLOAD CENTER FULL PAGE
   ========================================== */

.download-center {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.download-card {
    background: rgba(36, 36, 48, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(96, 81, 155, 0.3);
    border-radius: 16px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
}

.download-card:hover {
    transform: translateY(-8px);
    border-color: var(--purple);
    box-shadow: 0 20px 50px rgba(96, 81, 155, 0.4);
}

.download-icon {
    width: 60px;
    height: 60px;
    background: rgba(96, 81, 155, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.download-card:hover .download-icon {
    background: var(--purple);
    transform: scale(1.1);
}

.download-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 10px;
}

.download-card p {
    font-size: 0.95rem;
    color: var(--light);
    opacity: 0.7;
    line-height: 1.6;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.download-btn {
    padding: 10px 20px;
    background: rgba(96, 81, 155, 0.2);
    border: 1px solid var(--purple);
    border-radius: 8px;
    color: var(--purple);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.download-btn:hover {
    background: var(--purple);
    color: var(--light);
    transform: translateY(-2px);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .main {
        padding: 20px;
    }
    
    .sidebar {
        width: 60px;
        padding: 30px 0;
    }
    
    .terminal-body {
        padding: 15px;
        font-size: 0.85rem;
    }
    
    .ascii-art {
        font-size: 0.35rem;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .download-center {
        grid-template-columns: 1fr;
    }
}
