/* Base Styles */
:root {
    --primary-color: #0f0;
    --secondary-color: #00b3e6;
    --background-color: #0a0a0a;
    --terminal-bg: rgba(16, 16, 16, 0.9);
    --terminal-border: #333;
    --text-color: #ddd;
    --font-mono: 'Share Tech Mono', monospace;
    --font-terminal: 'VT323', monospace;
}

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

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* CRT Effects */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/noise.png');
    opacity: 0.03;
    pointer-events: none;
    z-index: 100;
    animation: noise 0.2s infinite;
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.75;
    pointer-events: none;
    z-index: 101;
    animation: scanline 6s linear infinite;
}

@keyframes noise {
    0%, 100% { background-position: 0 0; }
    10% { background-position: -5% -10%; }
    20% { background-position: -15% 5%; }
    30% { background-position: 7% -25%; }
    40% { background-position: 20% 25%; }
    50% { background-position: -25% 10%; }
    60% { background-position: 15% 5%; }
    70% { background-position: 0% 15%; }
    80% { background-position: 25% 35%; }
    90% { background-position: -10% 10%; }
}

@keyframes scanline {
    0% { top: 0%; }
    100% { top: 100%; }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 179, 230, 0.3);
    margin-bottom: 30px;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
    letter-spacing: 2px;
}

.terminal-info {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-color);
}

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

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

/* Terminal */
.terminal {
    width: 100%;
    max-width: 800px;
    background-color: var(--terminal-bg);
    border: 1px solid var(--terminal-border);
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 179, 230, 0.2);
    overflow: hidden;
    transition: all 0.6s ease;
}

.terminal-collapse {
    transform: scale(0.95, 0.1);
    opacity: 0;
    height: 0;
    margin-bottom: -20px;
}

.terminal-header {
    background-color: #1a1a1a;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--terminal-border);
}

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

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.minimize {
    background-color: #ffbd2e;
}

.maximize {
    background-color: #28c940;
}

.close {
    background-color: #ff5f56;
}

.terminal-body {
    padding: 15px;
    height: 350px;
    overflow-y: auto;
    font-family: var(--font-terminal);
    font-size: 1.2rem;
}

.terminal-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.line {
    display: flex;
    gap: 8px;
}

.prompt {
    color: var(--primary-color);
}

.command {
    color: var(--text-color);
}

.response {
    color: #888;
    padding-left: 15px;
    margin-bottom: 5px;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background-color: var(--primary-color);
    margin-left: 2px;
    vertical-align: middle;
}

/* Restart Terminal Button */
.restart-terminal {
    margin: 20px 0;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.restart-terminal button {
    background-color: var(--terminal-bg);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    padding: 12px 25px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-terminal button:hover {
    background-color: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Portal Container */
.portal-container {
    width: 100%;
    max-width: 900px;
    background-color: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--secondary-color);
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 0 30px rgba(0, 179, 230, 0.3);
    transition: all 0.5s ease;
}

.portal-container.hidden {
    opacity: 0;
    transform: translateY(20px);
    display: none;
}

.portal-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 179, 230, 0.3);
}

.portal-header h2 {
    color: var(--secondary-color);
    letter-spacing: 2px;
    font-size: 1.8rem;
}

.portals {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    flex-wrap: wrap;
}

.portal {
    flex: 1;
    min-width: 300px;
    background-color: rgba(30, 30, 30, 0.7);
    border: 1px solid var(--terminal-border);
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.portal:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 179, 230, 0.2);
    border-color: var(--secondary-color);
}

.portal-inner {
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    height: 100%;
}

.portal h3 {
    color: var(--secondary-color);
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.portal-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
}

.portal-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--secondary-color);
}

.portal p {
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.portal-button {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    padding: 10px 25px;
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    margin-top: auto;
}

.portal-button:hover {
    background-color: rgba(0, 179, 230, 0.1);
    box-shadow: 0 0 10px rgba(0, 179, 230, 0.5);
}

/* Access Code Container */
.access-code-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
    transition: all 0.3s ease;
}

.access-code-container.hidden {
    display: none;
    opacity: 0;
    height: 0;
}

#access-code {
    background-color: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--terminal-border);
    color: var(--primary-color);
    padding: 10px;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 5px;
}

#access-code.error {
    border-color: #ff3333;
    animation: shake 0.5s;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

#submit-code {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.3s ease;
}

#submit-code:hover {
    background-color: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* Footer */
footer {
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid rgba(0, 179, 230, 0.3);
}

.footer-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
}

/* Animations */
.blink {
    animation: blink 1s infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .terminal-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .portals {
        flex-direction: column;
    }
    
    .portal {
        width: 100%;
    }
    
    .footer-text {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}
