/* ===== Base Styles ===== */
:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --accent-primary: #0078d4;
    --accent-secondary: #00bcf2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --radius: 4px;
    --sidebar-width: 250px;
    --top-bar-height: 40px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ===== Top Bar ===== */
.top-bar {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    height: var(--top-bar-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 5px var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.logo i {
    color: var(--accent-primary);
}

.top-bar-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ===== App Layout ===== */
.app-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--top-bar-height));
    overflow-y: auto;
}

.sidebar-section {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
    border-bottom: none;
    flex-grow: 1;
}

.sidebar-section h3 {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding: 0 5px;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.sidebar li:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar li.active {
    background-color: var(--accent-primary);
    color: white;
}

.sidebar li i {
    width: 20px;
    text-align: center;
}

/* Status Indicators */
.status-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: var(--radius);
    background-color: var(--bg-tertiary);
}

.status-indicator .label {
    font-size: 12px;
}

.led {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 5px currentColor;
}

.led-red {
    background-color: var(--danger);
}

.led-green {
    background-color: var(--success);
}

.led-orange {
    background-color: var(--warning);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    height: calc(100vh - var(--top-bar-height));
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.card-full {
    grid-column: span 2;
}

/* ===== Cards ===== */
.card {
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header {
    background-color: var(--bg-tertiary);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.card-header i {
    color: var(--accent-primary);
}

.card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* ===== Buttons ===== */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #0063b1;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-info {
    background-color: var(--accent-secondary);
    color: white;
}

.btn-info:hover {
    background-color: #0099cc;
}

.btn-warning {
    background-color: var(--warning);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--border);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* ===== Status Bar ===== */
.status-bar {
    padding: 8px 10px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 12px;
    margin-top: auto;
}

.status-text {
    color: var(--text-secondary);
}

.status-text.success {
    color: var(--success);
}

.status-text.error {
    color: var(--danger);
}

.status-text.info {
    color: var(--accent-secondary);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-box {
    background-color: var(--bg-primary);
    padding: 10px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-box i {
    font-size: 18px;
    color: var(--accent-primary);
    width: 24px;
    text-align: center;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Container List ===== */
.container-list {
    margin-bottom: 15px;
}

.container-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background-color: var(--bg-primary);
    border-radius: var(--radius);
    margin-bottom: 5px;
    justify-content: space-between;
}

.container-name {
    flex: 1;
    font-weight: 500;
}

.container-status {
    margin: 0 10px;
}

.container-action {
    display: flex;
    gap: 5px;
}

.btn-icon-small {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px 6px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ===== Terminal ===== */
.terminal {
    background-color: #000;
    color: #f0f0f0;
    padding: 10px;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.terminal-full {
    background-color: #000;
    color: #f0f0f0;
    padding: 15px;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.log-line {
    margin: 2px 0;
}

.log-info {
    color: var(--accent-secondary);
}

.log-success {
    color: var(--success);
}

.log-warning {
    color: var(--warning);
}

.log-error {
    color: var(--danger);
}

.terminal-prompt {
    color: var(--accent-secondary);
}

.terminal-input {
    color: var(--text-primary);
}

.terminal-output {
    color: var(--text-secondary);
}

.terminal-input-bar {
    display: flex;
    gap: 10px;
}

.terminal-input-bar input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

/* ===== Git History ===== */
.git-history {
    margin-bottom: 15px;
}

.commit {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.commit:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.commit-hash {
    font-family: 'Courier New', monospace;
    color: var(--accent-secondary);
    font-size: 12px;
    margin-bottom: 5px;
}

.commit-msg {
    font-weight: 500;
    margin-bottom: 5px;
}

.commit-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Docker Stats ===== */
.docker-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.stat {
    background-color: var(--bg-primary);
    padding: 10px;
    border-radius: var(--radius);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Config Sections ===== */
.config-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.config-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 14px;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 500px;
    max-width: 90%;
    margin: 10% auto;
    box-shadow: 0 5px 15px var(--shadow);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 16px;
    color: var(--text-primary);
}

.close {
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 15px;
    flex: 1;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== Docker Actions ===== */
.docker-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .card-full {
        grid-column: span 1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        padding: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .docker-stats {
        grid-template-columns: 1fr;
    }
}
