/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1d29 0%, #252836 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

/* Color variables */
:root {
    --bg-dark: #1a1d29;
    --surface-dark: #252836;
    --card-bg: #2d3142;
    --primary-accent: #6c5ce7;
    --success: #00b894;
    --warning: #fdcb6e;
    --error: #e17055;
    --info: #74b9ff;
    --text-primary: #ffffff;
    --text-secondary: #a0a3bd;
    --text-muted: #6c7293;
    --border-color: #3d4258;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Typography */
h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 500; }
p { font-size: 1rem; }
small { font-size: 0.875rem; color: var(--text-secondary); }

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

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-accent) 0%, #5a4fcf 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-accent);
    border: 2px solid var(--primary-accent);
}

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

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

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-dark);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

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

/* Login page specific styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1d29 0%, #252836 50%, #2d3142 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-card {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    background: linear-gradient(135deg, var(--primary-accent) 0%, #74b9ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

/* Dashboard layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--surface-dark);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 0 2rem 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 12px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-accent);
    border-right: 3px solid var(--primary-accent);
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-accent) 0%, #74b9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-accent), var(--info));
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

/* Tables */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

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

.table th {
    background: var(--surface-dark);
    font-weight: 600;
    color: var(--text-secondary);
}

.table tr:hover {
    background: rgba(108, 92, 231, 0.05);
}

/* Code display */
.code-display {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--surface-dark);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    letter-spacing: 2px;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(0, 184, 148, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(225, 112, 85, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-info {
    background: rgba(116, 185, 255, 0.1);
    border-color: var(--info);
    color: var(--info);
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        margin: 1rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.hidden {
    display: none !important;
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

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

.badge-secondary {
    background: var(--text-muted);
    color: white;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }

