body {
    background: linear-gradient(135deg, #282a36 0%, #1e2029 100%);
    color: #f8f8f2;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.terminal-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
}

.terminal {
    width: 100%;
    max-width: 900px;
    height: 85vh;
    background: rgba(40, 42, 54, 0.98);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(189, 147, 249, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.new-tab {
    width: 48%;
    max-width: 600px;
    height: 60vh;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.header {
    background: #191a21;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #bd93f9;
}

.title {
    color: #bd93f9;
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.window-controls .circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.window-controls .circle:hover {
    transform: scale(1.2);
}

.red { background: #ff5555; }
.yellow { background: #f1fa8c; }
.green { background: #50fa7b; }

.output {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #bd93f9 #191a21;
    position: relative;
}

.output p, .output ul, .output table {
    margin: 8px 0;
    animation: typeEffect 0.5s ease-in-out;
}

.output ul {
    padding-left: 20px;
}

.output li {
    margin-bottom: 6px;
}

.output table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.output th, .output td {
    border: 1px solid #6272a4;
    padding: 8px;
    text-align: left;
}

.output th {
    background: #44475a;
    color: #f8f8f2;
}

.input-line {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #191a21;
    border-top: 2px solid #bd93f9;
    position: relative;
}

.prompt {
    color: #50fa7b;
    font-weight: bold;
    margin-right: 10px;
    text-shadow: 0 0 5px #50fa7b;
}

input {
    background: transparent;
    border: none;
    outline: none;
    color: #f8f8f2;
    font-family: inherit;
    font-size: 1.1em;
    width: 100%;
    caret-color: transparent;
}

.command {
    color: #ff79c6;
    font-weight: bold;
    text-shadow: 0 0 5px #ff79c6;
}

.error {
    color: #ff5555;
    text-shadow: 0 0 5px #ff5555;
}

.boot-sequence {
    color: #6272a4;
    font-size: 0.95em;
}

.scanline {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(189, 147, 249, 0.2);
    animation: scanline 6s linear infinite;
}

.glitch {
    position: relative;
    animation: glitch 2s infinite;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    color: #f8f8f2;
    opacity: 0.8;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff5555;
    animation: glitch-top 1s infinite;
}

.glitch::after {
    left: -2px;
    text-shadow: 2px 0 #50fa7b;
    animation: glitch-bottom 1.5s infinite;
}

@keyframes typeEffect {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scanline {
    0% { top: -100%; }
    100% { top: 100%; }
}

@keyframes glitch {
    2% { transform: translate(1px, 1px) skew(2deg); }
    4% { transform: translate(-1px, -1px) skew(-2deg); }
    6% { transform: translate(0, 0) skew(0deg); }
    100% { transform: translate(0, 0) skew(0deg); }
}

@keyframes glitch-top {
    2% { clip-path: polygon(0 0, 100% 0, 100% 5%, 0 5%); }
    4% { clip-path: polygon(0 0, 100% 0, 100% 10%, 0 10%); }
    6% { clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
    100% { clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
}

@keyframes glitch-bottom {
    2% { clip-path: polygon(0 95%, 100% 95%, 100% 100%, 0 100%); }
    4% { clip-path: polygon(0 90%, 100% 90%, 100% 100%, 0 100%); }
    6% { clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); }
    100% { clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); }
}

@keyframes blink {
    50% { opacity: 0; }
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background: #50fa7b;
    box-shadow: 0 0 6px #50fa7b;
    animation: blink 0.8s step-end infinite;
    position: absolute;
}

@media (max-width: 768px) {
    .terminal {
        height: 95vh;
        max-width: 100%;
    }
    .new-tab {
        width: 100%;
        height: 70vh;
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #191a21;
}

::-webkit-scrollbar-thumb {
    background: #bd93f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff79c6;
}