/* ==========================================================================
   ENHANCED TERMINAL AESTHETIC
   Makes the site feel like a real terminal on an old PC
   ========================================================================== */

/* --- TERMINAL WINDOW FRAME --- */
#crt-container {
    position: relative;
    border: 3px solid #333;
    border-radius: 8px;
    background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 50%, #1a1a1a 100%);
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.8),
        0 5px 30px rgba(0, 0, 0, 0.5);
}

/* Terminal bezel effect */
#crt-container::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: linear-gradient(145deg, #2a2a2a, #151515);
    border-radius: 12px;
    z-index: -1;
    box-shadow: 
        inset 2px 2px 4px rgba(255,255,255,0.05),
        inset -2px -2px 4px rgba(0,0,0,0.5);
}

/* --- CRT SCREEN CURVATURE --- */
#screen {
    border-radius: 10px;
    overflow: hidden;
}

#screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.15) 80%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 10;
    border-radius: 10px;
}

/* --- PHOSPHOR GLOW EFFECT --- */
.responsive-layout body,
.responsive-layout #app-container {
    text-shadow: 0 0 1px currentColor;
}

.responsive-layout .title,
.responsive-layout .subtitle,
.responsive-layout .nav-link,
.responsive-layout a {
    text-shadow: 
        0 0 2px currentColor,
        0 0 4px currentColor,
        0 0 8px rgba(0, 255, 255, 0.3);
}

/* --- TERMINAL TITLE BAR (ZTI-OS PROPRIETARY) --- */
.terminal-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #0a1a1a 0%, #051515 50%, #001010 100%);
    border-bottom: 1px solid #00ffff33;
    padding: 2px 8px;
    border-radius: 0;
    flex-shrink: 0;
    font-family: 'VT323', monospace;
}

.terminal-buttons {
    display: flex;
    gap: 2px;
}

