/* Admin Panel Styles */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --warning-color: #f6ad55;
    --danger-color: #fc8181;
    --info-color: #63b3ed;
    --dark-bg: #1a202c;
    --darker-bg: #0f1419;
    --light-bg: #2d3748;
    --lighter-bg: #4a5568;
    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;
    --border-color: #4a5568;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Container */
.admin-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.admin-header {
    background: var(--darker-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary:hover {
    background: var(--lighter-bg);
}

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Main Content */
.admin-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: var(--darker-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 3px solid transparent;
}

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

.nav-item.active {
    background: var(--light-bg);
    border-left-color: var(--primary-color);
}

.nav-item .icon {
    font-size: 1.2rem;
}

/* Settings Panels */
.settings-panels {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
}

.settings-section h2 {
    margin-bottom: 2rem;
    font-size: 1.75rem;
    color: var(--text-primary);
}

.settings-section h3 {
    margin: 1.5rem 0 1rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.large-textarea {
    min-height: 200px;
    resize: vertical;
    font-family: monospace;
}

/* Model Section */
.model-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.model-selector label {
    font-weight: 500;
}

.model-selector select {
    flex: 1;
    max-width: 400px;
}

.info-box {
    background: var(--light-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.model-parameters {
    background: var(--darker-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.param-group {
    margin-bottom: 1.5rem;
}

.param-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.param-group input[type="range"] {
    width: 100%;
    margin-bottom: 0.25rem;
}

.param-group small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Template Section */
.template-editor {
    background: var(--darker-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.template-inputs {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 500;
    font-size: 0.9rem;
}

.code-preview {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.template-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* System Instructions */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.preset-btn {
    padding: 1rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.preset-btn:hover {
    background: var(--lighter-bg);
    transform: translateY(-2px);
}

.preset-btn .icon {
    font-size: 2rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

/* Parameters Section */
.param-category {
    background: var(--darker-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.param-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Monitoring Section */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--light-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.metric-card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.performance-chart {
    background: var(--darker-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.performance-chart canvas {
    width: 100%;
    height: 300px;
}

.logs-container {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.log-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification.hidden {
    transform: translateY(100px);
    opacity: 0;
    visibility: hidden;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        left: -250px;
        z-index: 100;
        transition: left 0.3s ease;
    }
    
    .admin-sidebar.open {
        left: 0;
    }
    
    .settings-panels {
        padding: 1rem;
    }
    
    .header-actions {
        flex-wrap: wrap;
    }
    
    .param-grid,
    .preset-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}