/* YOLOControl Dashboard - Vaporwave Theme */

:root {
    --bg-primary: #08080c;
    --bg-secondary: #0e0e12;
    --bg-card: #121216;
    --bg-hover: #1a1a1f;
    --text-primary: #e4e4e8;
    --text-secondary: #a0a0a8;
    --text-muted: #606068;
    --accent: #00d4aa;
    --accent-hover: #00b894;
    --accent-secondary: #00ffff;
    --success: #39ff14;
    --danger: #ff3366;
    --warning: #ffcc00;
    --border: #222228;
    --glow-accent: rgba(0, 212, 170, 0.25);
    --glow-cyan: rgba(0, 255, 255, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, var(--bg-primary) 0%, #0a0a0e 50%, var(--bg-primary) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #08080c 0%, #101014 50%, #0a0a0e 100%);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0 40px var(--glow-accent), 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: var(--accent);
    text-shadow: 0 0 10px var(--glow-accent);
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow-accent), 0 0 15px var(--glow-accent);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #9b4dca 100%);
    color: white;
    width: 100%;
    box-shadow: 0 0 20px var(--glow-accent);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #7b2cbf 100%);
    box-shadow: 0 0 30px var(--glow-accent);
}

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

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

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Navigation */
.navbar {
    background: linear-gradient(90deg, var(--bg-secondary) 0%, #14141a 50%, var(--bg-secondary) 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.navbar-brand {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-secondary);
    text-decoration: none;
    text-shadow: 0 0 10px var(--glow-cyan);
}

.navbar-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

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

.nav-link.active {
    color: var(--accent);
    background: rgba(255, 110, 199, 0.15);
    text-shadow: 0 0 8px var(--glow-accent);
}

.nav-logout {
    color: var(--text-muted);
    padding: 8px 12px;
}

.nav-logout:hover {
    color: var(--danger);
}

/* Main Content */
.main-content {
    padding: 32px 0;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--accent-secondary);
    margin-bottom: 8px;
    text-shadow: 0 0 15px var(--glow-cyan);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Cards */
.card {
    background: linear-gradient(145deg, var(--bg-card) 0%, #16161a 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, #16161a 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 25px var(--glow-accent);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--accent-secondary);
    text-shadow: 0 0 8px var(--glow-cyan);
}

.stat-value.positive {
    color: var(--success);
}

.stat-value.negative {
    color: var(--danger);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

tr:hover td {
    background: var(--bg-hover);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
}

.badge-success {
    background: rgba(57, 255, 20, 0.15);
    color: var(--success);
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
}

.badge-danger {
    background: rgba(255, 51, 102, 0.15);
    color: var(--danger);
    text-shadow: 0 0 5px rgba(255, 51, 102, 0.5);
}

.badge-muted {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    vertical-align: middle;
    margin-right: 8px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: 0.3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--glow-accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
    background-color: white;
}

/* Icon Buttons */
.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s;
}

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

.btn-icon.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: white;
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: linear-gradient(145deg, var(--bg-card) 0%, #16161a 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px var(--glow-accent), 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.modal-small {
    max-width: 400px;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

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

.modal-footer .btn {
    width: auto;
}

/* Textarea for JSON */
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    resize: vertical;
    min-height: 200px;
    line-height: 1.5;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* JSON Error */
.json-error {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 13px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

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

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

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

/* Warning text color */
.text-warning {
    color: var(--warning);
}

/* Filter Section */
.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.filter-section {
    display: flex;
    flex-direction: column;
}

.strategy-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.checkbox-label:hover {
    background: var(--bg-hover);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--accent);
}

/* Strategy box with stats */
.checkbox-label.strategy-box {
    align-items: flex-start;
    padding: 10px 14px;
}

.checkbox-label.strategy-box input[type="checkbox"] {
    margin-top: 2px;
}

.strategy-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.strategy-name {
    font-weight: 500;
}

.strategy-stats {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
}

.checkbox-label input[type="checkbox"]:checked + .strategy-info .strategy-name {
    color: var(--accent);
}

.date-inputs {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.date-field {
    flex: 1;
}

.date-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.date-field .form-input {
    width: 100%;
}

input[type="date"] {
    color-scheme: dark;
}

.filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.filter-actions .btn {
    width: auto;
}

/* Pagination */
.pagination-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .date-inputs {
        flex-direction: column;
    }
}

/* Utility Classes */
.text-success {
    color: var(--success);
}

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

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

/* Logo */
.dashboard-logo {
    display: block;
    max-width: 560px;
    height: auto;
    margin: 0 auto 24px auto;
    filter: drop-shadow(0 0 15px var(--glow-cyan));
}

/* Chart Styles */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.card-header-flex .card-title {
    margin-bottom: 0;
}

.chart-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.toggle-group {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.toggle-btn {
    padding: 8px 14px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.toggle-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, #9b4dca 100%);
    color: white;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .login-box {
        margin: 20px;
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .navbar-brand {
        display: none;
    }
    
    .navbar-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .card-header-flex {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chart-controls {
        flex-direction: column;
    }
    
    .toggle-group {
        width: 100%;
    }
    
    .toggle-btn {
        flex: 1;
        text-align: center;
    }
    
    .chart-container {
        height: 280px;
    }
}
