/* ============================================
   Vault-AC Web Panel - Premium Design System
   Clean, Professional, Animated
   ============================================ */

:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-light: rgba(139, 92, 246, 0.1);
    --bg-dark: #0a0a0f;
    --bg-sidebar: #0d0d14;
    --bg-card: #1e1e26;
    --bg-card-hover: #23232b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --sidebar-width: 260px;
    --transition: all 0.25s ease;
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Smooth Background */
.bg-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

/* Security: Content Protection */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Allow selection in inputs */
input,
textarea,
select,
.selectable {
    -webkit-user-select: text;
    user-select: text;
    pointer-events: auto;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.12;
    z-index: -1;
    animation: orbFloat 30s ease-in-out infinite;
    pointer-events: none;
}

.orb-1 {
    width: 700px;
    height: 700px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    top: -300px;
    right: -200px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    bottom: -200px;
    left: -150px;
    animation-delay: -15s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -20px) scale(1.02);
    }

    50% {
        transform: translate(50px, 30px) scale(1.05);
    }

    75% {
        transform: translate(-20px, 40px) scale(1.02);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 30px 20px;
    display: flex;
    justify-content: center;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 60px;
    width: auto;
    margin-bottom: 5px;
}

.logo-text {
    font-weight: 800;
    font-size: 1.3rem;
    color: white;
    letter-spacing: -0.02em;
    text-align: center;
}

.logo-text span {
    color: var(--primary);
    margin-left: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 14px;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 2px;
    transition: height 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-link.active::before {
    height: 60%;
}

.nav-link i {
    font-size: 1.1rem;
    width: 22px;
}

.nav-divider {
    padding: 20px 16px 10px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.version {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-navbar {
    height: 70px;
    padding: 0 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 900;
}

.content-wrapper {
    padding: 35px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    margin-bottom: 35px;
    animation: fadeInUp 0.5s ease;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: white;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 6px;
    font-weight: 400;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: var(--transition);
    animation: fadeInUp 0.4s ease backwards;
}

.card:hover {
    border-color: var(--border-hover);
}

/* Staggered animation for multiple cards */
.card:nth-child(1) {
    animation-delay: 0.05s;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.15s;
}

.card:nth-child(4) {
    animation-delay: 0.2s;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

/* ===== STAT CARDS ===== */
.stat-card {
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.stat-icon.primary {
    color: var(--primary);
    border-color: rgba(139, 92, 246, 0.15);
}

.stat-icon.danger {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.15);
}

.stat-icon.warning {
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.15);
}

.stat-icon.success {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.15);
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-content h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0;
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 16px 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    background: transparent !important;
}

.table td {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
    transition: var(--transition);
    background: transparent !important;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table,
.table thead,
.table tbody,
.table tr,
.table td {
    background: transparent !important;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.table-responsive {
    background: transparent !important;
}

/* ===== USER DROPDOWN ===== */
.user-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.user-dropdown:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== BADGES ===== */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.bg-primary {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.2);
}

.bg-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.2);
}

.bg-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.2);
}

.bg-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.2);
}

.bg-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.2);
}

.bg-secondary {
    background: rgba(100, 116, 139, 0.15);
    color: #cbd5e1;
    border-color: rgba(100, 116, 139, 0.2);
}

/* ===== FORM INPUTS ===== */
.input-custom {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: white;
    padding: 14px 16px;
    border-radius: 10px;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.input-custom::placeholder {
    color: var(--text-muted);
}

.input-custom:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.35);
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* ===== BUTTONS ===== */
.btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-premium:hover {
    opacity: 0.9;
}

.btn-premium:active {
    opacity: 0.8;
}

.btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn:hover {
    opacity: 0.85;
}

/* Subtle outline button for empty states */
.btn-outline-subtle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.btn-outline-subtle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

/* ===== GLASS CARD (Login etc.) ===== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 45px;
    animation: scaleIn 0.4s ease;
}

/* ===== PREMIUM SWITCH ===== */
.premium-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.premium-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.premium-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    transition: var(--transition);
}

.premium-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition);
}

input:checked+.premium-slider {
    background: var(--primary);
    border-color: var(--primary);
}

input:checked+.premium-slider::before {
    transform: translateX(22px);
    background: white;
}

/* ===== SERVER CARDS ===== */
.server-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.status-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-online {
    background: var(--success);
}

.status-offline {
    background: var(--danger);
}

.server-stat-mini {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    transition: var(--transition);
}

.server-stat-mini:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ===== MODALS ===== */
.modal-content {
    background: var(--bg-sidebar) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Live indicator animation */
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* ===== SIDEBAR TOGGLE (Mobile) ===== */
.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: none;
    padding: 8px;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .content-wrapper {
        padding: 20px;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== UTILITY CLASSES ===== */
.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Empty State */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.15;
    display: block;
    margin-bottom: 16px;
}

.empty-state h4 {
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

/* Code blocks */
code {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.85em;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Selection */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: white;
}

/* ===== BOOTSTRAP OVERRIDES ===== */

/* Dropdown Menu */
.dropdown-menu {
    background: var(--bg-sidebar) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 8px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

.dropdown-item {
    color: var(--text-secondary) !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    transition: var(--transition) !important;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
}

.dropdown-item.text-danger {
    color: var(--danger) !important;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.dropdown-item.text-warning {
    color: var(--warning) !important;
}

.dropdown-item.text-warning:hover {
    background: rgba(245, 158, 11, 0.1) !important;
}

.dropdown-divider {
    border-color: var(--border-color) !important;
    margin: 6px 0 !important;
}

/* Form Controls */
.form-control,
.form-select {
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-size: 0.9rem !important;
    transition: var(--transition) !important;
}

.form-control:focus,
.form-select:focus {
    background: rgba(0, 0, 0, 0.35) !important;
    border-color: var(--primary) !important;
    box-shadow: none !important;
    color: var(--text-primary) !important;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

.form-select option {
    background: var(--bg-sidebar);
    color: var(--text-primary);
}

/* Pagination */
.pagination {
    gap: 4px;
}

.page-link {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    transition: var(--transition) !important;
}

.page-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-hover) !important;
}

.page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

.page-item.disabled .page-link {
    background: transparent !important;
    color: var(--text-muted) !important;
    opacity: 0.5;
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 16px 20px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Table Responsive */
.table-responsive {
    border-radius: 16px;
    overflow: hidden;
}

/* Button Group */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

/* Small buttons */
.btn-sm {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
}

/* Outline buttons */
.btn-outline-primary {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: white !important;
}

.btn-outline-danger {
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

.btn-outline-danger:hover {
    background: var(--danger) !important;
    color: white !important;
}

/* Security Badge */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.security-badge i {
    color: var(--success);
}

/* Table row link style */
.table tbody tr {
    cursor: default;
}

/* Fix modal backdrop and stacking */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

/* Card hover disable for tables */
.card:has(.table):hover {
    transform: none;
}