/* HCDS Customer Success Command Center - Custom Styles */

/* ================================
   Base Styles
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0F172A;
    color: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================
   Custom Scrollbar
   ================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ================================
   Glass Card Component
   ================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
        0 20px 40px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transform: translateY(-2px);
}

/* ================================
   Animations
   ================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

.animate-pulse-slow {
    animation: pulse 3s ease-in-out infinite;
}

/* Staggered animation delays */
section:nth-child(1) { animation-delay: 0s; }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }
section:nth-child(6) { animation-delay: 0.5s; }
section:nth-child(7) { animation-delay: 0.6s; }
section:nth-child(8) { animation-delay: 0.7s; }
section:nth-child(9) { animation-delay: 0.8s; }
section:nth-child(10) { animation-delay: 0.9s; }

/* ================================
   Card Hover Effects
   ================================ */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* ================================
   Gradient Text
   ================================ */
.gradient-text {
    background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ================================
   Badge Styles
   ================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    gap: 0.25rem;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-primary {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-secondary {
    background: rgba(6, 182, 212, 0.1);
    color: #06B6D4;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ================================
   Status Indicator
   ================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.warning {
    background: #F59E0B;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.offline {
    background: #EF4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

/* ================================
   Table Styles
   ================================ */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
}

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

.data-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ================================
   Progress Bar
   ================================ */
.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
}

/* ================================
   ApexCharts Customization
   ================================ */
.apexcharts-tooltip {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
}

.apexcharts-tooltip-title {
    background: rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    padding: 0.75rem 1rem !important;
}

.apexcharts-tooltip-text {
    color: #fff !important;
}

.apexcharts-xaxistooltip {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    color: #fff !important;
}

.apexcharts-xaxistooltip-text {
    color: #fff !important;
}

.apexcharts-yaxistooltip {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    color: #fff !important;
}

.apexcharts-menu {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
}

.apexcharts-menu-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* ================================
   Responsive Breakpoints
   ================================ */

/* Desktop XL (1920px) */
@media (min-width: 1920px) {
    .max-w-\\[1920px\\] {
        max-width: 1840px;
    }
}

/* Desktop (1366px - 1919px) */
@media (max-width: 1919px) {
    .glass-card {
        border-radius: 14px;
    }
}

/* Laptop (1024px - 1365px) */
@media (max-width: 1365px) {
    .glass-card {
        border-radius: 12px;
        padding: 1rem;
    }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .glass-card {
        border-radius: 10px;
    }

    header {
        padding: 0.75rem 1rem;
    }
}

/* Mobile Large (640px - 767px) */
@media (max-width: 767px) {
    .glass-card {
        border-radius: 8px;
        padding: 0.75rem;
    }

    .glass-card:hover {
        transform: none;
    }

    h2 {
        font-size: 1.25rem !important;
    }
}

/* Mobile (390px - 639px) */
@media (max-width: 639px) {
    .glass-card {
        border-radius: 8px;
        padding: 0.5rem;
    }

    .glass-card p-6 {
        padding: 1rem !important;
    }

    .glass-card p-5 {
        padding: 0.75rem !important;
    }

    /* Stack grid columns on mobile */
    .grid {
        gap: 0.75rem;
    }
}

/* Mobile Small (< 390px) */
@media (max-width: 389px) {
    .glass-card {
        border-radius: 6px;
    }
}

/* ================================
   Loading States
   ================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ================================
   Print Styles
   ================================ */
@media print {
    body {
        background: white;
        color: black;
    }

    .glass-card {
        background: white;
        border: 1px solid #e5e7eb;
        box-shadow: none;
    }

    .glass-card:hover {
        transform: none;
        box-shadow: none;
    }

    .fixed {
        position: relative !important;
    }

    header, footer {
        display: none;
    }
}

/* ================================
   Utility Classes
   ================================ */
.text-gradient {
    background: linear-gradient(135deg, #3B82F6, #06B6D4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.border-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.blur-backdrop {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Chart toggle buttons */
.chart-toggle {
    transition: all 0.2s ease;
}

.chart-toggle.active {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #3B82F6 !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Counter animation */
.counter {
    font-variant-numeric: tabular-nums;
}
