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

/* Accessibility: Hide elements visually but keep them available for screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'JetBrains Mono', monospace;
    background: #212121;
    color: #f8f8f2;
    overflow: hidden;
}

.terminal-container {
    width: 100vw;
    height: 100vh;
    background: #212121;
    display: flex;
    flex-direction: column;
    cursor: text;
}

.terminal-header {
    background: #1a1a1a;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #2a2a2a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.terminal-button {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: inline-block;
}

.btn-close { 
    background: #ff5555; 
}

.btn-minimize { 
    background: #ffcb6b; 
}

.btn-maximize { 
    background: #50fa7b; 
}

.terminal-title {
    margin-left: 12px;
    font-size: 13px;
    color: #8be9fd;
    font-weight: 500;
}

.terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    background: #212121;
}

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

.terminal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

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

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

.command-line {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-out;
}

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

.command-prompt {
    color: #50fa7b;
    margin-right: 8px;
    user-select: none;
}

.command-input-display {
    color: #f8f8f2;
    display: inline;
}

.command-output {
    margin-top: 8px;
    color: #f8f8f2;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.input-line {
    display: flex;
    align-items: center;
}

.input-line form {
    display: flex;
    width: 100%;
}

.terminal-input {
    background: transparent;
    border: none;
    color: #f8f8f2;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    outline: none;
    flex: 1;
    caret-color: #f8f8f2;
}

.cursor-blink {
    animation: blink 1s step-end infinite;
}

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

/* Dracula+ Color Classes */
.cmd-green { 
    color: #50fa7b; 
}

.cmd-cyan { 
    color: #8be9fd; 
}

.cmd-yellow { 
    color: #ffcb6b; 
}

.cmd-pink { 
    color: #ff5555; 
}

.cmd-purple { 
    color: #c792ea; 
}

.cmd-orange {
    color: #ffb86c;
}

.cmd-link {
    color: #8be9fd;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cmd-link:hover {
    color: #50fa7b;
    text-decoration: underline;
}

.clickable-command {
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: underline dotted transparent;
}

.clickable-command:hover {
    text-decoration: underline dotted currentColor;
    opacity: 0.8;
    transform: translateX(2px);
}

.welcome-ascii {
    color: #c792ea;
    font-size: 12px;
    line-height: 1.2;
    margin: 20px 0;
}

/* Terminal grid layout */
.terminal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch;
    height: 100%;
}

.terminal-left {
    grid-column: 1;
    min-width: 0;
}

.terminal-right {
    grid-column: 2;
    position: sticky;
    top: 0;
    min-width: 0;
}

.commands-help {
    white-space: pre-wrap;
    color: #f8f8f2;
    position: sticky;
    top: 0;
    background: #212121;
    padding: 10px 0;
    z-index: 10;
}

/* Responsive: stack on smaller screens */
@media (max-width: 768px) {
    .terminal-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .terminal-left,
    .terminal-right {
        grid-column: 1;
    }

    .terminal-right {
        position: static;
    }
}

/* Autocomplete suggestions */
.autocomplete-suggestions {
    margin-top: 8px;
    margin-left: 20px;
    color: #6272a4;
    font-size: 13px;
    font-style: italic;
    display: none;
}

.autocomplete-suggestions.visible {
    display: block;
}

.autocomplete-suggestions span {
    color: #8be9fd;
    margin-right: 10px;
}

/* Firework effect */
.firework-particle {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    z-index: 9999;
    animation: firework 2s ease-out forwards;
}

@keyframes firework {
    0% {
        transform: translate(0, 0) scale(0.5) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(
            calc(var(--end-x) - 50vw), 
            calc(var(--end-y) - 50vh)
        ) scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(var(--end-x) - 50vw), 
            calc(var(--end-y) - 50vh)
        ) scale(0.3) rotate(360deg);
        opacity: 0;
    }
}
