/* Base color variables */
:root {
    --primary-color: #212529;
    --secondary-color: #495057;
    --accent-color: #6c757d;
    --cursor-color: #6c757d;
    --bg-color: #212529;
    --text-color: #f8f9fa;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --error-color: #ee0000;
    --highlight-color: #f8f9fa;
    --success-color: #fcfcfc;
    --border-radius: 4px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Base styles */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    padding: 2vmin;
    margin: 0;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    z-index: 1;
}

/* Terminal Container */
.terminal-container {
    flex: 1;
    border: 1px solid var(--text-color);
    padding: 20px;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 10px rgb(255, 255, 255);
    margin-bottom: 1rem;
    min-height: 60vh;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--text-color);
}

.terminal-title {
    font-weight: bold;
}

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

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

.control-close {
    background-color: #ff5f56;
}

.control-minimize {
    background-color: #ffbd2e;
}

.control-expand {
    background-color: #606260;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-color);
    min-height: 40vh;
    max-height: 60vh;
    padding-right: 5px;
}

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

.terminal-output::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.terminal-output::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 4px;
    border: 2px solid var(--bg-color);
}

.terminal-input-line {
    display: flex;
    margin-top: 10px;
}

.terminal-prompt {
    color: var(--highlight-color);
    margin-right: 10px;
}

#terminal-input {
    background-color: transparent;
    border: none;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    width: 100%;
    outline: none;
    caret-color: var(--cursor-color);
}

/* Cyber Visualization Elements */
.cyber-visualization {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
}

.binary-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    bottom: 0;
    left: 0;
    background-size: cover;
    opacity: 0.015;
    z-index: 0;
    pointer-events: none;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgNDAwIDQwMCI+CiAgPHN0eWxlPgogICAgdGV4dCB7IGZvbnQtZmFtaWx5OiBtb25vc3BhY2U7IGZvbnQtc2l6ZTogMTBweDsgZmlsbDogIzMzMzsgfQogIDwvc3R5bGU+CiAgPGcgaWQ9ImJpbmFyeSI+CiAgICA8dGV4dCB4PSIxMCIgeT0iMTAiPjAxMTAwMTAxPC90ZXh0PgogICAgPHRleHQgeD0iNjAiIHk9IjEwIj4xMTAwMTExMDwvdGV4dD4KICAgIDx0ZXh0IHg9IjExMCIgeT0iMTAiPjAxMDAxMDExPC90ZXh0PgogICAgPHRleHQgeD0iMTYwIiB5PSIxMCI+MTEwMTAxMDA8L3RleHQ+CiAgICA8dGV4dCB4PSIyMTAiIHk9IjEwIj4wMTEwMTEwMTwvdGV4dD4KICAgIDx0ZXh0IHg9IjI2MCIgeT0iMTAiPjExMTAxMDAxPC90ZXh0PgogICAgPHRleHQgeD0iMzEwIiB5PSIxMCI+MDExMDAwMTA8L3RleHQ+CiAgICA8dGV4dCB4PSIzNjAiIHk9IjEwIj4xMDAxMDExMTwvdGV4dD4KICAgIAogICAgPHRleHQgeD0iMTAiIHk9IjMwIj4xMDExMDAxMDwvdGV4dD4KICAgIDx0ZXh0IHg9IjYwIiB5PSIzMCI+MDAxMDExMDE8L3RleHQ+CiAgICA8dGV4dCB4PSIxMTAiIHk9IjMwIj4xMTAxMDAwMTwvdGV4dD4KICAgIDx0ZXh0IHg9IjE2MCIgeT0iMzAiPjAxMDExMTAwPC90ZXh0PgogICAgPHRleHQgeD0iMjEwIiB5PSIzMCI+MDEwMDAxMTE8L3RleHQ+CiAgICA8dGV4dCB4PSIyNjAiIHk9IjMwIj4xMTAxMDExMDwvdGV4dD4KICAgIDx0ZXh0IHg9IjMxMCIgeT0iMzAiPjAxMDAxMDAwPC90ZXh0PgogICAgPHRleHQgeD0iMzYwIiB5PSIzMCI+MTExMDAxMDE8L3RleHQ+CiAgPC9nPgo8L3N2Zz4=');
}

/* Cyber Design Elements */
.cyber-accent {
    position: relative;
}

