/**
 * mHosting RadioPanel - Admin-Oberfläche
 * Modern Radio SaaS | m-hosting.eu
 */

:root {
    --sidebar-width: 268px;
    --header-height: 68px;
    --primary: #7c6cff;
    --primary-hover: #6358f0;
    --primary-soft: rgba(124, 108, 255, 0.14);
    --accent: #22d3ee;
    --live: #22c55e;
    --glass-bg: rgba(16, 18, 32, 0.72);
    --glass-border: rgba(255, 255, 255, 0.07);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    --radius: 16px;
    --transition: 0.2s ease;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #0b0d16;
    --bs-body-color: #f4f6ff;
    --bs-secondary-color: #9aa3bf;
    --bs-border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="light"] {
    --glass-bg: rgba(255, 255, 255, 0.86);
    --glass-border: rgba(15, 23, 42, 0.08);
    --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
    --bs-body-bg: #eef2f7;
    --bs-body-color: #0f172a;
    --bs-secondary-color: #64748b;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(1200px 600px at -10% -20%, rgba(124, 108, 255, 0.18), transparent 50%),
        radial-gradient(900px 500px at 110% 0%, rgba(34, 211, 238, 0.1), transparent 45%),
        var(--bs-body-bg);
    color: var(--bs-body-color);
    margin: 0;
    overflow-x: hidden;
}

::selection { background: rgba(124, 108, 255, 0.35); }

.app-wrapper { display: flex; min-height: 100vh; }

.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(18, 20, 34, 0.96), rgba(12, 14, 24, 0.98));
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
}

[data-bs-theme="light"] .app-sidebar {
    background: linear-gradient(180deg, #ffffff, #f7f8fc);
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    min-height: var(--header-height);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--glass-border);
    background: color-mix(in srgb, var(--glass-bg) 88%, transparent);
    backdrop-filter: blur(22px);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-content { padding: 1.5rem; flex: 1; }

.app-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 16, 0.55);
    z-index: 1035;
}

.sidebar-brand {
    padding: 1.2rem 1.25rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid var(--glass-border);
}

.brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), #22d3ee);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 8px 20px rgba(124, 108, 255, 0.35);
}

.brand-name { font-weight: 700; font-size: 1.02rem; display: block; line-height: 1.2; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.72rem; color: var(--bs-secondary-color); letter-spacing: 0.08em; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 0.85rem 0.75rem 1rem; overflow-y: auto; }

.nav-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    padding: 0.85rem 1rem 0.35rem;
    opacity: 0.8;
}

.sidebar-nav .nav-link {
    color: var(--bs-secondary-color);
    padding: 0.62rem 0.95rem;
    border-radius: 10px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.sidebar-nav .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--primary-soft); color: var(--primary); }

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(124, 108, 255, 0.22), rgba(34, 211, 238, 0.1));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(124, 108, 255, 0.2);
}

[data-bs-theme="light"] .sidebar-nav .nav-link.active { color: var(--primary); }

.sidebar-footer { padding: 1rem 1.25rem 1.15rem; border-top: 1px solid var(--glass-border); }
.sidebar-footer a { text-decoration: none; }

.header-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.page-title { font-size: 1.2rem; font-weight: 700; margin: 0; letter-spacing: -0.03em; }
.header-right { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.header-page-action .btn { white-space: nowrap; }

.header-live {
    display: none;
    align-items: center;
    gap: 0.55rem;
    max-width: 360px;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.22);
    font-size: 0.78rem;
    min-width: 0;
}

.header-live.is-visible { display: flex; }
.header-live.is-offline {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.22);
}

.header-live-song {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.header-live-listeners { color: var(--bs-secondary-color); white-space: nowrap; }

.live-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: livePulse 1.6s infinite;
    flex-shrink: 0;
}

.header-live.is-offline .live-pulse {
    background: #94a3b8;
    animation: none;
    box-shadow: none;
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@media (max-width: 575.98px) {
    .header-page-action .btn span { display: none; }
    .header-live { display: none !important; }
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--bs-body-color);
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
}

.btn-ghost:hover { background: var(--primary-soft); color: var(--primary); }
.user-menu { display: flex; align-items: center; gap: 0.5rem; }

