@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --background: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --surface-hover: rgba(51, 65, 85, 0.8);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15) 0%, transparent 25%);
    min-height: 100vh;
    color: var(--text-main);
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-hover);
    border-radius: 4px;
}

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

/* Navbar */
.navbar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #818cf8 0%, #e879f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    color: #818cf8;
    /* Fallback */
    -webkit-text-fill-color: #818cf8;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 600;
    letter-spacing: -0.025em;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-dark {
    color: var(--text-main) !important;
}

/* Cards */
.card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 0 15px var(--primary-glow);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Remove bootstrap bg specifics if they interfere */
.card-header {
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid var(--border);
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s;
}

.btn-primary-gradient,
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary-gradient:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    color: white;
}

.btn-outline-light {
    border-color: var(--border);
    color: var(--text-muted);
}

.btn-outline-light:hover {
    background: var(--surface-hover);
    color: var(--text-main);
    border-color: var(--text-main);
}

/* Status Badges */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-offline {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-recording {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: pulse-red 2s infinite;
}

.status-uploading {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.status-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Metric Cards (Device Details) */
.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s;
}

.metric-card:hover {
    transform: translateY(-5px);
    background: var(--surface-hover);
}

.metric-card .icon-circle {
    width: 56px !important;
    height: 56px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    border: 1px solid var(--border);
}

.metric-card .icon-circle i {
    font-size: 1.5rem;
}

/* Specific icon colors */
.metric-card .text-primary {
    color: #818cf8 !important;
}

.metric-card .text-success {
    color: #34d399 !important;
}

.metric-card .text-warning {
    color: #fbbf24 !important;
}

.metric-card .text-info {
    color: #22d3ee !important;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Tables */
.table {
    color: var(--text-muted);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-muted);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
}

.table thead th {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr td {
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

/* List Groups (Schedule) */
.list-group {
    background: transparent;
}

.list-group-item {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.list-group-item:hover {
    background: var(--surface-hover);
}

/* Utility Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown Menu */
.dropdown-menu {
    background-color: #1e293b;
    border: 1px solid var(--border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.dropdown-item {
    color: var(--text-muted);
}

.dropdown-item:hover {
    background-color: var(--primary);
    color: white;
}