.cyber-accent::before {
    content: "";
    position: absolute;
    height: 2px;
    width: 60px;
    background-color: var(--secondary-color);
    bottom: -12px;
    left: 0;
}

.cyber-accent::after {
    content: "";
    position: absolute;
    height: 2px;
    width: 30px;
    background-color: #adb5bd;
    bottom: -12px;
    left: 70px;
}

.cyber-line {
    position: absolute;
    width: 1px;
    background-color: rgba(73, 80, 87, 0.1);
    z-index: 0;
}

.cyber-line-left {
    left: 15%;
    top: 0;
    height: 100%;
}

.cyber-line-right {
    right: 15%;
    top: 0;
    height: 100%;
}

.cyber-dots {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 180px;
    height: 180px;
    z-index: 0;
    opacity: 0.08;
}

.cyber-dots::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--secondary-color) 2px, transparent 2px);
    background-size: 18px 18px;
}

/* Section Styles */
.section-title {
    font-size: 2.25rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    z-index: 1;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--secondary-color);
    max-width: 100%;
    margin-bottom: 2.5rem;
}

/* Header Styles */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header:after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 10px;
    color: #adb5bd;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: white;
    font-weight: 500;
    position: relative;
    text-decoration: none;
}

.nav-links a:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: white;
    transition: width 0.3s;
}

.nav-links a:hover {
    color: white;
}

.nav-links a:hover:after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    cursor: pointer;
    font-size: 24px;
}

/* Terminal Text Styles */
.input-line {
    display: flex;
    margin: 5px 0;
}

.output-line {
    margin: 5px 0;
    white-space: pre-wrap;
    word-break: break-word;
    animation: fadeIn 0.3s ease-in;
}

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

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

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

.terminal-info {
    margin-top: 20px;
    font-size: 14px;
    color: #ffffff;
    text-align: center;
}

/* Animations */
.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background-color: var(--cursor-color);
    animation: blink 1s infinite;
    vertical-align: middle;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Terminal Components */
.ascii-art {
    font-family: monospace;
    white-space: pre;
    line-height: 1.2;
    margin: 10px 0;
    color: var(--highlight-color);
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    margin: 5px 0;
    font-size: 14px;
    background-color: rgba(51, 255, 0, 0.2);
    border: 1px solid var(--text-color);
}

.game-status {
    margin-top: 10px;
    margin-bottom: 15px;
}

.game-progress {
    height: 8px;
    width: 100%;
    background-color: rgba(51, 255, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--text-color);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(51, 255, 0, 0.5);
}

.status-info {
    font-size: 12px;
    text-align: right;
    margin-top: 4px;
    color: rgba(51, 255, 0, 0.7);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

button.terminal-button {
    background-color: rgba(238, 0, 0, 0.98);
    color: var(--text-color);
    border: 1px solid var(--text-color);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 6rem;
    max-width: 12rem;
}

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

button.terminal-button:active {
    transform: translateY(0);
}

button.terminal-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(51, 255, 0, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

button.terminal-button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

/* Help Panel */
.help-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--text-color);
    margin-top: 0.5rem;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

.help-panel.visible {
    max-height: 90vh;
    padding: 1rem;
}

.help-command {
    margin: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
}

.command-name {
    color: var(--highlight-color);
    margin-right: 1rem;
    display: inline-block;
    width: auto;
    min-width: 6rem;
    font-weight: bold;
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 2rem;
    flex-shrink: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-about h3, .footer-links h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-about p {
    margin-bottom: 1rem;
    opacity: 0.8;
    line-height: 1.5;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background-color 0.3s;
}

.social-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.footer-links h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: white;
}

.quick-links {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.quick-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.quick-links a:hover {
    color: var(--accent-color);
}

.quick-links a i {
    margin-right: 10px;
    font-size: 14px;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    opacity: 0.7;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .terminal-container {
        padding: 0.75rem;
    }

    .nav-links {
        display: none; /* Hide standard navigation on mobile */
    }

    .mobile-menu-btn {
        display: block; /* Show mobile menu button */
    }

    .terminal-input-line {
        flex-direction: column; /* Stack prompt and input on small screens */
    }

    .button-group {
        flex-direction: column; /* Stack buttons on small screens */
    }

    .footer-content {
        grid-template-columns: 1fr; /* Single column layout on mobile */
        gap: 2rem;
    }
}