.dropdown-menu {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 0.4rem;
}

.dropdown-menu form { margin: 0; }
.dropdown-menu .dropdown-item { width: 100%; text-align: left; }

.glass-card,
.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.glass-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.25rem;
}

.glass-card .card-header h5 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-card { transition: transform var(--transition), box-shadow var(--transition); }
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 40px rgba(124, 108, 255, 0.12);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 108, 255, 0.2), rgba(34, 211, 238, 0.12));
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.85rem;
}

.stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.stat-label { font-size: 0.8rem; color: var(--bs-secondary-color); margin-top: 0.3rem; font-weight: 500; }

.onair-hero {
    background:
        linear-gradient(135deg, rgba(124, 108, 255, 0.16), rgba(34, 211, 238, 0.06)),
        var(--glass-bg);
}

.onair-avatar-wrap { position: relative; flex-shrink: 0; }

.onair-avatar {
    width: 88px; height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.status-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bs-body-bg);
    position: absolute;
    bottom: 4px; right: 4px;
}

.status-live, .status-live-badge { background: #22c55e; }
.status-autodj, .status-autodj-badge { background: #38bdf8; }
.status-offline, .status-offline-badge { background: #6b7280; }

.status-live-badge, .status-autodj-badge, .status-offline-badge {
    color: #fff !important;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
}

.song-title { font-size: 0.9rem; color: var(--bs-secondary-color); }

.stream-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.stream-meta-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
}

[data-bs-theme="light"] .stream-meta-box { background: #f8fafc; }
.stream-meta-box small { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; }

.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18); }

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(900px 500px at 10% 10%, rgba(124, 108, 255, 0.28), transparent 50%),
        linear-gradient(135deg, #090b14 0%, #12152a 50%, #0d1b2a 100%);
}

[data-bs-theme="light"] .auth-page {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.auth-container { width: 100%; max-width: 420px; padding: 1rem; }
.auth-card { padding: 2.1rem; border-radius: 20px; }

.brand-icon-lg {
    width: 68px; height: 68px;
    background: linear-gradient(135deg, var(--primary), #22d3ee);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 12px 28px rgba(124, 108, 255, 0.35);
}

.show-banner { height: 150px; object-fit: cover; }
.show-banner-placeholder {
    height: 150px;
    background: linear-gradient(135deg, var(--primary), #22d3ee);
    opacity: 0.55;
}

.show-card, .moderator-card { transition: transform var(--transition); }
.show-card:hover, .moderator-card:hover { transform: translateY(-3px); }

.schedule-grid { display: grid; gap: 0.75rem; }

.schedule-item {
    padding: 1rem 1.25rem;
    background: rgba(124, 108, 255, 0.07);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: grab;
    transition: all var(--transition);
    border-left: 4px solid var(--primary);
}

.schedule-item:hover { background: rgba(124, 108, 255, 0.13); transform: translateX(4px); }
.schedule-item.dragging { opacity: 0.5; }
.schedule-item-time { font-size: 0.8125rem; color: var(--primary); font-weight: 700; }
.schedule-item-title { font-weight: 700; margin: 0.25rem 0; }
.schedule-item-mod { font-size: 0.8125rem; color: var(--bs-secondary-color); }

.schedule-time {
    background: linear-gradient(135deg, var(--primary), #22d3ee);
    color: #fff;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    min-width: 54px;
    text-align: center;
}

.btn { border-radius: 10px; font-weight: 600; }
.btn-sm { border-radius: 8px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #5b8cff);
    border: none;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-hover), #4f74f0);
}

.form-label { font-weight: 600; font-size: 0.85rem; }

.form-control, .form-select {
    border-radius: 10px;
    border-color: var(--glass-border);
    background: var(--glass-bg);
    min-height: 42px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 108, 255, 0.16);
}

.input-group-text {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    color: var(--bs-secondary-color);
}

.alert { border-radius: 12px; border: none; }

.table { --bs-table-bg: transparent; }
.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color);
    border-bottom-width: 1px;
    font-weight: 700;
}

.table-hover > tbody > tr:hover > * { background: rgba(124, 108, 255, 0.06); }
.list-group-item { background: transparent; border-color: var(--glass-border); }

.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.6rem;
}
.empty-state h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.35rem; }
.empty-state p { color: var(--bs-secondary-color); margin-bottom: 1.1rem; }

