/* Modern Light Theme - Inspired by modern dashboards */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #c7d2fe;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --purple: #a855f7;
    --pink: #ec4899;
    --orange: #f97316;
    --teal: #14b8a6;
    --cyan: #06b6d4;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --sidebar-width: 260px;
    --bg-primary: var(--gray-100);
    --bg-secondary: white;
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
}

/* Nord Dark Theme */
body.dark-theme {
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-light: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --purple: #a855f7;
    --pink: #ec4899;
    --orange: #f97316;
    --teal: #14b8a6;
    --cyan: #06b6d4;
    --gray-50: #4c566a;
    --gray-100: #3b4252;
    --gray-200: #434c5e;
    --gray-300: #4c566a;
    --gray-400: #d8dee9;
    --gray-500: #e5e9f0;
    --gray-600: #eceff4;
    --gray-700: #eceff4;
    --gray-800: #eceff4;
    --gray-900: #eceff4;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --bg-primary: #2e3440;
    --bg-secondary: #3b4252;
    --text-primary: #eceff4;
    --text-secondary: #d8dee9;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 1018;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
}

.mobile-menu-toggle {
    width: 44px;
    height: 44px;
    background: var(--bg-primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-primary);
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-header-title {
    flex: 1;
    min-width: 0;
}

.mobile-header-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-header-title p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Action Toolbar */
.mobile-action-toolbar {
    display: none !important; /* Hidden on desktop regardless of .show class */
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 16px;
    z-index: 998; /* Below sidebar (1002) and header (1018) */
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.mobile-action-toolbar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Floating Action Button */
.fab {
    display: none !important; /* Hidden on desktop regardless of .show class */
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1015;
    opacity: 0;
    transform: scale(0);
}

@keyframes fabAppear {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.theme-toggle {
    width: 44px;
    height: 44px;
    background: var(--bg-primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--warning);
    transition: all 0.2s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

body.dark-theme .theme-toggle i:before {
    content: "\f185"; /* fa-sun */
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1002;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-item.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Colorful navigation icons */
.nav-item[data-page="scenes"] i {
    color: var(--purple);
}

.nav-item[data-page="radio"] i {
    color: var(--pink);
}

.nav-item[data-page="speakers"] i {
    color: var(--cyan);
}

.nav-item[data-page="settings"] i {
    color: var(--orange);
}

.nav-item[data-page="api-endpoints"] i {
    color: var(--teal);
}

/* Sidebar Now Playing */
.sidebar-now-playing {
    margin: 0 16px 16px 16px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    border-radius: 16px;
    position: relative;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.now-playing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    opacity: 0.9;
display: none;
}

.now-playing-content {
    margin-bottom: 12px;
}

.now-playing-title {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.now-playing-url {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-family: monospace;
    word-break: break-all;
    
}

#add-current-to-playlist {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 12px;
    padding: 8px;
    transition: all 0.2s;
}

#add-current-to-playlist:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#add-current-to-playlist i {
    font-size: 14px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
}

.desktop-theme-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
}

.desktop-theme-toggle span {
    font-size: 14px;
    font-weight: 500;
}

body.dark-theme .desktop-theme-toggle i:before {
    content: "\f185"; /* fa-sun */
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
    width: 100%;
    max-width: 100%;
    transition: margin-left 0.3s ease;
    overflow-x: hidden;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 13px;
    color: var(--gray-400);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary .fa-plus {
    margin: 0;
    font-size: 18px;
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-danger {
    padding: 12px 24px;
    background: var(--bg-secondary);
    color: var(--danger);
    border: 2px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-warning {
    padding: 6px 12px;
    background: var(--bg-secondary);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

.btn-success {
    padding: 8px 16px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success:hover {
    background: #059669;
}

/* Speakers Grid */
.speakers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 40px;
}

@media (min-width: 1400px) {
    .speakers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.speaker-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 20px;
    border: none;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.speaker-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.speaker-card.master {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
    background: var(--bg-secondary);
}

.speaker-card.speaker-offline {
    opacity: 0.6;
    background: var(--bg-secondary);
}

.speaker-card.speaker-offline [data-action="show-info"],
.speaker-card.speaker-offline [data-action="connect-to-master"] {
    display: none;
}

.speaker-card.speaker-offline:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transform: none;
}

.speaker-card.speaker-offline button:disabled,
.speaker-card.speaker-offline input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.speaker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.speaker-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.speaker-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.speaker-badges {
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.speaker-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.4;
}

.speaker-badge.online {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #16a34a;
    font-weight: 700;
}

.speaker-badge.offline {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    font-weight: 700;
}

.speaker-badge.master-badge {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: var(--primary);
    font-weight: 700;
}

.speaker-badge.slave-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    font-weight: 700;
}

/* Player Controls */
.player-controls {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.control-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    color: var(--text-secondary);
}

.control-btn:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.control-btn.primary {
    background: var(--primary);
    color: white;
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.control-btn.primary:hover {
    background: var(--primary-hover);
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--gray-50);
    border-radius: 12px;
}

.volume-control i {
    font-size: 14px;
    color: var(--gray-400);
}

.slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--gray-200);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

body.dark-theme .slider {
    background: var(--gray-300);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.15s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.volume-display {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 36px;
    text-align: right;
}

.speaker-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    overflow: visible;
}

.speaker-actions button {
    flex-shrink: 0;
    font-size: 11px;
    padding: 6px 10px;
}

/* Section Card */
.section-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow);
    margin-top: 32px;
}

.section-header {
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-box i {
    color: var(--gray-400);
    font-size: 16px;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
}

.search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Tabs */
.tab-bar {
    display: flex;
    gap: 8px;
    padding: 6px;
    background: var(--bg-secondary);
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

.tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-item:hover {
    background: var(--gray-50);
    color: var(--text-primary);
}

.tab-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Tab ordering: Loved, Favorites, other playlists, All Radios */
[data-endpoint-name="loved"] {
    order: -100;
}

[data-endpoint-name="favorites"] {
    order: -99;
}

.tab-item[data-category="random"] {
    order: 100;
}

/* Colorful tab icons */
[data-endpoint-name="loved"]:not(.active) i {
    color: var(--danger);
}

.tab-item[data-category="favorites"]:not(.active) i {
    color: var(--warning);
}

.tab-item[data-category="random"]:not(.active) i {
    color: var(--purple);
}

/* Active tabs have white icons */
.tab-item.active i {
    color: white;
}

/* Tab separator for playlists */
.tab-separator {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}

.tab-separator::before,
.tab-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.tab-separator span {
    padding: 0 12px;
}

/* Radio List */
.radio-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Compact Station Card */
.station-card-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.station-card-compact::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--purple) 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.station-card-compact:hover::before {
    opacity: 1;
}

.station-card-compact:hover {
    background: var(--bg-secondary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.station-info-compact {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.station-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    color: white;
    font-size: 18px;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.station-details {
    flex: 1;
    min-width: 0;
}

.station-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
   padding-right: 20px;
   line-height: 1.1;
   
}

.station-url {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Courier New', monospace;
    word-break: break-all;
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    max-width: calc(100% - 20px);

}

.station-actions-compact {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Icon Buttons - for compact station list */
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0 !important;
    min-width: unset !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-icon.btn-primary {
    background: linear-gradient(135deg, var(--success) 0%, var(--teal) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}

.btn-icon.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
    transform: translateY(-2px) scale(1.05);
}

.btn-icon.btn-secondary {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--info) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.btn-icon.btn-secondary:hover {
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
    transform: translateY(-2px) scale(1.05);
}

/* Remove from playlist button (gray/neutral) */
.btn-icon.btn-remove {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.btn-icon.btn-remove:hover {
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.5);
    transform: translateY(-2px) scale(1.05);
}

/* Delete permanently button (bright red) */
.btn-icon.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.btn-icon.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.6);
    transform: translateY(-2px) scale(1.05);
}

/* Old station card - keep for compatibility */
.station-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    transition: all 0.15s;
}

.station-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.station-info {
    flex: 1;
}

.station-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.station-info p {
    font-size: 12px;
    color: var(--gray-400);
}

.station-meta {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 3px;
}

.station-actions {
    display: flex;
    gap: 6px;
}

/* Scenes Grid */
.scenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.scene-card {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 28px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.scene-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.scene-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.scene-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.scene-details {
    font-size: 11px;
    color: var(--gray-400);
    margin-bottom: 14px;
}

.scene-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.scene-actions button {
    min-width: unset
}

/* Settings Grid */
.settings-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.settings-card {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 36px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    max-width:800px;
    width: 100%;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.settings-card-header i {
    font-size: 20px;
    color: var(--primary);
}

.settings-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label i {
    color: var(--primary);
    font-size: 16px;
}

.input,
select.input {
    padding: 14px 18px;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s;
    width: 100%;
    background: var(--bg-primary);
    font-family: inherit;
}

select.input {
    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 16 16'%3E%3Cpath fill='%23525252' d='M4.427 6.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 6H4.604a.25.25 0 00-.177.427z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.input:focus,
select.input:focus {
    outline: none;
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

.input:hover,
select.input:hover {
    background: var(--bg-secondary);
}

.input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Dark theme adjustments for selects */
body.dark-theme select.input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23eceff4' d='M4.427 6.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 6H4.604a.25.25 0 00-.177.427z'/%3E%3C/svg%3E");
}

/* Form groups */
.mb-4 {
    margin-bottom: 24px;
}

.mb-4:last-child {
    margin-bottom: 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    cursor: pointer;
}

.checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1020;
    padding: 20px;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.modal {
    background: var(--bg-secondary);
    border-radius: 28px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px 24px;
    border-bottom: 1px solid var(--gray-100);
    flex-shrink: 0;
}

.modal-content {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 12px 24px 20px 24px;
    border-top: 1px solid var(--gray-100);
    flex-shrink: 0;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-200);
    transform: scale(1.05);
}

.modal-body {
    margin-bottom: 32px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid var(--gray-100);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid var(--gray-400);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-400);
    background: var(--bg-secondary);
    border-radius: 24px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.4;
    color: var(--gray-300);
}

.empty-state p {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}


/* Responsive */
/* Tablet */
@media (max-width: 1024px) {
    .main-content {
        padding: 24px;
    }

    .speakers-grid {
        gap: 12px;
    }

    .scenes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Show mobile header */
    .mobile-header {
        display: flex;
    }

    /* Override desktop hiding - allow showing on mobile */
    .mobile-action-toolbar {
        display: none; /* Remove !important, allow .show to work */
    }

    .mobile-action-toolbar.show {
        display: flex !important;
    }

    /* Override desktop hiding - allow showing on mobile */
    .fab {
        display: none; /* Remove !important, allow .show to work */
    }

    .fab.show {
        display: flex !important;
        align-items: center;
        justify-content: center;
        animation: fabAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }

    .fab:hover {
        transform: scale(1.1);
        box-shadow: 0 8px 24px rgba(99, 102, 241, 0.6);
    }

    .fab:active {
        transform: scale(0.95);
    }

    /* Hide page header on mobile (info is in mobile header) */
    .page-header {
        display: none !important;
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    /* Show sidebar when open */
    .sidebar.open {
        transform: translateX(0);
    }

    /* Add padding to sidebar nav on mobile to avoid overlap with mobile header */
    .sidebar-nav {
        padding-top: 80px;
    }

    /* Now playing on mobile */
    .sidebar-now-playing {
        margin: 0 12px 12px 12px;
        padding: 12px;
    }

    .now-playing-title {
        font-size: 13px;
    }

    .now-playing-url {
        font-size: 10px;
    }

    /* Add overlay when sidebar is open */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    body.sidebar-open::before {
        opacity: 1;
        pointer-events: all;
    }

    .main-content {
        margin-left: 0;
        padding: 80px 16px 16px 16px;
    }

    /* Adjust padding when toolbar is visible */
    .main-content.with-toolbar {
        padding-top: 140px; /* 64px header + 60px toolbar + 16px margin */
    }

    /* Fix search box spacing when toolbar is visible on mobile */
    .with-toolbar .search-box {
        margin-top: 0;
        position: static;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .page-title {
        font-size: 24px;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .speakers-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .speaker-group {
        flex-direction: column;
    }

    .speaker-group .speaker-card {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .speaker-group .speaker-card:last-child {
        border-bottom: none;
    }

    .scenes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .scene-card {
        padding: 20px;
        border-radius: 20px;
    }

    .scene-card h3 {
        font-size: 13px;
    }

    .scene-details {
        font-size: 10px;
    }

    .scene-actions button {
        padding: 8px;
        font-size: 12px;
    }

    /* Scene editor mobile improvements */
    #page-scene-editor > div:first-child {
        margin-bottom: 16px;
    }

    #page-scene-editor .settings-card {
        margin-bottom: 16px;
    }

    #page-scene-editor .settings-content > div {
        grid-template-columns: 1fr !important;
    }

    #selected-icon-display {
        margin-top: 16px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .speaker-actions {
        flex-wrap: wrap;
    }

    /* Radio list improvements for mobile */
    .station-card-compact {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .station-info-compact {
        width: 100%;
    }

    .station-actions-compact {
        width: 100%;
        justify-content: flex-end;
    }

    /* Tabs */
    .tab-item {
        font-size: 13px;
        padding: 8px 12px;
    }

    .tab-item i {
        font-size: 16px;
    }

    /* Modal on mobile */
    .modal {
        max-width: 95%;
        margin: 0 auto;
    }

    /* Toast on mobile */
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        min-width: auto;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .main-content {
        padding: 80px 12px 12px 12px;
    }

    .main-content.with-toolbar {
        padding-top: 140px;
    }

    .scenes-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .scene-card {
        padding: 16px;
        border-radius: 16px;
    }

    .scene-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .scene-card h3 {
        font-size: 12px;
    }

    .scene-actions {
        gap: 4px;
    }

    .scene-actions button {
        padding: 6px;
        font-size: 11px;
    }

    /* Scene editor extra small mobile */
    #page-scene-editor {
        max-width: 100%;
    }

    #page-scene-editor .settings-card {
        padding: 16px;
        margin-bottom: 12px;
    }

    #page-scene-editor .settings-card-header h3 {
        font-size: 14px;
    }

    #page-scene-editor .btn-primary {
        font-size: 14px;
        padding: 10px 16px;
    }

    .station-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
    }
}

/* Speaker Groups */
.speaker-group {
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 0;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: none;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.speaker-group .speaker-card {
    flex: 1;
    border: none;
    border-right: 1px solid var(--gray-100);
    border-radius: 0;
    box-shadow: none;
}

.speaker-group .speaker-card:last-child {
    border-right: none;
}

.speaker-group .speaker-card:hover {
    border: none;
    box-shadow: none;
    background: var(--gray-50);
    transform: none;
}

/* Slave cards attached to master */
.slave-card {
    background: white !important;
    position: relative;
}

.slave-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 3px;
    background: var(--primary);
}

/* Offset control styles */
.offset-control {
    background: var(--gray-50);
    border-radius: 8px;
}

.offset-control .input {
    text-align: center;
}

/* noUiSlider custom styles */
#volume-range-slider {
    height: 8px;
}

#volume-range-slider .noUi-connect {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%);
}

