/* Module Session Styles - Terminal and Interactive Elements */

/* Split-pane layout styles */
body.session-layout {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.session-layout .header {
    flex-shrink: 0;
    position: relative;
}

.session-layout .main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.session-layout .content-pane {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 2rem;
}

/* Terminal Pane Styles */
.terminal-pane {
    height: 400px;
    flex-shrink: 0;
    border-top: 2px solid var(--gray-200);
    background: var(--gray-900);
    display: flex;
    flex-direction: column;
    transition: height 0.3s ease;
    position: relative;
}

.terminal-pane.collapsed {
    height: 40px;
}

.terminal-header {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
}

.terminal-header:hover {
    background: var(--primary-hover);
}

.terminal-content {
    flex: 1;
    position: relative;
    background: var(--gray-900);
    overflow: hidden;
}

.terminal-pane.collapsed .terminal-content {
    display: none;
}

.terminal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--gray-900);
}

.terminal-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-900);
    color: var(--gray-100);
    font-family: 'JetBrains Mono', monospace;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-600);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.terminal-status {
    position: absolute;
    bottom: 5px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    z-index: 5;
}

/* Terminal Toggle Button */
.terminal-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-toggle:hover {
    background: var(--primary-hover);
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 6px;
    cursor: ns-resize;
    background: transparent;
    z-index: 20;
}

.resize-handle:hover {
    background: var(--primary-color);
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 2px;
    background: var(--gray-400);
    border-radius: 1px;
}

.resize-handle:hover::after {
    background: white;
}

/* Terminal Chevron Icon */
.terminal-chevron {
    transition: transform 0.3s ease;
}

.terminal-pane.collapsed .terminal-chevron {
    transform: rotate(180deg);
}

/* Interactive Command Examples */
.example-command {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-command:hover {
    background: var(--gray-200);
    border-color: var(--primary-color);
}

.example-command::before {
    content: "$ ";
    color: var(--primary-color);
    font-weight: bold;
}

/* Try It Notes */
.try-it-note {
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.try-it-note strong {
    color: var(--primary-color);
}

/* Responsive Design for Sessions */
@media (max-width: 768px) {
    .session-layout .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .session-layout .nav {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .terminal-pane {
        height: 300px;
    }
    
    .terminal-toggle {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .terminal-pane {
        height: 250px;
    }
    
    .terminal-header {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .example-command {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    .try-it-note {
        padding: 0.8rem;
        font-size: 0.8rem;
    }
}