/* Terminal Page - Glass Design System Integration */

/* Header with integrated home button */
.container header {
    position: relative;
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

.back-link {
    position: absolute;
    left: 0;
    top: 2rem;
    color: #ff6b6b;
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.back-link:hover {
    opacity: 0.8;
}

/* Header Navigation */
.terminal-header-nav {
    margin-bottom: 2rem;
    display: flex;
    justify-content: flex-start;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Main Terminal Layout */
.terminal-main {
    display: flex;
    gap: 2rem;
}

/* Terminal Window with Glass Effect */
.terminal-window {
    flex: 2;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.terminal-window:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Terminal Title Bar */
.terminal-titlebar {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-buttons {
    display: flex;
    gap: 0.5rem;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.terminal-button.close {
    background: #ff5f56;
}

.terminal-button.minimize {
    background: #ffbd2e;
}

.terminal-button.maximize {
    background: #27ca3f;
}

.terminal-button:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.terminal-title {
    flex: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.9rem;
}

#terminal-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

/* Terminal Body - Glass Effect */
.terminal-body {
    height: 500px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border-radius: 0 0 15px 15px;
}

#terminal {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* Make xterm terminal transparent */
.xterm {
    background-color: transparent !important;
}

.xterm-viewport {
    background-color: transparent !important;
}

.xterm-screen {
    background-color: transparent !important;
}

/* Sidebar with Glass Cards */
.terminal-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.glass-card h3 {
    color: #ff6b6b;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Quick Commands Grid */
.quick-commands {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.quick-cmd {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

.quick-cmd:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    transform: translateY(-1px);
}

.quick-cmd:active {
    transform: translateY(0);
    background: rgba(255, 107, 107, 0.2);
}

/* Temporary Password Button */
.temp-password-btn {
    width: 100%;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.temp-password-btn:hover {
    background: linear-gradient(135deg, #ee5a6f, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.temp-password-btn:active {
    transform: translateY(0);
}

.temp-password-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.temp-password-status {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    display: none;
}

.temp-password-status.success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
    display: block;
}

.temp-password-status.error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    display: block;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    padding: 0.3rem 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Keyboard Shortcuts */
.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.shortcut kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-family: monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.shortcut span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

/* Connection Status Colors */
.status-connecting {
    color: #ffc107;
    animation: pulse 1.5s infinite;
}

.status-connected {
    color: #28a745;
}

.status-disconnected {
    color: #dc3545;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Fullscreen Mode */
.terminal-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 0;
}

.terminal-fullscreen .terminal-body {
    height: calc(100vh - 60px);
}

.terminal-fullscreen .terminal-sidebar {
    display: none;
}

/* Custom Scrollbar for Terminal */
.xterm-viewport::-webkit-scrollbar {
    width: 8px;
}

.xterm-viewport::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.xterm-viewport::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.xterm-viewport::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Terminal Focus Effect */
.terminal-window:focus-within {
    box-shadow: 0 25px 50px rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .terminal-main {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .terminal-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .glass-card {
        flex: 1;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .terminal-body {
        height: 400px;
    }
    
    .terminal-titlebar {
        padding: 0.5rem;
    }
    
    .terminal-title {
        font-size: 0.8rem;
    }
    
    .quick-commands {
        grid-template-columns: 1fr;
    }
    
    .terminal-sidebar {
        flex-direction: column;
    }
    
    .glass-card {
        padding: 1rem;
    }
    
    .back-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Enhanced Glass Effects on Hover */
@media (hover: hover) {
    .glass-card:hover {
        background: rgba(255, 255, 255, 0.15);
    }
    
    .terminal-window:hover {
        background: rgba(255, 255, 255, 0.12);
    }
}

/* Focus states for accessibility */
.action-btn:focus,
.quick-cmd:focus,
.back-button:focus {
    outline: 2px solid rgba(255, 107, 107, 0.5);
    outline-offset: 2px;
}

/* Terminal loading state */
.terminal-connecting .terminal-body {
    position: relative;
}

.terminal-connecting .terminal-body::after {
    content: "Initializing terminal connection...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
    font-size: 0.9rem;
}

/* Success/error states */
.terminal-connected .head-title {
    color: #28a745;
}

.terminal-error .head-title {
    color: #dc3545;
}