:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #4facfe;
    --warning-color: #43e97b;
    --danger-color: #f5576c;
    --dark-bg: #0f172a;
    --darker-bg: #0a0f1c;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--darker-bg);
    color: #e2e8f0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background particles effect */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background: var(--dark-bg);
}

/* Glass morphism effects */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    box-shadow: var(--glass-shadow);
}

.glass-card-2 {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.glass-navbar {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== TYPOGRAPHY STYLES ===== */
/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #e2e8f0;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

.display-1 { font-size: 4rem; font-weight: 700; }
.display-2 { font-size: 3.5rem; font-weight: 700; }
.display-3 { font-size: 3rem; font-weight: 700; }
.display-4 { font-size: 2.5rem; font-weight: 700; }

/* Card text elements */
.card-title {
    color: #e2e8f0 !important;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.card-subtitle {
    color: #94a3b8 !important;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.card-text {
    color: #cbd5e1 !important;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.card-header .card-title {
    margin-bottom: 0;
    color: #e2e8f0 !important;
}

/* Paragraphs and text */
p {
    color: #cbd5e1;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.lead {
    font-size: 1.1rem;
    font-weight: 400;
    color: #e2e8f0;
}

.text-muted {
    color: #94a3b8 !important;
}

.text-white {
    color: #e2e8f0 !important;
}

.text-dark {
    color: #1e293b !important;
}

/* Small text */
small, .small {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* ===== CARD STYLES ===== */
.card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
    background: transparent;
    color: #e2e8f0;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--glass-bg) !important;
    backdrop-filter: blur(10px);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
    color: #e2e8f0;
}

.card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem 1.5rem;
}

/* ===== NAVBAR STYLES ===== */
.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 2px;
    color: #cbd5e1 !important;
}

.navbar-nav .nav-link:hover {
    background: var(--primary-color);
    color: white !important;
    transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
    background: var(--primary-color);
    color: white !important;
}

/* ===== BUTTON STYLES ===== */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    color: white;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    color: white;
}

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

.btn-success:hover {
    background: #3d9bf7;
    transform: translateY(-2px);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    border: none;
    color: #000 !important;
}

.btn-warning:hover {
    background: #38d9a9;
    transform: translateY(-2px);
    color: #000 !important;
}

.btn-danger {
    background: var(--danger-color);
    border: none;
}

.btn-danger:hover {
    background: #f03e5f;
    transform: translateY(-2px);
    color: white;
}

.btn-info {
    background: var(--secondary-color);
    border: none;
}

.btn-info:hover {
    background: #6b5b95;
    transform: translateY(-2px);
    color: white;
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #e2e8f0;
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #e2e8f0;
    transform: translateY(-2px);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ===== FORM STYLES ===== */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    color: #e2e8f0;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-label {
    color: #e2e8f0;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-text {
    color: #94a3b8 !important;
    font-size: 0.875rem;
}

.form-check-label {
    color: #cbd5e1;
}

/* ===== TABLE STYLES ===== */
.table {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 10px;
    overflow: hidden;
    color: #e2e8f0;
    margin-bottom: 0;
}

.table-dark {
    background: rgba(15, 23, 42, 0.9);
}

.table-dark th {
    background: rgba(102, 126, 234, 0.3);
    color: white;
    font-weight: 600;
    border: none;
    backdrop-filter: blur(10px);
    padding: 1rem;
}

