/* ============================================
   RADIO CONTROL PANEL - MAIN STYLESHEET
   Modern Dark Theme with Glassmorphism
   ============================================ */

/* ============================================
   CSS VARIABLES & THEME
   ============================================ */
:root {
    /* Primary Colors */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* Accent Colors */
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-violet: #8b5cf6;

    /* Neutral Colors (Dark Theme) */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: rgba(26, 26, 46, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    /* Border Colors */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.05);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-dark: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 70px;
    --player-height: 80px;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   ANIMATED BACKGROUND EFFECTS
   ============================================ */
.bg-animated {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Mesh Gradient Background */
.bg-mesh {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 80% 60%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 90%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    animation: meshMove 30s ease-in-out infinite;
}

@keyframes meshMove {

    0%,
    100% {
        filter: hue-rotate(0deg);
        opacity: 1;
    }

    50% {
        filter: hue-rotate(20deg);
        opacity: 0.8;
    }
}

/* Floating Orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 12s ease-in-out infinite;
    pointer-events: none;
}

.bg-orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(139, 92, 246, 0.2);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(236, 72, 153, 0.15);
    bottom: -50px;
    left: -50px;
    animation-delay: 3s;
}

.bg-orb-3 {
    width: 200px;
    height: 200px;
    background: rgba(6, 182, 212, 0.12);
    top: 50%;
    left: 30%;
    animation-delay: 6s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }

    50% {
        transform: translateY(-40px) scale(1.05);
        opacity: 1;
    }
}

/* Particles Canvas */
#bgParticles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundPulse 20s ease-in-out infinite;
}

@keyframes backgroundPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

a {
    color: var(--primary-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-300);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   LAYOUT
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    transition: margin-left var(--transition-normal);
}

.main-content.sidebar-collapsed {
    margin-left: 80px;
}

.content-wrapper {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
    transition: left var(--transition-normal);
}

.header.sidebar-collapsed {
    left: 80px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-search {
    position: relative;
}

.header-search input {
    width: 300px;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: var(--shadow-glow);
}

.header-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-notifications {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: var(--accent-rose);
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast);
}

.header-user:hover {
    background: var(--bg-glass);
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: width var(--transition-normal);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar.collapsed .sidebar-logo-text {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.sidebar.collapsed .sidebar-section-title {
    display: none;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu-item {
    margin: 2px 0.5rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.sidebar-menu-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.sidebar-menu-link.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.sidebar-menu-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-menu-text {
    display: none;
}

.sidebar-menu-badge {
    background: var(--accent-rose);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-station-selector {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #1a1a2e !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: #f8fafc !important;
    font-size: 0.875rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.sidebar-station-selector option {
    background-color: #1a1a2e !important;
    color: #f8fafc !important;
    padding: 10px;
}

/* Sidebar station selector wrapper - hanya tampil di mobile */
.sidebar-station-selector-wrapper {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-station-selector-wrapper.mobile-only {
    display: none;
}

@media (max-width: 1023px) {
    .sidebar-station-selector-wrapper.mobile-only {
        display: block;
    }
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-500);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-glass);
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    opacity: 0.1;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-card-icon.primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-400);
}

.stat-card-icon.cyan {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.stat-card-icon.emerald {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
}

.stat-card-icon.amber {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-amber);
}

.stat-card-icon.rose {
    background: rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.stat-card-trend.up {
    color: var(--accent-emerald);
}

.stat-card-trend.down {
    color: var(--accent-rose);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--primary-500);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--accent-rose);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-success {
    background: var(--accent-emerald);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg,
.btn-icon i {
    width: 22px;
    height: 22px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--accent-rose);
}

.form-error {
    color: var(--accent-rose);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check-input {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    appearance: none;
    background: var(--bg-glass);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.form-check-input:hover {
    border-color: var(--primary-400);
}

.form-check-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-check-input:checked {
    background: var(--primary-500);
    border-color: var(--primary-500);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.form-check-input[type="radio"] {
    border-radius: var(--radius-full);
}

.form-check-input[type="radio"]:checked {
    background-image: none;
    box-shadow: inset 0 0 0 4px var(--bg-primary);
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle input:checked+.toggle-slider {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* Input Group */
.input-group {
    display: flex;
}

.input-group .form-control {
    border-radius: 0;
}

.input-group .form-control:first-child {
    border-top-left-radius: var(--radius-lg);
    border-bottom-left-radius: var(--radius-lg);
}

.input-group .form-control:last-child {
    border-top-right-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   TABLES
   ============================================ */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-glass);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-glass);
}

.table-striped tbody tr:nth-child(even) {
    background: var(--bg-glass);
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: 0.875rem;
    color: inherit;
    opacity: 0.9;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
}

.alert-error {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--accent-rose);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-amber);
}

.alert-info {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--accent-cyan);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    min-width: 300px;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-400);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-amber);
}

.badge-danger {
    background: rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
}

.badge-info {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.status-dot.online {
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--text-muted);
}

.status-dot.streaming {
    background: var(--accent-rose);
    box-shadow: 0 0 8px var(--accent-rose);
}

.status-dot.live {
    background: var(--accent-rose);
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============================================
   MODALS
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    z-index: 501;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    font-size: 0.875rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item svg,
.dropdown-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dropdown-item:hover {
    background: var(--bg-glass);
    color: var(--primary-400);
}

.dropdown-item.text-danger,
.dropdown-item.text-danger:hover {
    color: var(--accent-rose) !important;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Larger dropdown trigger button */
.btn-icon.btn-sm,
.dropdown>button.btn-sm,
.dropdown>.btn.btn-icon {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-icon.btn-sm svg,
.btn-icon.btn-sm i,
.dropdown>button svg,
.dropdown>button i,
[data-feather="more-vertical"] {
    width: 22px !important;
    height: 22px !important;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    border: none;
    background: none;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary-400);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-bar.animated {
    animation: progressStripes 1s linear infinite;
    background-image: linear-gradient(45deg,
            rgba(255, 255, 255, 0.15) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.15) 75%,
            transparent 75%,
            transparent);
    background-size: 1rem 1rem;
}

@keyframes progressStripes {
    from {
        background-position: 1rem 0;
    }

    to {
        background-position: 0 0;
    }
}

/* ============================================
   TOOLTIPS
   ============================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* ============================================
   AVATAR
   ============================================ */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.25rem;
}

.avatar-xl {
    width: 96px;
    height: 96px;
    font-size: 2rem;
}

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    border: 2px solid var(--bg-primary);
    margin-left: -10px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ============================================
   GRID SYSTEM
   ============================================ */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--accent-emerald);
}

.text-danger {
    color: var(--accent-rose);
}

.text-warning {
    color: var(--accent-amber);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.rounded {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

.rounded-full {
    border-radius: var(--radius-full);
}

.shadow {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.cursor-pointer {
    cursor: pointer;
}

.select-none {
    user-select: none;
}

.hidden {
    display: none;
}

.invisible {
    visibility: hidden;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(-5%);
    }

    50% {
        transform: translateY(0);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-600);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-500);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        left: 0;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }

    .header {
        padding: 0 1rem;
    }

    .header-search {
        display: none;
    }
}

/* ============================================
   LOGIN / AUTH PAGES
   ============================================ */
.auth-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-primary);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.auth-logo-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-social {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-social .btn {
    flex: 1;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-500);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-glass) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

/* ============================================
   MOBILE MENU OVERLAY
   ============================================ */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: var(--bg-glass);
}

