/**
 * Samir Manglam Portfolio - Terminal Animation Styles
 * Path: /assets/css/terminal.css
 */

/* =====================================================
   Terminal Container
   ===================================================== */
#terminal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    font-family: var(--font-mono);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#terminal-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#terminal-container.skip-enabled {
    cursor: pointer;
}

#terminal-container.skip-enabled::after {
    content: 'Click or press any key to skip';
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    animation: pulse 2s infinite;
}

/* =====================================================
   Terminal Header
   ===================================================== */
.terminal-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

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

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-btn.close { background: #ff5f56; }
.terminal-btn.minimize { background: #ffbd2e; }
.terminal-btn.maximize { background: #27c93f; }

.terminal-title {
    flex: 1;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* =====================================================
   Terminal Body
   ===================================================== */
.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #0a0a0a;
}

.terminal-content {
    max-width: 900px;
    margin: 0 auto;
}

/* =====================================================
   Terminal Lines
   ===================================================== */
.terminal-line {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0;
    animation: fadeInLine 0.1s ease forwards;
}

@keyframes fadeInLine {
    to { opacity: 1; }
}

.terminal-prompt {
    color: var(--accent);
    margin-right: 12px;
    white-space: nowrap;
}

.terminal-prompt::before {
    content: 'samir@portfolio';
    color: var(--primary);
}

.terminal-prompt::after {
    content: ':~$';
    color: var(--text-primary);
}

.terminal-text {
    color: var(--text-primary);
}

/* =====================================================
   Terminal Output Types
   ===================================================== */
.terminal-output {
    color: var(--text-secondary);
    padding-left: 0;
}

.terminal-output.success {
    color: var(--accent);
}

.terminal-output.error {
    color: #ff4444;
}

.terminal-output.warning {
    color: #ffaa00;
}

.terminal-output.info {
    color: var(--primary);
}

/* =====================================================
   Terminal Progress Bars
   ===================================================== */
.terminal-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
    padding-left: 20px;
}

.terminal-progress-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 150px;
}

.terminal-progress-bar {
    flex: 1;
    max-width: 300px;
    height: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
}

.terminal-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
}

.terminal-progress-percent {
    color: var(--primary);
    font-size: 0.85rem;
    min-width: 40px;
    text-align: right;
}

/* =====================================================
   Terminal ASCII Art
   ===================================================== */
.terminal-ascii {
    color: var(--primary);
    font-size: 0.7rem;
    line-height: 1.2;
    margin: 20px 0;
    white-space: pre;
    text-align: center;
}

/* =====================================================
   Terminal Typing Effect
   ===================================================== */
.typing-cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background: var(--primary);
    margin-left: 2px;
    animation: blink 0.8s infinite;
    vertical-align: text-bottom;
}

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

/* =====================================================
   Terminal Matrix Effect (optional background)
   ===================================================== */
.terminal-matrix {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.05;
    pointer-events: none;
}

.terminal-matrix canvas {
    width: 100%;
    height: 100%;
}

/* =====================================================
   Terminal Boot Sequence
   ===================================================== */
.boot-sequence .terminal-line {
    font-size: 0.85rem;
}

.boot-sequence .terminal-text {
    color: var(--text-muted);
}

.boot-logo {
    text-align: center;
    margin: 30px 0;
}

.boot-logo h1 {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.boot-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =====================================================
   Terminal Glitch Effect
   ===================================================== */
.terminal-glitch {
    position: relative;
}

.terminal-glitch::before,
.terminal-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.terminal-glitch.active::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    color: #ff00ff;
    opacity: 0.8;
}

.terminal-glitch.active::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    color: #00ffff;
    opacity: 0.8;
}

@keyframes glitch-1 {
    0% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 2px); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, -2px); }
    40% { clip-path: inset(40% 0 40% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(10% 0 70% 0); transform: translate(-2px, 2px); }
    100% { clip-path: inset(30% 0 30% 0); transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(60% 0 20% 0); transform: translate(2px, -2px); }
    20% { clip-path: inset(10% 0 60% 0); transform: translate(-2px, 2px); }
    40% { clip-path: inset(40% 0 40% 0); transform: translate(2px, -2px); }
    60% { clip-path: inset(5% 0 80% 0); transform: translate(-2px, 2px); }
    80% { clip-path: inset(70% 0 10% 0); transform: translate(2px, -2px); }
    100% { clip-path: inset(30% 0 30% 0); transform: translate(-2px, 2px); }
}

/* =====================================================
   Terminal Responsive
   ===================================================== */
@media (max-width: 768px) {
    .terminal-body {
        padding: 15px;
    }
    
    .terminal-line {
        font-size: 0.85rem;
    }
    
    .terminal-ascii {
        font-size: 0.5rem;
    }
    
    .terminal-progress {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .terminal-progress-bar {
        max-width: 100%;
        width: 100%;
    }
}

/* =====================================================
   Terminal Scrollbar
   ===================================================== */
.terminal-body::-webkit-scrollbar {
    width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
