/* Multi-Terminal System Styles */

/* Terminal Title */
.terminal-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Terminal Icons - ensure they don't take all space */
.terminal-instance .terminal-icons {
    display: flex;
    gap: 5px;
}

.terminal-instance .terminal-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Terminal Instance Styling */
.terminal-instance {
    position: absolute;
    background: rgba(0, 0, 0, 0.75); /* Transparent dark glass effect */
    backdrop-filter: blur(10px); /* Blur the background for glass effect */
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2), inset 0 0 20px rgba(0, 255, 255, 0.05);
    overflow: hidden;
    display: none;
}

.terminal-instance.active {
    display: block;
}

/* Active Terminal Highlight */
.terminal-instance.terminal-active {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
}

.terminal-instance:not(.terminal-active) {
    opacity: 0.9;
}

/* Terminal Content Adjustments */
.terminal-instance .terminal-content {
    height: calc(100% - 40px);
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3); /* More transparent for glass effect */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.terminal-instance .terminal-header {
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent header */
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between; /* This ensures icons on left, controls on right */
    align-items: center;
    cursor: move;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Window Controls Container */
.terminal-instance .window-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Window Control Buttons Base Style */
.window-btn,
.window-control {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    width: 24px;
    height: 24px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    padding: 0;
    font-family: monospace;
    line-height: 1;
}

.window-btn:hover,
.window-control:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
}

/* Subtle hover effects for each button */
.window-btn.window-close:hover,
.window-control.window-close:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: rgba(255, 100, 100, 0.5);
}

.window-btn.window-new-terminal,
.window-control.window-new-terminal {
    font-size: 18px;
    font-weight: normal;
}

/* Terminal Output Styling */
.terminal-output {
    margin: 5px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.terminal-output-command {
    color: var(--neon-green);
}

.terminal-output-error {
    color: var(--neon-pink);
}

.terminal-output-response {
    color: #ffffff;
}

/* Terminal Input Line */
.terminal-instance .terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
    padding: 5px 0;
}

.terminal-instance .terminal-prompt {
    color: var(--neon-cyan);
    margin-right: 8px;
    font-weight: bold;
}

.terminal-instance .terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    outline: none;
}

/* Terminal Scrollbar */
.terminal-instance .terminal-content::-webkit-scrollbar {
    width: 8px;
}

.terminal-instance .terminal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.terminal-instance .terminal-content::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 4px;
}

.terminal-instance .terminal-content::-webkit-scrollbar-thumb:hover {
    background: var(--neon-pink);
}

/* Z-index management for multiple terminals */
.terminal-instance {
    z-index: 100;
}

.terminal-instance.window-active {
    z-index: 200;
}

/* Old terminal toggle removed - using floating button only */

/* Floating New Terminal Button */
.floating-new-terminal-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    background: rgba(0, 255, 255, 0.15);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 12px 24px;
    border-radius: 30px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4), inset 0 0 20px rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.floating-new-terminal-btn:hover {
    background: rgba(0, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

/* Animation for new terminal creation */
@keyframes terminalSpawn {
    0% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.terminal-instance {
    animation: terminalSpawn 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .terminal-instance {
        min-width: 320px;
        min-height: 250px;
    }
    
    .window-btn.window-new-terminal,
.window-control.window-new-terminal {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
}