/* eProxy Config - Clean, Modern UI */

:root {
    --bg-dark: #1e1e1e;
    --bg-darker: #141414;
    --bg-light: #2d2d2d;
    --bg-lighter: #3c3c3c;
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --text-muted: #666;
    --accent: #0078d4;
    --accent-hover: #1084d8;
    --success: #4caf50;
    --green: #10b981;
    --warning: #ff9800;
    --error: #f44336;
    --red: #ef4444;
    --border: #404040;
    --sidebar-width: 280px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 50px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
    margin-right: 40px;
}

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

.nav-links {
    display: flex;
    gap: 5px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-light);
}

.nav-divider {
    color: var(--border);
    margin: 0 8px;
    user-select: none;
}

.nav-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.status-dot.green { background: var(--success); }
.status-dot.red { background: var(--error); }
.status-dot.gray { background: var(--text-muted); }
.status-dot.blue { background: var(--accent); }

/* Container */
.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-darker);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-tree {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.tree-type {
    margin-bottom: 5px;
}

.tree-type-header {
    padding: 8px 15px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tree-customer-header {
    padding: 6px 15px 6px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tree-customer-header:hover {
    background: var(--bg-light);
}

.tree-customer-header .arrow {
    font-size: 10px;
    color: var(--text-muted);
    width: 12px;
}

.tree-services {
    overflow: hidden;
    transition: max-height 0.2s;
}

.tree-services.collapsed {
    max-height: 0 !important;
}

.tree-service {
    padding: 6px 15px 6px 45px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tree-service:hover {
    background: var(--bg-light);
}

.tree-service.active {
    background: var(--accent);
    color: white;
}

.service-indicators {
    display: flex;
    gap: 4px;
}

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

.dot.green { background: var(--success); }
.dot.blue { background: var(--accent); }
.dot.gray { background: var(--text-muted); opacity: 0.5; }

/* Editor Panel */
.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
}

.badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

.badge-web {
    background: #2196f3;
    color: white;
}

.badge-stadis {
    background: #9c27b0;
    color: white;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.env-select {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.env-select:focus {
    outline: none;
    border-color: var(--accent);
}

.editor-container {
    flex: 1;
    overflow: hidden;
}

.editor-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 16px;
}

.editor-placeholder .hint {
    font-size: 13px;
    margin-top: 8px;
}

.editor-footer {
    padding: 8px 20px;
    background: var(--bg-darker);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--warning);
    min-height: 32px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-lighter);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: #4a4a4a;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 24px;
}

.btn-outline:hover {
    background: var(--bg-light);
    border-color: var(--accent);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
}

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

.modal-header h3 {
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

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

.modal-body {
    padding: 20px;
}

.template-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 1001;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

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

.toast.error {
    background: var(--error);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-lighter);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Page specific styles for other pages */
.page-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.page-header h2 {
    font-size: 20px;
    font-weight: 500;
}

.page-content {
    padding: 20px;
    flex: 1;
    overflow: auto;
}

.card {
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 15px;
}

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

.card-body {
    padding: 15px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
}

.table tr:hover {
    background: var(--bg-light);
}

/* Two column layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1200px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
}

.tab:hover {
    background: var(--bg-light);
}

.tab.active {
    background: var(--bg-light);
    color: var(--text-primary);
}