#volume-range-slider .noUi-handle {
    height: 20px;
    width: 20px;
    top: -6px;
    right: -10px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

#volume-range-slider .noUi-handle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

#volume-range-slider .noUi-handle:active {
    transform: scale(1.2);
}

#volume-range-slider .noUi-handle::before,
#volume-range-slider .noUi-handle::after {
    display: none;
}

#volume-range-slider .noUi-tooltip {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    bottom: 130%;
    box-shadow: var(--shadow-md);
}

#volume-range-slider .noUi-base {
    background: var(--gray-200);
    border-radius: 4px;
}

body.dark-theme #volume-range-slider .noUi-base {
    background: var(--gray-300);
}

/* Speaker Info Modal Styles */
.info-section {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 12px;
}

.info-section h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.info-value.url {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 11px;
    background: var(--gray-100);
    padding: 6px 8px;
    border-radius: 4px;
    color: var(--primary);
    word-break: break-all;
    margin-top: 2px;
}

/* Icon Picker Grid */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    gap: 8px;
}

.icon-picker-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-size: 22px;
    color: var(--text-primary);
    transition: all 0.15s;
    position: relative;
}

.icon-picker-item:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.icon-picker-item.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.icon-picker-item.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    background: white;
    color: var(--primary);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Action Item */