.widget-preview-wrap {
    background: linear-gradient(145deg, #2a2a3a, #1a1a28);
    border-radius: 0 0 12px 12px;
    padding: 12px;
    min-height: 0;
    overflow: hidden;
}

.widget-preview-frame {
    display: block;
    border: none;
    background: transparent;
    width: 280px;
    min-height: 320px;
    height: 320px;
    overflow: hidden;
    vertical-align: top;
    pointer-events: auto;
}

.embed-code { background: rgba(0, 0, 0, 0.18); }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .sidebar-overlay.is-visible { display: block; }
}

@media (max-width: 575.98px) {
    .app-content { padding: 1rem; }
    .onair-avatar { width: 64px; height: 64px; }
    .app-header { padding: 0.7rem 1rem; }
}

.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28);
    border-radius: 99px;
}

.cover-art-sm {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.schedule-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.schedule-cal-head {
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    color: var(--bs-secondary-color);
    padding: 0.35rem 0;
}

.schedule-cal-day {
    min-height: 110px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.4rem;
    background: var(--glass-bg);
}

.schedule-cal-day.is-pad { background: transparent; border-color: transparent; }
.schedule-cal-day.is-today { border-color: var(--primary); }

.schedule-cal-num {
    display: inline-block;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    text-decoration: none;
}

.schedule-cal-item {
    font-size: 0.7rem;
    line-height: 1.25;
    background: rgba(124, 108, 255, 0.12);
    border-radius: 6px;
    padding: 2px 6px;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .schedule-cal-day { min-height: 72px; }
    .schedule-cal-item { display: none; }
}

.stream-transport-audio {
    display: none;
}

.stream-transport-btns {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.stream-ctl {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.stream-ctl i { pointer-events: none; }

.stream-ctl:hover:not(:disabled) {
    transform: scale(1.08);
    filter: brightness(1.08);
}

.stream-ctl:active:not(:disabled) {
    transform: scale(0.96);
}

.stream-ctl:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.stream-ctl.is-active {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.stream-ctl-play { background: #22c55e; }
.stream-ctl-pause { background: #f59e0b; }
.stream-ctl-stop { background: #ef4444; }

.stream-vol {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.15rem;
    color: inherit;
}

.stream-vol i,
.stream-vol span {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.85;
}

.stream-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 76px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.28);
    outline: none;
    cursor: pointer;
}

.stream-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.stream-vol-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 50%;
    background: #fff;
}

.stream-transport--sm .stream-vol-slider {
    width: 56px;
}

.stream-transport--sm .stream-vol i,
.stream-transport--sm .stream-vol span {
    font-size: 0.85rem;
}

.stream-transport--sm .stream-ctl {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.lib-upload-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0 0 1.1rem;
    list-style: none;
}

.lib-upload-steps li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    color: var(--bs-secondary-color);
    font-size: 0.82rem;
    font-weight: 500;
}

.lib-upload-steps li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: rgba(124, 108, 255, 0.18);
    font-size: 0.75rem;
}

.lib-upload-steps li.is-active {
    color: var(--bs-body-color);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.lib-upload-steps li.is-done {
    color: var(--live);
    border-color: rgba(34, 197, 94, 0.35);
}

.lib-upload-steps li.is-done span {
    background: rgba(34, 197, 94, 0.25);
}

.lib-upload-drop {
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color var(--transition), background var(--transition);
}

.lib-upload-drop.is-over {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.lib-upload-item {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.lib-upload-item:last-child {
    border-bottom: 0;
}

.lib-upload-item.is-done .lib-upload-status {
    color: var(--live);
}

.lib-upload-item.is-error .lib-upload-status {
    color: #f87171;
}

.pl-pick-list {
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.pl-pick-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.25rem;
    margin: 0;
}

.pl-pick-item span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-pick-item.is-in {
    opacity: 0.65;
}
