/* Glacier Dark Glassmorphic Design System for Admin Panel */

:root {
    --bs-body-bg: #0a0e1a;
    --bs-body-color: #e0e8f0;
    --primary-glacier: #7dd3fc;
    --tertiary-glacier: #c8a0f0;
    --surface-variant: #1a2438;
    --outline-variant: #2a3a48;
    --glass-bg: rgba(20, 28, 46, 0.7);
    --glass-border: rgba(125, 211, 252, 0.15);
}

body {
    font-family: "Inter", sans-serif;
    overflow-x: hidden;
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(20, 28, 46, 0.85);
    backdrop-filter: blur(24px);
    border-right: 1px solid var(--glass-border);
    z-index: 1000;
    transition: transform 0.3s ease;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
    }
}

.main-content {
    margin-left: 280px;
    min-height: 100vh;
    position: relative;
    padding-bottom: 3rem;
}

/* Ambient Glows */
.glow-1 {
    position: absolute;
    top: -10%;
    left: -5%;
    width: 500px;
    height: 500px;
    background: rgba(125, 211, 252, 0.05);
    filter: blur(120px);
    border-radius: 50%;
    pointer-events: none;
}

.glow-2 {
    position: absolute;
    bottom: -5%;
    right: -2%;
    width: 400px;
    height: 400px;
    background: rgba(200, 160, 240, 0.05);
    filter: blur(100px);
    border-radius: 50%;
    pointer-events: none;
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: var(--bs-body-color) !important;
}

.glass-card:hover {
    border-color: rgba(125, 211, 252, 0.3);
    transform: translateY(-2px);
    background: rgba(20, 28, 46, 0.8);
}

/* Standard cards adaptation so they map perfectly into the dark glass theme */
.card,
.glass-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 1rem !important;
    color: var(--bs-body-color) !important;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(125, 211, 252, 0.3) !important;
    background: rgba(20, 28, 46, 0.8) !important;
}

/* Card heads and bodies */
.card-header,
.card-footer {
    background: rgba(20, 28, 46, 0.5) !important;
    border-color: var(--glass-border) !important;
    color: var(--primary-glacier) !important;
    font-weight: 600;
}

.card-title {
    color: var(--primary-glacier) !important;
    font-weight: 700 !important;
}

.text-muted,
.card-body .text-muted,
.form-text {
    color: #a0b4c4 !important;
}

/* Glass Card Accents (replaces inline styles) */
.glass-card-accent-tertiary {
    border-top: 2px solid var(--tertiary-glacier) !important;
}

.glass-card-accent-danger {
    border-top: 2px solid #ff6b6b !important;
}

