/* tmux.css - Styling for the Interactive Tmux Cheatsheet */

:root {
    --bg-dark: #0f172a;
    --terminal-bg: #1e293b;
    --border-inactive: #475569;
    --border-active: #10b981;
    --border-prefix: #f59e0b;
    --text-terminal: #f8fafc;
    --text-terminal-dim: #94a3b8;
    --status-bg: #0284c7;
    --status-fg: #f8fafc;
    --kbd-bg: #e2e8f0;
    --kbd-fg: #334155;
    --kbd-border: #cbd5e1;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --highlight-bg: #f0fdf4;
    --highlight-border: #86efac;
}

body.dark-mode {
    --kbd-bg: #334155;
    --kbd-fg: #f8fafc;
    --kbd-border: #475569;
    --card-bg: #1e293b;
    --card-border: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --highlight-bg: #064e3b;
    --highlight-border: #059669;
}

/* Page Layout */
.tmux-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.tmux-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.tmux-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tmux-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Back Link styling */
.back-link {
    display: inline-block;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #1d4ed8;
}

body.dark-mode .back-link {
    color: #60a5fa;
}

body.dark-mode .back-link:hover {
    color: #93c5fd;
}

/* Workspace Grid: Terminal on Left/Top, Cheatsheet on Right/Bottom */
.workspace-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* Visual Terminal Mockup */
.terminal-window {
    background-color: var(--bg-dark);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 480px;
    position: relative;
    transition: all 0.3s ease;
}

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

