/* /assets/css/custom.css */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-tertiary: #1a1a24;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --border: #27272a;
    --purple-primary: #a855f7;
    --purple-secondary: #7c3aed;
    --pink-primary: #ec4899;
    --glow-purple: rgba(168, 85, 247, 0.15);
    --glow-pink: rgba(236, 72, 153, 0.15);
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --border: #e4e4e7;
    --glow-purple: rgba(168, 85, 247, 0.08);
    --glow-pink: rgba(236, 72, 153, 0.08);
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Glass Effect Premium */
.glass {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .glass {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.7) 100%
    );
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

/* Stat Cards com Hover Effect */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        var(--glow-purple),
        transparent
    );
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(168, 85, 247, 0.3),
        0 0 40px var(--glow-purple),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Gradient Text Premium */
.bg-gradient-to-r {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f97316 100%);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Table Styling */
table {
    border-collapse: separate;
    border-spacing: 0;
}

table thead tr {
    background: linear-gradient(90deg, var(--glow-purple), var(--glow-pink));
}

table tbody tr {
    transition: all 0.3s ease;
}

table tbody tr:hover {
    background: var(--glow-purple);
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

/* Status Badges Premium */
.status-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.bg-green-500\/20::before {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
}

.bg-red-500\/20::before {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Preloader Premium */
.preloader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

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

.quantum-logo {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
    animation: logoGlow 2s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5)); }
    50% { filter: drop-shadow(0 0 40px rgba(236, 72, 153, 0.8)); }
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid transparent;
    border-top-color: #a855f7;
    border-right-color: #ec4899;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Theme Toggle Premium */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 32px;
    background: linear-gradient(135deg, var(--glow-purple), var(--glow-pink));
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--glow-purple);
}

.theme-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .theme-toggle-slider {
    transform: translateX(28px);
}

#themeIcon {
    font-size: 1rem;
}

/* Toast Premium */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 12px;
    backdrop-filter: blur(20px);
    animation: slideInRight 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 300px;
}

.toast.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.toast.info {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Animations */
.slide-in {
    animation: slideUp 0.6s ease-out;
}

.fade-in {
    animation: fadeIn 0.8s ease-out backwards;
}

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

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

/* Scrollbar Premium */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c3aed, #db2777);
}

/* Buttons Premium */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}

/* Confirm Modal */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-overlay.show {
    opacity: 1;
}

.confirm-modal {
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 400px;
    border: 1px solid var(--border);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-overlay.show .confirm-modal {
    transform: scale(1);
}

.confirm-icon {
    margin-bottom: 1rem;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    .quantum-logo {
        font-size: 2rem;
    }
}