/* Logo brand container (replaces style="width: 44px; height: 44px; background: rgba(125, 211, 252, 0.15) !important;") */
.brand-logo-container {
    width: 44px;
    height: 44px;
    background: rgba(125, 211, 252, 0.15) !important;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Brand small subtitle (replaces style="font-size: 10px; letter-spacing: 1px;") */
.brand-subtitle {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #a0b4c4;
}

/* Status dot (replaces style="width: 8px; height: 8px;") */
.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Live Update badge (replaces style="font-size: 10px;") */
.badge-live-update {
    font-size: 10px;
    padding: 0.5rem 0.75rem;
    background-color: rgba(13, 110, 253, 0.1) !important;
    color: var(--primary-glacier) !important;
}

/* Small text (replaces style="font-size: 11px;") */
.text-xsmall-custom {
    font-size: 11px;
    color: #a0b4c4;
}

/* Avatar medium (replaces style="width: 48px; height: 48px; object-fit: cover;") */
.avatar-md {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
}

/* Typography & Components */
.text-glacier-primary {
    color: var(--primary-glacier);
}
.text-glacier-tertiary {
    color: var(--tertiary-glacier);
}
.text-muted-custom {
    color: #a0b4c4;
}

.sidebar .nav-link {
    color: #a0b4c4;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sidebar .nav-link.active {
    background: rgba(125, 211, 252, 0.1) !important;
    color: var(--primary-glacier) !important;
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-top: auto;
}

.btn-glacier-solid {
    background-color: var(--primary-glacier);
    color: #001f2e !important;
    font-weight: 600;
    border: none;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-glacier-solid:hover {
    background-color: #bae6fd;
    color: #001f2e !important;
    transform: scale(1.02);
}

.btn-glacier-outline {
    background: rgba(125, 211, 252, 0.05);
    border: 1px solid rgba(125, 211, 252, 0.2);
    color: var(--primary-glacier);
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-glacier-outline:hover {
    background: rgba(125, 211, 252, 0.15);
    border-color: var(--primary-glacier);
    color: var(--primary-glacier);
}

/* Also ensure all native bootstrap buttons in admin context are normalized beautifully to keep alignment and line height uniform */
.main-content .btn {
    padding: 0.5rem 1.25rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    border-radius: 0.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}

/* Small buttons adjustments (like operations tables) */
.main-content .btn-sm {
    padding: 0.25rem 0.75rem !important;
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
    border-radius: 0.375rem !important;
}

/* Ensure all outline buttons inside admin have readable text color on hover */
.main-content .btn-outline-danger:hover {
    color: #fff !important;
    background-color: #ef4444 !important;
}

.main-content .btn-outline-success:hover {
    color: #fff !important;
    background-color: #16a34a !important;
}

.main-content .btn-outline-warning:hover {
    color: #0f172a !important;
    background-color: #f59e0b !important;
}

.main-content .btn-outline-secondary:hover {
    color: #fff !important;
    background-color: #64748b !important;
}

/* Base Bootstrap inputs normalization */
.main-content .form-control,
.main-content .form-select {
    background-color: rgba(20, 28, 46, 0.6) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--bs-body-color) !important;
}

.main-content .form-control:focus,
.main-content .form-select:focus {
    border-color: var(--primary-glacier) !important;
    box-shadow: 0 0 0 0.2rem rgba(125, 211, 252, 0.15) !important;
}

.stat-icon {
    position: absolute;
    right: -15px;
    bottom: -15px;
    font-size: 6rem;
    opacity: 0.05;
    pointer-events: none;
}

/* Chart Visualizer */
.chart-container {
    height: 180px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 1rem;
    background: linear-gradient(
        to right,
        rgba(125, 211, 252, 0.03),
        transparent
    );
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.chart-bar {
    flex: 1;
    background: rgba(125, 211, 252, 0.2);
    border-radius: 2px 2px 0 0;
    transition: height 0.5s ease;
}

.chart-bar.active {
    background: rgba(125, 211, 252, 0.5);
    box-shadow: 0 0 15px rgba(125, 211, 252, 0.2);
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: var(--bs-body-bg);
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(125, 211, 252, 0.1);
    border-radius: 10px;
}

.material-symbols-outlined {
    font-variation-settings:
        "FILL" 0,
        "wght" 400,
        "GRAD" 0,
        "opsz" 24;
}
.fill-1 {
    font-variation-settings: "FILL" 1;
}

#mobile-nav-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    z-index: 2000;
    display: none;
}

@media (max-width: 991.98px) {
    #mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Tables Adaptations inside Glass Cards */
.glass-card .table {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--bs-body-color) !important;
    --bs-table-border-color: rgba(125, 211, 252, 0.08) !important;
    --bs-table-hover-bg: rgba(125, 211, 252, 0.04) !important;
}

.glass-card .table thead {
    border-bottom: 1px solid rgba(125, 211, 252, 0.15) !important;
}

.glass-card .table th {
    background-color: rgba(20, 28, 46, 0.4) !important;
    color: var(--primary-glacier) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem !important;
    border-bottom: none;
}

.glass-card .table td {
    vertical-align: middle;
    padding: 1rem 1.25rem !important;
    font-size: 0.875rem;
    color: var(--bs-body-color) !important;
}

/* Fix link styling inside table cells so they don't use default light theme text color */
.glass-card .table td a {
    color: var(--primary-glacier);
    text-decoration: none;
    transition: color 0.2s ease;
}

.glass-card .table td a:hover {
    color: #bae6fd;
    text-decoration: underline;
}

/* Style secondary small text in tables to be legible but soft */
.glass-card .table td small, 
.glass-card .table td .text-secondary,
.glass-card .table td .text-muted-custom {
    color: #94a3b8 !important;
}

/* Dashboard Quick Action Cards & Live Indicator */
.live-indicator-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(125, 211, 252, 0.06);
    border: 1px solid rgba(125, 211, 252, 0.12);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-glacier);
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-glacier);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(125, 211, 252, 0.4);
    animation: live-indicator-pulse 2s infinite;
}

@keyframes live-indicator-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(125, 211, 252, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(125, 211, 252, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(125, 211, 252, 0);
    }
}

.dashboard-action-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    color: var(--bs-body-color);
}

.dashboard-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 10%, rgba(125, 211, 252, 0.05), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.dashboard-action-card:hover {
    transform: translateY(-4px);
    border-color: rgba(125, 211, 252, 0.4);
    background: rgba(20, 28, 46, 0.8);
    box-shadow: 0 12px 24px -10px rgba(125, 211, 252, 0.15);
    text-decoration: none !important;
}

.dashboard-action-card:hover::before {
    opacity: 1;
}

.action-card-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    background: rgba(125, 211, 252, 0.08);
    border: 1px solid rgba(125, 211, 252, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--primary-glacier);
    transition: all 0.3s ease;
}

.dashboard-action-card:hover .action-card-icon-box {
    background: var(--primary-glacier);
    color: #001f2e;
    transform: scale(1.05);
}

.action-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.action-card-desc {
    font-size: 0.875rem;
    color: #a0b4c4;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.action-card-btn {
    align-self: flex-start;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-glacier);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: gap 0.2s ease, color 0.2s ease;
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 0;
}

.dashboard-action-card:hover .action-card-btn {
    color: #fff;
    gap: 0.5rem;
}