.table-dark td {
    border-color: rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    padding: 1rem;
    color: #cbd5e1;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ===== ALERT STYLES ===== */
.alert {
    border: none;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
}

.alert-heading {
    color: inherit;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #f8d7da;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #fff3cd;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.alert-success {
    background: rgba(25, 135, 84, 0.2);
    color: #d1e7dd;
    border: 1px solid rgba(25, 135, 84, 0.3);
}

.alert-info {
    background: rgba(13, 202, 240, 0.2);
    color: #cff4fc;
    border: 1px solid rgba(13, 202, 240, 0.3);
}

.alert-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.alert-link:hover {
    color: inherit;
    text-decoration: none;
}

/* ===== BADGE STYLES ===== */
.badge {
    border-radius: 8px;
    font-weight: 600;
    padding: 6px 12px;
    text-transform: uppercase;
    border: 1px solid transparent;
    font-size: 0.75rem;
}

.badge.bg-success {
    background: var(--success-color) !important;
}

.badge.bg-danger {
    background: var(--danger-color) !important;
}

.badge.bg-warning {
    background: var(--warning-color) !important;
    color: #000 !important;
}

.badge.bg-info {
    background: var(--secondary-color) !important;
}

.badge.bg-primary {
    background: var(--primary-color) !important;
}

.badge.bg-secondary {
    background: #475569 !important;
}

.badge.bg-light {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

/* ===== PROGRESS BAR STYLES ===== */
.progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
    background: var(--success-color);
    border-radius: 10px;
    transition: width 0.6s ease;
    font-weight: 600;
    color: white;
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* ===== STATS CARDS ===== */
.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.stat-card i {
    font-size: 3rem;
    color: var(--primary-color);
}

.stat-card h4 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.stat-card small {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.floating { 
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: translate(0, 0px); }
    50% { transform: translate(0, -8px); }
    100% { transform: translate(0, -0px); }
}

.text-pulse {
    animation: textPulse 0.5s ease-in-out;
}

@keyframes textPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===== PERMANENT ALERT STYLES ===== */
.alert-permanent {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: permanentGlow 3s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.alert-danger.alert-permanent {
    background: rgba(220, 53, 69, 0.2) !important;
    border-color: rgba(220, 53, 69, 0.5);
}

.alert-warning.alert-permanent {
    background: rgba(255, 193, 7, 0.2) !important;
    border-color: rgba(255, 193, 7, 0.5);
}

@keyframes permanentGlow {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% { 
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

.blink {
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== UTILITY CLASSES ===== */
.opacity-8 {
    opacity: 0.8;
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

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

.text-start {
    text-align: left !important;
}

.text-end {
    text-align: right !important;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
        padding: 1.5rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
}

/* ===== FOOTER STYLES ===== */
footer {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px);
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

footer a {
    color: #cbd5e1;
    text-decoration: none;
}

footer a:hover {
    color: #e2e8f0;
    text-decoration: underline;
}

/* ===== CODE DISPLAY ===== */
code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.875em;
}

/* ===== MODAL STYLES ===== */
.modal-content.glass-card-2 {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: #e2e8f0;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.modal-title {
    color: #e2e8f0;
    font-weight: 600;
}

/* ===== TOAST STYLES ===== */
.toast-container {
    z-index: 9999;
}

.toast {
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.toast-body {
    padding: 12px 16px;
    font-weight: 500;
    color: #e2e8f0;
}

/* ===== SELECT DROPDOWN STYLES ===== */
.form-select.glass-card-2 {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    backdrop-filter: blur(10px);
}

.form-select.glass-card-2:focus {
    background: rgba(0, 0, 0, 0.8) !important;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    color: #e2e8f0;
}

.form-select.glass-card-2 option {
    background: #000;
    color: #e2e8f0;
    padding: 12px;
}

select.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23e2e8f0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

/* ===== DISABLED STATES ===== */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== FOCUS STATES ===== */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

/* ===== TEXT COLORS ===== */
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--secondary-color) !important; }
.text-primary { color: var(--primary-color) !important; }

/* ===== LOADING STATES ===== */
.fas.fa-spinner.fa-spin {
    animation: fa-spin 1s linear infinite;
}

/* ===== Z-INDEX MANAGEMENT ===== */
.toast-container { z-index: 9999; }
.modal { z-index: 9998; }
.navbar { z-index: 9997; }

/* ===== TEXT SELECTION ===== */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