.mobile-menu-toggle .bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all var(--transition-normal);
    border-radius: 2px;
}

.mobile-menu-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.show {
        transform: translateX(0);
    }
}

/* ============================================
   PREMIUM FORM ENHANCEMENTS
   ============================================ */

/* Floating Labels */
.form-floating {
    position: relative;
}

.form-floating .form-control {
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.form-floating .form-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    pointer-events: none;
    margin: 0;
    font-size: 0.875rem;
}

.form-floating .form-control:focus~.form-label,
.form-floating .form-control:not(:placeholder-shown)~.form-label {
    top: 0.75rem;
    font-size: 0.75rem;
    color: var(--primary-400);
}

/* Enhanced File Upload */
.file-upload {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-glass);
}

.file-upload:hover {
    border-color: var(--primary-500);
    background: rgba(99, 102, 241, 0.1);
}

.file-upload.dragover {
    border-color: var(--primary-400);
    background: rgba(99, 102, 241, 0.15);
    transform: scale(1.02);
}

.file-upload-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.file-upload-text {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.file-upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Range Slider */
.range-slider {
    width: 100%;
}

.range-slider input[type="range"] {
    width: 100%;
    height: 6px;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.range-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-glow);
}

.range-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Color Picker */
.color-picker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-picker input[type="color"] {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    overflow: hidden;
    background: transparent;
}

.color-picker input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-md);
}

/* Search Input with Icon */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .form-control {
    padding-left: 3rem;
    padding-right: 2.5rem;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrapper .clear-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: all var(--transition-fast);
}

.search-input-wrapper .form-control:not(:placeholder-shown)+.clear-btn {
    opacity: 1;
}

.search-input-wrapper .clear-btn:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

/* Tags Input */
.tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    min-height: 50px;
}

.tags-input:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary-500);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius-full);
    animation: tagPop 0.2s ease;
}

@keyframes tagPop {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.tag-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.tag-remove:hover {
    opacity: 1;
}

.tags-input input {
    flex: 1;
    min-width: 120px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
}

/* ============================================
   PREMIUM CARD VARIANTS
   ============================================ */
.card-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-gradient {
    background: var(--gradient-glass);
    position: relative;
    overflow: hidden;
}

.card-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--primary-500), transparent 30%);
    animation: gradientRotate 8s linear infinite;
    opacity: 0.3;
}

@keyframes gradientRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.card-hover-lift {
    transition: all var(--transition-normal);
}

.card-hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
}

.card-glow {
    position: relative;
}

.card-glow::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-violet), var(--accent-cyan));
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-normal);
    filter: blur(8px);
}

.card-glow:hover::after {
    opacity: 0.6;
}

/* ============================================
   ANIMATED BUTTONS
   ============================================ */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
}

.btn-glow:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    pointer-events: none;
}

.btn-ripple:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-shine:hover::before {
    left: 100%;
}

/* ============================================
   PLAYER ENHANCEMENTS
   ============================================ */
.audio-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
}

.visualizer-bar {
    width: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    animation: visualizerPulse 0.8s ease-in-out infinite;
}

.visualizer-bar:nth-child(1) {
    animation-delay: 0s;
    height: 60%;
}

.visualizer-bar:nth-child(2) {
    animation-delay: 0.1s;
    height: 80%;
}

.visualizer-bar:nth-child(3) {
    animation-delay: 0.2s;
    height: 100%;
}

.visualizer-bar:nth-child(4) {
    animation-delay: 0.3s;
    height: 70%;
}

.visualizer-bar:nth-child(5) {
    animation-delay: 0.4s;
    height: 50%;
}

@keyframes visualizerPulse {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0.4);
    }
}

.now-playing-marquee {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.now-playing-marquee span {
    display: inline-block;
    padding-right: 50px;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* ============================================
   NOTIFICATION ENHANCEMENTS
   ============================================ */
.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.notification-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
}

.notification-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-amber);
}

.notification-icon.error {
    background: rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
}

.notification-icon.info {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

/* ============================================
   DATA TABLE ENHANCEMENTS
   ============================================ */
.table-sortable th {
    cursor: pointer;
    user-select: none;
}

.table-sortable th:hover {
    background: var(--bg-tertiary);
}

.table-sortable .sort-icon {
    margin-left: 0.5rem;
    opacity: 0.5;
    transition: all var(--transition-fast);
}

.table-sortable th:hover .sort-icon {
    opacity: 1;
}

.table-expandable tr.expanded {
    background: var(--bg-glass);
}

.table-expandable .expand-row {
    display: none;
    background: var(--bg-tertiary);
}

.table-expandable .expand-row.show {
    display: table-row;
}

/* ============================================
   MEDIA GALLERY ENHANCEMENTS
   ============================================ */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.media-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.media-item:hover .media-item-overlay {
    opacity: 1;
}

.media-item-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.media-item:hover .media-item-actions {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   TIMELINE / SCHEDULE ENHANCEMENTS
   ============================================ */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    background: var(--primary-500);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 6px var(--primary-500);
}

.timeline-item.active::before {
    animation: timelinePulse 2s infinite;
}

@keyframes timelinePulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 6px var(--primary-500);
    }

    50% {
        box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 12px rgba(99, 102, 241, 0.3);
    }
}

/* ============================================
   PRICING CARDS
   ============================================ */
.pricing-card {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    transition: all var(--transition-normal);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.pricing-card.featured {
    background: var(--gradient-primary);
    border: none;
    transform: scale(1.05);
}

.pricing-card.featured:hover {
    transform: scale(1.08) translateY(-4px);
}

.pricing-badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.pricing-amount {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.pricing-period {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: 2rem;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.pricing-features li:last-child {
    border-bottom: none;
}

/* ============================================
   ADDITIONAL MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .stat-card-value {
        font-size: 1.5rem;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .modal {
        width: 95%;
        max-height: 85vh;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .pricing-amount {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 0.75rem;
    }

    .header {
        padding: 0 0.75rem;
    }

    .flex.gap-4 {
        gap: 0.5rem;
    }

    .grid.gap-4 {
        gap: 0.75rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .card:hover {
        transform: none;
        box-shadow: none;
    }

    .btn-primary:hover {
        transform: none;
    }

    .media-item:hover {
        transform: none;
    }

    .media-item-overlay {
        opacity: 1;
    }

    .media-item-actions {
        opacity: 1;
        transform: none;
    }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .card {
        border-width: 0.5px;
    }
}

/* Dark Mode Print */
@media print {
    body {
        background: white;
        color: black;
    }

    .sidebar,
    .header,
    .btn {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   AUTH PAGES (Login, Register, etc.)
   ============================================ */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    padding: 2rem;
}

.auth-card {
    background: var(--gradient-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: 3rem;
    width: 100%;
    max-width: 540px;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(99, 102, 241, 0.1);
    animation: authSlideUp 0.5s ease-out;
}

@keyframes authSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.auth-logo-icon svg,
.auth-logo-icon i {
    width: 36px;
    height: 36px;
    color: white;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 0 50px rgba(99, 102, 241, 0.6);
    }
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-card .form-group {
    margin-bottom: 1.25rem;
}

.auth-card .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-card .form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.auth-card .form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.auth-card .form-control::placeholder {
    color: var(--text-muted);
}

.auth-card .btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    margin-top: 0.5rem;
}

.auth-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--border-color);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-social {
    display: flex;
    gap: 1rem;
}

.auth-social .btn {
    flex: 1;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary-400);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   FULLWIDTH FORM IMPROVEMENTS
   ============================================ */
/* Make all form controls full width by default */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="file"],
input[type="color"],
select,
textarea {
    width: 100%;
    display: block;
}

/* Card body forms fullwidth */
.card-body .form-group {
    width: 100%;
}

.card-body .form-control {
    width: 100%;
}

/* Grid form layouts */
.form-row {
    display: grid;
    gap: 1rem;
    width: 100%;
}

.form-row.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-row.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {

    .form-row.grid-2,
    .form-row.grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ENHANCED FORM STYLES
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled,
.form-control[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

input[type="color"].form-control {
    padding: 0.25rem;
    height: 45px;
    cursor: pointer;
}

.form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Form Check (Checkbox/Radio) */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-500);
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* Input Group */
.input-group {
    display: flex;
    width: 100%;
}

.input-group .form-control {
    flex: 1;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   AUTH PAGE RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
        border-radius: var(--radius-xl);
    }

    .auth-logo-icon {
        width: 64px;
        height: 64px;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-social {
        flex-direction: column;
    }
}

/* Hide sidebar on auth pages */
body.auth-page .sidebar,
body.auth-page .header,
.auth-container~.sidebar,
.auth-container~.header {
    display: none !important;
}

body.auth-page .main-content,
body.auth-page .app-container {
    margin-left: 0 !important;
    padding: 0 !important;
}

body.auth-page {
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}

/* ============================================
   RTMP STREAM EDIT RESPONSIVE
   ============================================ */
@media (max-width: 768px) {

    /* Overlay tabs scrollable on mobile */
    .overlay-tab-content .grid-3,
    .overlay-tab-content .grid-4 {
        grid-template-columns: 1fr !important;
    }

    /* Make color input full width */
    input[type="color"].form-control {
        width: 100%;
    }

    /* Range slider better spacing */
    input[type="range"].form-control {
        margin: 8px 0;
    }

    /* Flex buttons stack on mobile */
    .flex.gap-2 {
        flex-wrap: wrap;
    }

    /* Card in grid span full */
    .card[style*="grid-column"] {
        grid-column: span 1 !important;
    }

    /* Better spacing for form groups */
    .form-group {
        margin-bottom: 1rem;
    }

    /* Tabs scrollable */
    .tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .tabs .tab {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {

    /* Extra small screens */
    .overlay-tab-content .p-4 {
        padding: 1rem !important;
    }

    .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* Stack button and text */
    .flex.gap-2 .text-muted {
        display: none;
    }
}

/* ============================================
   RTMP STREAM EDIT - FULL RESPONSIVE
   ============================================ */

/* Card body grid responsive */
@media (max-width: 991px) {
    .card-body .grid-3 {
        grid-template-columns: 1fr !important;
    }

    .card-body .grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {

    /* All grids in card-body become single column */
    .card-body .grid-2,
    .card-body .grid-3,
    .card-body .grid-4 {
        grid-template-columns: 1fr !important;
    }

    /* Form controls full width */
    .card-body .form-control,
    .card-body select,
    .card-body input[type="text"],
    .card-body input[type="password"],
    .card-body input[type="url"],
    .card-body input[type="number"],
    .card-body input[type="color"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Flex containers wrap */
    .card-body .flex {
        flex-wrap: wrap;
    }

    .card-body .flex.gap-2 {
        gap: 0.5rem;
    }

    /* Input with button flex */
    .card-body .flex.gap-2 .form-control {
        flex: 1;
        min-width: 0;
    }

    /* Radio/checkbox cards stack */
    .card-body .form-check.p-4 {
        padding: 1rem !important;
    }

    /* Source type radio buttons */
    .card-body label.form-check.p-4 {
        display: flex;
        align-items: flex-start;
    }

    .card-body label.form-check.p-4 .ml-2 {
        margin-left: 0.75rem;
    }

    /* Card padding reduce */
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    /* Gap adjustments */
    .gap-4 {
        gap: 1rem !important;
    }

    .gap-6 {
        gap: 1rem !important;
    }

    /* Margin adjustments */
    .mb-6 {
        margin-bottom: 1rem !important;
    }

    .mb-4 {
        margin-bottom: 0.75rem !important;
    }
}

@media (max-width: 480px) {

    /* Extra small - even tighter */
    .card-body {
        padding: 0.75rem;
    }

    .card-header {
        padding: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .card-header .card-title {
        font-size: 1rem;
    }

    .form-label {
        font-size: 0.8rem;
    }

    .form-control {
        font-size: 0.9rem;
        padding: 0.625rem 0.75rem;
    }

    .form-hint {
        font-size: 0.7rem;
    }

    /* Buttons smaller */
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .btn-icon {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }

    /* Badge inline */
    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-xl);
}

.modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-glass);
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 0;
    padding: 0 1.5rem;
    padding-top: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.modal-tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-tab:hover {
    color: var(--text-primary);
}

.modal-tab.active {
    color: var(--primary-400);
    border-bottom-color: var(--primary-400);
}

/* Tab Panes */
.tab-pane {
    display: block;
}

.tab-pane.hidden {
    display: none;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-glass);
}

.upload-area:hover {
    border-color: var(--primary-400);
    background: rgba(99, 102, 241, 0.1);
}

.upload-area i {
    color: var(--primary-400);
    margin-bottom: 0.5rem;
}

.upload-area p {
    margin: 0;
}

.upload-area p:first-of-type {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.upload-area p:last-of-type {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   DROPDOWN MENU
   ============================================ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 150px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-glass);
    color: var(--primary-400);
}

.dropdown-item i {
    width: 16px;
    height: 16px;
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    border-top: 1px solid var(--border-color);
}