/* Titanium Panel - Custom Styles */

/* Variables - Dark Theme (Default) */
:root {
    --bg-primary: #0a0c10;
    --bg-secondary: #0f1218;
    --bg-card: #141820;
    --bg-hover: #1a1f2a;
    --border: #1e2432;
    --border-light: #2a3142;
    --text-primary: #e8eaed;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-dark: #1e40af;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f9fafb;
    --border: #e5e7eb;
    --border-light: #d1d5db;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
}

[data-theme="light"] body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="light"] .sidebar {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="light"] .card {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .nav-item {
    color: var(--text-secondary);
}

[data-theme="light"] .nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

[data-theme="light"] .nav-item.active {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent);
}

[data-theme="light"] header {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: var(--border);
}

[data-theme="light"] .input {
    background: var(--bg-primary);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="light"] .input:focus {
    border-color: var(--accent);
}

[data-theme="light"] th {
    background: var(--bg-primary);
    color: var(--text-muted);
    border-color: var(--border);
}

[data-theme="light"] td {
    border-color: var(--border);
}

[data-theme="light"] tr:hover td {
    background: var(--bg-hover);
}

[data-theme="light"] .btn-secondary {
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="light"] .btn-secondary:hover {
    background: var(--bg-hover);
}

[data-theme="light"] .btn-ghost {
    color: var(--text-secondary);
}

[data-theme="light"] .btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

[data-theme="light"] .dropdown-menu {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dropdown-item {
    color: var(--text-secondary);
}

[data-theme="light"] .dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

[data-theme="light"] .modal {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="light"] .stat-value {
    color: var(--text-primary);
}

[data-theme="light"] .tab {
    color: var(--text-secondary);
}

[data-theme="light"] .tab:hover {
    color: var(--text-primary);
}

[data-theme="light"] .tab.active {
    color: var(--accent);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--border-light);
}

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sora', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Focus states */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-hidden {
    transform: translateX(-100%);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content-full {
    margin-left: 0;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.card-hover:hover {
    border-color: var(--border-light);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

tr:hover td {
    background: var(--bg-hover);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Sora', sans-serif;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-light);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Inputs */
.input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: 'Sora', sans-serif;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: border-color 0.15s ease;
}

.input:focus {
    border-color: var(--accent);
}

.input::placeholder {
    color: var(--text-muted);
}

/* Select */
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

/* Stat cards */
.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.stat-value-gradient {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 400;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
    margin-left: -1px;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--accent-light);
    background: rgba(59, 130, 246, 0.08);
    border-left-color: var(--accent);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Tabs */
.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    z-index: 50;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Charts container */
.chart-container {
    position: relative;
    height: 300px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

/* Sidebar Overlay */
#sidebarOverlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}

#sidebarOverlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .stat-value {
        font-size: 1.5rem;
    }
    
    th, td {
        padding: 0.625rem 0.75rem;
    }
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-gradient {
    border-image: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%) 1;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