.terminal-btn {
    padding: 1px 6px;
    font-size: 0.7rem;
    font-family: 'VT323', monospace;
    border: 1px solid #00ffff44;
    background: transparent;
    color: #00ffff;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terminal-btn:hover {
    background: rgba(0, 255, 255, 0.15);
    border-color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

.terminal-btn.close { color: #ff4444; border-color: #ff444444; }
.terminal-btn.close:hover { background: rgba(255, 68, 68, 0.15); border-color: #ff4444; text-shadow: 0 0 5px #ff4444; }
.terminal-btn.minimize { color: #ffff44; border-color: #ffff4444; }
.terminal-btn.minimize:hover { background: rgba(255, 255, 68, 0.15); border-color: #ffff44; text-shadow: 0 0 5px #ffff44; }
.terminal-btn.maximize { color: #44ff44; border-color: #44ff4444; }
.terminal-btn.maximize:hover { background: rgba(68, 255, 68, 0.15); border-color: #44ff44; text-shadow: 0 0 5px #44ff44; }

.terminal-title {
    font-size: 0.8rem;
    color: #00aaaa;
    font-family: 'VT323', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.terminal-title::before {
    content: '◆ ZTI-OS :: ';
    color: #00ff00;
}

.terminal-title::after {
    content: ' ◆';
    color: #00ff00;
}

/* System status indicators */
.terminal-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: #557777;
}

.terminal-status-indicator {
    width: 6px;
    height: 6px;
    background: #00ff00;
    box-shadow: 0 0 4px #00ff00;
    animation: statusPulse 2s ease infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- COMMAND PROMPT STYLING --- */
.cmd-prompt {
    color: #00ff00;
    font-weight: bold;
    margin-right: 8px;
    text-shadow: 0 0 3px #00ff00;
}

.cmd-prompt::before {
    content: 'C:\\ZTI>';
    color: #aaffee;
}

/* --- BLINKING CURSOR --- */
.cursor-blink {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: #00ff00;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
    box-shadow: 0 0 5px #00ff00;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* --- TERMINAL-STYLE NAVIGATION --- */
.site-header {
    background: linear-gradient(180deg, rgba(20, 30, 30, 0.95) 0%, rgba(10, 20, 20, 0.98) 100%);
    border-bottom: 1px solid #00ffff33;
    padding: 6px 12px;
}

.site-logo .logo-text {
    font-size: clamp(1rem, 1.2rem + 0.2vw, 1.4rem);
    letter-spacing: 2px;
}

.site-logo .logo-text::before {
    content: '[';
    color: #00ff00;
    margin-right: 3px;
}

.site-logo .logo-text::after {
    content: ']';
    color: #00ff00;
    margin-left: 3px;
}

/* Navigation links as commands */
#main-nav .nav-link {
    position: relative;
    padding: 4px 8px;
    font-size: clamp(0.85rem, 0.9rem + 0.15vw, 1rem);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

#main-nav .nav-link::before {
    content: '>';
    color: #557777;
    margin-right: 4px;
    transition: color 0.15s ease;
}

#main-nav .nav-link:hover::before,
#main-nav .nav-link.active::before {
    content: '▶';
    color: #00ff00;
}

#main-nav .nav-link:hover {
    background: rgba(0, 255, 255, 0.08);
    border: 1px solid #00ffff44;
    color: #00ffff;
}

#main-nav .nav-link.active {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff0044;
}

/* --- TERMINAL OUTPUT STYLING --- */
.subtitle {
    position: relative;
    padding-left: 20px;
}

.subtitle::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

/* Section titles as system messages */
.section-title {
    font-size: clamp(0.95rem, 1rem + 0.1vw, 1.15rem);
    border-bottom: 1px dashed #334;
    padding-bottom: 4px;
    margin-bottom: 10px;
}

.section-title::before {
    content: '[ ';
    color: #ffff00;
}

.section-title::after {
    content: ' ]';
    color: #ffff00;
}

/* --- STATUS MESSAGES AS TERMINAL OUTPUT --- */
.status {
    font-family: 'VT323', monospace;
    padding: 4px 8px;
    border-left: 3px solid #ffff00;
    background: rgba(255, 255, 0, 0.05);
    text-align: left;
    margin: 8px 0;
}

.status::before {
    content: 'STATUS: ';
    color: #ffff00;
    font-weight: bold;
}

.total-counter {
    text-align: left;
    padding-left: 10px;
}

.total-counter::before {
    content: 'RECORDS: ';
    color: #00ffff;
}

/* --- LIST ITEMS AS DATABASE ENTRIES --- */
.list-item {
    border: 1px solid #334;
    border-left: 3px solid #008888;
    background: rgba(0, 50, 50, 0.1);
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.list-item:hover {
    border-left-color: #00ffff;
    background: rgba(0, 100, 100, 0.15);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

.item-number {
    background: rgba(0, 255, 0, 0.1);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid #00ff0033;
}

.item-number::before {
    content: '#';
}

/* --- SEARCH INPUT AS COMMAND LINE --- */
.search-input {
    border: 1px solid #00888888;
    border-left: 3px solid #00ff00;
    background: rgba(0, 20, 20, 0.8);
    padding: 8px 12px 8px 35px;
    text-align: left;
    font-family: 'VT323', monospace;
    position: relative;
}

.search-input::placeholder {
    color: #557777;
}

/* Search wrapper for command prompt icon */
.search-wrapper {
    position: relative;
    width: min(600px, 95%);
    margin: 0 auto 10px auto;
}

.search-wrapper::before {
    content: '>';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #00ff00;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    z-index: 5;
    text-shadow: 0 0 5px #00ff00;
}

.search-wrapper .search-input {
    width: 100%;
    margin: 0;
}

/* --- FORM ELEMENTS AS TERMINAL INPUTS --- */
.form-group {
    position: relative;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.form-group label::before {
    content: '$ ';
    color: #00ff00;
}

.form-group input,
.form-group textarea,
.form-group select {
    border: 1px solid #005555;
    border-left: 3px solid #008888;
    background: rgba(0, 20, 20, 0.9);
    font-family: 'VT323', monospace;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

/* --- BUTTONS AS TERMINAL COMMANDS --- */
.form-button,
.action-button,
.download-button {
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.form-button::before,
.action-button::before {
    content: '> EXECUTE: ';
    font-size: 0.85em;
    opacity: 0.7;
}

.download-button::before {
    content: '↓ ';
}

/* Button hover scan effect */
.form-button::after,
.action-button::after,
.download-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
    transition: left 0.3s ease;
}

.form-button:hover::after,
.action-button:hover::after,
.download-button:hover::after {
    left: 100%;
}

/* --- FOOTER AS SYSTEM INFO --- */
.fixed-footer-disclaimer {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-top: 1px solid #334;
    background: linear-gradient(180deg, rgba(10, 15, 15, 0.9) 0%, rgba(5, 10, 10, 0.95) 100%);
    padding: 5px 10px;
}

.fixed-footer-disclaimer::before {
    content: 'SYS: ';
    color: #557777;
}

/* --- PAGE CONTENT AS TERMINAL OUTPUT --- */
.page-content {
    font-size: clamp(0.9rem, 0.95rem + 0.1vw, 1.05rem);
    line-height: 1.5;
}

.page-content p {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.page-content h3 {
    color: #00ffff;
    border-bottom: 1px dashed #335;
    padding-bottom: 4px;
    margin: 15px 0 10px 0;
    font-size: clamp(1rem, 1.1rem + 0.1vw, 1.25rem);
}

.page-content h3::before {
    content: '## ';
    color: #00ff00;
}

.page-content h4::before {
    content: '### ';
    color: #ffff00;
}

.page-content strong {
    color: #ffff00;
    text-shadow: 0 0 3px rgba(255, 255, 0, 0.3);
}

.page-content ul,
.page-content ol {
    padding-left: 25px;
}

.page-content li {
    margin-bottom: 4px;
    position: relative;
}

.page-content li::marker {
    color: #00ff00;
}

/* --- MODAL AS POPUP TERMINAL WINDOW --- */
.pfp-modal-content,
.modal-content,
.achievement-modal {
    border: 2px solid #00ffff;
    border-radius: 5px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.pfp-modal-header,
.modal-header {
    background: linear-gradient(180deg, #2a3a3a 0%, #1a2a2a 100%);
    border-bottom: 1px solid #00ffff44;
    padding: 8px 12px;
}

/* --- LOADING STATES AS BOOT SEQUENCE --- */
.status.loading::before {
    content: 'LOADING';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0% { content: 'LOADING'; }
    25% { content: 'LOADING.'; }
    50% { content: 'LOADING..'; }
    75% { content: 'LOADING...'; }
}

/* --- SCANLINE ENHANCEMENT --- */
.scanlines {
    background: 
        linear-gradient(to bottom, 
            rgba(0, 255, 255, 0.03) 50%, 
            rgba(0, 0, 0, 0.15) 50%
        );
    background-size: 100% 3px;
    animation: scanlineMove 10s linear infinite;
}

@keyframes scanlineMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

/* --- SUBTLE SCREEN FLICKER --- */
@keyframes screenFlicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.95; }
    94% { opacity: 1; }
    97% { opacity: 0.98; }
    98% { opacity: 1; }
}

#screen {
    animation: screenFlicker 8s infinite;
}

/* --- ASCII-STYLE BORDERS --- */
.settings-panel,
.generated-asset-container,
.id-card-preview {
    border: 1px solid #335;
    position: relative;
}

.settings-panel::before,
.generated-asset-container::before {
    content: '┌─────────────────────────────────────────┐';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 0.7rem;
    color: #335;
    letter-spacing: -1px;
    overflow: hidden;
    white-space: nowrap;
}

/* --- COOKIE BANNER AS SYSTEM PROMPT --- */
#cookie-consent-banner {
    border: 2px solid #ffff00;
    background: linear-gradient(180deg, rgba(30, 30, 10, 0.98) 0%, rgba(20, 20, 5, 0.98) 100%);
}

#cookie-consent-banner::before {
    content: '⚠ SYSTEM PROMPT ⚠';
    display: block;
    color: #ffff00;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    #crt-container::before {
        display: none; /* Remove bezel on mobile for space */
    }
    
    .terminal-titlebar {
        padding: 2px 6px;
    }
    
    .terminal-btn {
        font-size: 0.65rem;
        padding: 1px 4px;
    }
    
    .terminal-title {
        font-size: 0.7rem;
    }
    
    .terminal-status {
        display: none; /* Hide status on smaller screens */
    }
    
    #main-nav .nav-link::before {
        content: '▸ ';
    }
    
    .search-wrapper::before {
        left: 8px;
    }
    
    .search-input {
        padding-left: 25px;
    }
}

@media (max-width: 480px) {
    .terminal-titlebar {
        padding: 2px 4px;
    }
    
    .terminal-btn.minimize,
    .terminal-btn.maximize {
        display: none; /* Only show close button on very small screens */
    }
    
    .terminal-title::before {
        content: '◆ ';
    }
    
    .terminal-title::after {
        display: none;
    }
    
    .subtitle::before,
    .section-title::before,
    .section-title::after {
        display: none;
    }
    
    .status::before {
        content: '> ';
    }
}

/* --- PRINT STYLES --- */
@media print {
    .scanlines,
    .vignette,
    .terminal-titlebar,
    #crt-container::before {
        display: none !important;
    }
    
    #crt-container {
        border: none;
        box-shadow: none;
        background: white;
    }
    
    * {
        color: black !important;
        text-shadow: none !important;
    }
}