.window-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background-color: #ef4444; }
.dot-yellow { background-color: #eab308; }
.dot-green { background-color: #22c55e; }

.terminal-title {
    color: #94a3b8;
    font-size: 0.85rem;
    font-family: monospace;
}

.prefix-indicator {
    background-color: transparent;
    color: var(--border-prefix);
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    opacity: 0;
}

.prefix-indicator.active {
    opacity: 1;
    background-color: rgba(245, 158, 11, 0.15);
    border-color: var(--border-prefix);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

/* Terminal Body - tmux session area */
.terminal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    padding: 4px;
    background-color: #0c111d;
}

/* Nested Pane Container */
.tmux-pane-container {
    display: flex;
    flex: 1;
    width: 100%;
    height: 100%;
    gap: 4px;
}

.tmux-pane-container.direction-row {
    flex-direction: row;
}

.tmux-pane-container.direction-column {
    flex-direction: column;
}

/* Tmux Pane */
.tmux-pane {
    flex: 1;
    background-color: #111827;
    border: 1.5px solid var(--border-inactive);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 40px;
    min-height: 40px;
}

.tmux-pane.active {
    border-color: var(--border-active);
    box-shadow: inset 0 0 6px rgba(16, 185, 129, 0.2);
}

.tmux-pane.active-prefix {
    border-color: var(--border-prefix);
    box-shadow: inset 0 0 6px rgba(245, 158, 11, 0.2);
}

.tmux-pane.zoomed {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    z-index: 10;
}

/* In-pane styling */
.pane-header {
    background-color: #1f2937;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-family: monospace;
    color: #9ca3af;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tmux-pane.active .pane-header {
    background-color: #1f2937;
    color: #34d399;
}

.pane-body {
    flex: 1;
    padding: 0.75rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: #38bdf8;
    overflow-y: auto;
    white-space: pre-wrap;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.pane-output {
    margin-bottom: 0.5rem;
    color: #f8fafc;
}

.pane-prompt {
    color: #34d399;
    font-weight: bold;
}

.pane-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background-color: #38bdf8;
    vertical-align: middle;
    animation: blink-cursor 1s infinite;
}

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

/* Tmux Status Bar */
.tmux-status-bar {
    background-color: #10b981; /* Default green */
    color: #047857;
    font-family: monospace;
    font-size: 0.85rem;
    height: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
    user-select: none;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 5;
    transition: background-color 0.3s ease;
}

.status-left {
    font-weight: bold;
    padding: 0 6px;
    background-color: rgba(0,0,0,0.15);
    border-radius: 3px;
}

.status-windows {
    display: flex;
    gap: 8px;
}

.status-window-tab {
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-window-tab:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.status-window-tab.active {
    background-color: #047857;
    color: #ffffff;
    font-weight: bold;
}

.status-right {
    font-size: 0.8rem;
    display: flex;
    gap: 12px;
}

/* Interactive Keyboard Helper / Input Box */
.terminal-helper {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.keystroke-visualizer {
    display: flex;
    align-items: center;
    gap: 6px;
}

.keystroke-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.keystroke-badge {
    background-color: var(--kbd-bg);
    color: var(--kbd-fg);
    border: 1px solid var(--kbd-border);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 0 var(--kbd-border);
    transition: all 0.1s ease;
}

.keystroke-badge.waiting {
    animation: flash-border 1.5s infinite;
    color: var(--border-prefix);
}

@keyframes flash-border {
    0%, 100% { border-color: var(--kbd-border); box-shadow: 0 2px 0 var(--kbd-border); }
    50% { border-color: var(--border-prefix); box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4); }
}

.simulator-controls {
    display: flex;
    gap: 8px;
}

.btn-ctrl {
    background-color: var(--kbd-bg);
    border: 1px solid var(--kbd-border);
    color: var(--kbd-fg);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-ctrl:hover {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* Cheatsheet Side Panel */
.cheatsheet-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    max-height: 720px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Category Navigation Tabs */
.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 1.25rem;
    padding-bottom: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
}

.tabs-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari, and Opera */
}

.tab-btn {
    background-color: var(--kbd-bg);
    border: 1px solid var(--kbd-border);
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background-color: var(--kbd-bg);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.tab-btn.active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* Commands Listing */
.commands-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.command-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.command-row:hover {
    background-color: var(--highlight-bg);
    border-color: var(--highlight-border);
    transform: translateX(2px);
}

.command-info {
    flex: 1;
    padding-right: 1rem;
}

.command-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.command-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.command-keys {
    display: flex;
    gap: 4px;
    align-items: center;
}

kbd {
    background-color: var(--kbd-bg);
    color: var(--kbd-fg);
    border: 1px solid var(--kbd-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 1.5px 0 var(--kbd-border);
    white-space: nowrap;
}

.command-row:hover kbd {
    background-color: var(--card-bg);
}

/* Live Terminal Log / Activity feed below simulator */
.terminal-activity-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.activity-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-log {
    background-color: #0c111d;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    max-height: 120px;
    overflow-y: auto;
}

.log-entry {
    margin-bottom: 4px;
    border-left: 2px solid #2563eb;
    padding-left: 8px;
}

.log-entry.action {
    border-color: var(--border-active);
}

.log-entry.keypress {
    border-color: var(--border-prefix);
}

/* Keyboard Input overlay helper */
.focus-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    text-align: center;
    padding: 2rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.focus-overlay i {
    font-size: 3rem;
    color: #38bdf8;
    margin-bottom: 1rem;
    animation: float 2s infinite alternate;
}

.focus-overlay h4 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.focus-overlay p {
    font-size: 0.9rem;
    color: #94a3b8;
}

@keyframes float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* Quick Tips Section */
.tips-section {
    margin-top: 2rem;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.tips-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.tip-card {
    background-color: rgba(0,0,0,0.02);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--card-border);
}

body.dark-mode .tip-card {
    background-color: rgba(255,255,255,0.02);
}

.tip-card h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tip-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Custom Modal Overlay */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background-color: var(--card-bg);
    border: 2px solid #2563eb;
    border-radius: 12px;
    padding: 24px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    color: #2563eb;
    font-size: 1.35rem;
    font-weight: 700;
}

body.dark-mode .modal-content h3 {
    color: #60a5fa;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.modal-btn-primary {
    background-color: #2563eb;
    color: white;
}

.modal-btn-primary:hover {
    background-color: #1d4ed8;
}

.modal-btn-secondary {
    background-color: #4b5563;
    color: white;
    margin-left: 10px;
}

.modal-btn-secondary:hover {
    background-color: #374151;
}