/* Action Items - Optimized Design */
.action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
    position: relative;
}

.action-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.action-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--gray-100) 100%);
    border-radius: 10px;
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.action-content {
    flex: 1;
    min-width: 0;
}

.action-type {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

.action-params {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.param-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.param-url {
    margin-top: 4px;
}

.param-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.param-link {
    font-size: 11px;
    color: var(--primary);
    word-break: break-all;
}

.action-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-icon:hover {


    transform: scale(1.05);
}

.btn-icon.btn-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Action Type Grid (for modal) */
.action-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.action-type-card {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.action-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.action-type-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    transition: all 0.2s;
    min-height: 80px;
}

.action-type-card-content i {
    font-size: 24px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.action-type-card-content span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.action-type-card:hover .action-type-card-content {
    background: var(--bg-primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.action-type-card:hover .action-type-card-content i {
    color: var(--primary);
    transform: scale(1.1);
}

.action-type-card input[type="radio"]:checked + .action-type-card-content {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.action-type-card input[type="radio"]:checked + .action-type-card-content i,
.action-type-card input[type="radio"]:checked + .action-type-card-content span {
    color: white;
}

@media (max-width: 640px) {
    .action-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Params Section */
.params-section {
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-top: 16px;
}

/* Input Mode Grid */
.input-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.input-mode-option {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.input-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.input-mode-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    transition: all 0.2s;
}

.input-mode-content i {
    font-size: 24px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.input-mode-content span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-mode-option:hover .input-mode-content {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.input-mode-option:hover .input-mode-content i {
    color: var(--primary);
}

.input-mode-option input[type="radio"]:checked + .input-mode-content {
    background: var(--primary);
    border-color: var(--primary);
}

.input-mode-option input[type="radio"]:checked + .input-mode-content i,
.input-mode-option input[type="radio"]:checked + .input-mode-content span {
    color: white;
}

/* Volume Slider */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.1);
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.1);
}

.volume-number {
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-weight: 600;
    color: var(--primary);
}

/* Playlists */
.playlists-list {
    margin-top: 24px;
}

.playlists-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.playlist-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.playlist-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.playlist-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.playlist-icon i {
    font-size: 28px;
    color: white;
}

.playlist-info {
    flex: 1;
    min-width: 0;
}

.playlist-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.playlist-details {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.playlist-endpoint {
    font-family: 'Monaco', 'Courier New', monospace;
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
}

.playlist-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.playlist-actions button {
    min-width: unset;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Station checkbox items */
.station-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.station-checkbox-item:hover {
    background: var(--bg-secondary);
}

.station-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.station-checkbox-item span {
    font-size: 14px;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .playlists-grid {
        grid-template-columns: 1fr;
    }

    .playlist-card {
        flex-direction: column;
        text-align: center;
    }

    .playlist-info {
        text-align: center;
    }

    .playlist-actions {
        width: 100%;
        justify-content: center;
    }
}

.action-actions {
    display: flex;
    gap: 6px;
}


.station-checkbox-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Playlist Manager */
.playlist-manager-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.playlist-manager-item:hover {
    background: var(--gray-100);
}

/* API Endpoints Page */
.endpoints-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.endpoints-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.endpoints-header code {
    font-family: 'Monaco', 'Courier New', monospace;
    background: var(--bg-primary);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    position: relative;
    width: 52px;
    height: 28px;
    appearance: none;
    background: var(--gray-300);
    border-radius: 14px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-switch input[type="checkbox"]:checked {
    background: var(--primary);
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    background: white;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"]:checked::before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Endpoint Categories */
.endpoint-category {

    margin-bottom: 20px;
}

.endpoint-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}

.endpoint-category-header i {
    font-size: 20px;
    color: var(--primary);
}

.endpoint-category-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.endpoint-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 12px;
}

.endpoint-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Endpoint Cards */
.endpoint-card {
    transition: all 0.2s ease;
}

.endpoint-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.endpoint-info {
    flex: 1;
    min-width: 0;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.endpoint-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--success) 0%, var(--teal) 100%);
    color: white;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    min-width: 45px;
}

.endpoint-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.endpoint-url {
    margin-bottom: 8px;
}

.endpoint-url code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: var(--primary);
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-block;
    word-break: break-all;
}

.endpoint-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* Copy Button for Endpoints */
.endpoint-card .copy-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.endpoint-card .copy-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.endpoint-card .copy-btn:active {
    transform: scale(0.95);
}

/* Responsive Endpoints */
@media (max-width: 768px) {
    .endpoint-card {
        flex-direction: column;
        align-items: stretch;
    }

    .endpoint-card .copy-btn {
        width: 100%;
        margin-top: 8px;
    }

    .endpoints-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* Endpoints page - Modern Design */
.copy-btn:hover {
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.copy-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* Card hover effect */
[style*="background: white"][style*="border-radius: 12px"]:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06) !important;
}

/* Dark theme support for endpoints */
.dark-theme [style*="background: white"] {
    background: var(--card-bg) !important;
}

.dark-theme [style*="color: #1a1a1a"] {
    color: var(--text-primary) !important;
}

.dark-theme [style*="color: #6b7280"] {
    color: var(--text-secondary) !important;
}

.dark-theme [style*="color: #4b5563"] {
    color: var(--text-secondary) !important;
}

.dark-theme [style*="background: #f9fafb"] {
    background: var(--bg-secondary) !important;
}

.dark-theme .copy-btn {
    background: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
}

.dark-theme .copy-btn:hover {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-hover) !important;
    color: var(--text-primary) !important;
}

/* Endpoint Cards - Scene-like style */
.endpoint-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-4px) !important;
}

.endpoint-card .copy-btn[style*="background: var(--success)"]:hover {
    background: #059669 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.endpoint-card .copy-btn[style*="background: var(--info)"]:hover {
    background: #0284c7 !important;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
    transform: translateY(-1px);
}

.endpoint-card .copy-btn:active {
    transform: translateY(0) !important;
}

@media (max-width: 768px) {
    .endpoints-grid {
        grid-template-columns: 1fr !important;
    }
}
