/* ========================================
   StreamCalendar - VS 2026 Purple Theme
   ======================================== */

:root {
    --bg-dark: #0d0d1a;
    --bg-card: rgba(20, 15, 35, 0.85);
    --bg-card-solid: #140f23;
    --purple-start: #667eea;
    --purple-mid: #9b59b6;
    --purple-end: #e040fb;
    --pink-glow: #f857a6;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --border-glow: rgba(102, 126, 234, 0.3);
    --twitch: #9146ff;
    --youtube: #ff0000;
    --kick: #53fc18;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-dark);
    background-image: 
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(102, 126, 234, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(224, 64, 251, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(155, 89, 182, 0.1) 0%, transparent 50%);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ========== Layout ========== */
.app-container {
    display: flex;
    height: 100vh;
    gap: 0;
    transition: all 0.3s ease;
}

/* ========== Main Content (Player - LEFT, takes most space) ========== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    min-width: 0;
    overflow: hidden;
}

.player-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-glow);
    overflow: hidden;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(102, 126, 234, 0.05);
    border-bottom: 1px solid var(--border-glow);
    flex-shrink: 0;
}

.player-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-title-area h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.player-title-area h2 i {
    color: var(--purple-start);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== Sidebar (RIGHT) ========== */
.sidebar {
    width: 480px;
    min-width: 480px;
    max-width: 480px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-left: 1px solid var(--border-glow);
    padding: 12px;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar.collapsed {
    width: 0;
    min-width: 0;
    max-width: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    flex-shrink: 0;
}

.sidebar-section {
    flex-shrink: 0;
}

.sidebar-section.calendar-section {
    flex: 1;
    min-height: 200px;
    overflow: hidden;
}

.sidebar-footer {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-glow);
    flex-shrink: 0;
}

.sidebar-footer .btn-glow {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--purple-start), var(--purple-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo i {
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--purple-start), var(--purple-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========== Theater Mode ========== */
.app-container.theater-mode .sidebar {
    width: 0;
    min-width: 0;
    max-width: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.app-container.theater-mode .main-content {
    padding: 0;
}

.app-container.theater-mode .player-wrapper {
    border-radius: 0;
    border: none;
}

.app-container.theater-mode .player-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    border: none;
    padding: 16px 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-container.theater-mode .player-wrapper:hover .player-header {
    opacity: 1;
}

.app-container.theater-mode #playerContainer {
    border-radius: 0;
}

.app-container.theater-mode #toggleSidebarBtnAlt {
    display: flex !important;
}

.app-container.theater-mode #theaterModeBtn i {
    transform: rotate(45deg);
}

/* Keyboard hint */
kbd {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-glow);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: inherit;
    font-size: 0.9rem;
}

/* ========== Glass Cards ========== */
.glass-card {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.glass-card-header {
    padding: 12px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.glass-card-header h2 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.glass-card-header h2 i {
    color: var(--purple-start);
}

.glass-card-body {
    padding: 8px 0;
    flex: 1;
    overflow: auto;
}

/* ========== Buttons ========== */
.btn-glow {
    background: linear-gradient(135deg, var(--purple-start), var(--purple-mid));
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-glow:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-glow);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--purple-start);
    color: var(--text-primary);
}

.btn-ghost.btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}
    border-color: var(--purple-start);
    color: var(--text-primary);
}

.btn-group-nav {
    display: flex;
    gap: 4px;
}

.btn-group-nav button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glow);
    color: var(--text-secondary);
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-group-nav button:first-child { border-radius: 6px 0 0 6px; }
.btn-group-nav button:last-child { border-radius: 0 6px 6px 0; }
.btn-group-nav button:not(:first-child):not(:last-child) { border-radius: 0; }

.btn-group-nav button:hover {
    background: var(--purple-start);
    border-color: var(--purple-start);
    color: white;
}

/* ========== Calendar ========== */
.calendar-section {
    display: flex;
    flex-direction: column;
}

#calendar {
    flex: 1;
    --fc-border-color: var(--border-glow);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: rgba(102, 126, 234, 0.05);
    --fc-today-bg-color: rgba(102, 126, 234, 0.15);
    --fc-list-event-hover-bg-color: rgba(102, 126, 234, 0.1);
}

.fc .fc-toolbar { display: none; }

.fc .fc-scrollgrid { border: none !important; }

.fc .fc-scrollgrid-section > * {
    border: none !important;
}

.fc .fc-col-header-cell {
    background: rgba(102, 126, 234, 0.1);
    padding: 12px 0;
}

.fc .fc-col-header-cell-cushion {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.fc .fc-daygrid-day {
    transition: background 0.2s;
}

.fc .fc-daygrid-day:hover {
    background: rgba(102, 126, 234, 0.08) !important;
}

.fc .fc-daygrid-day-number {
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 0.9rem;
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    background: linear-gradient(135deg, var(--purple-start), var(--purple-mid));
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 6px;
}

.fc-event {
    cursor: pointer;
    border: none !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    margin: 2px 4px !important;
    font-size: 0.8rem !important;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fc-event:hover {
    transform: scale(1.03);
    z-index: 10;
}

.fc-event.platform-twitch {
    background: linear-gradient(135deg, #9146ff, #772ce8) !important;
    box-shadow: 0 2px 8px rgba(145, 70, 255, 0.3);
}

.fc-event.platform-youtube {
    background: linear-gradient(135deg, #ff0000, #cc0000) !important;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}

.fc-event.platform-kick {
    background: linear-gradient(135deg, #53fc18, #3dd614) !important;
    color: #000 !important;
    box-shadow: 0 2px 8px rgba(83, 252, 24, 0.3);
}

/* ========== Player Container ========== */
#playerContainer {
    flex: 1;
    min-height: 400px;
    background: #000;
    position: relative;
}

#noStreamPlaceholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(224, 64, 251, 0.05));
}

#noStreamPlaceholder i {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--purple-start), var(--purple-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

#noStreamPlaceholder p {
    color: var(--text-muted);
    margin: 4px 0;
}

#streamFrame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    visibility: visible;
    opacity: 1;
}

.player-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.platform-badge.twitch { background: var(--twitch); }
.platform-badge.youtube { background: var(--youtube); }
.platform-badge.kick { background: var(--kick); color: #000; }

.btn-close-player {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-player:hover {
    background: rgba(255, 70, 70, 0.2);
    color: #ff4646;
}

/* ========== Stream List ========== */
.stream-list {
    max-height: 200px;
    overflow-y: auto;
}

.stream-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-glow);
}

.stream-item:last-child {
    border-bottom: none;
}

.stream-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.stream-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.2), transparent);
    border-left: 3px solid var(--purple-start);
    margin-left: -1px;
}

.stream-platform-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stream-platform-icon.twitch { background: rgba(145, 70, 255, 0.2); }
.stream-platform-icon.youtube { background: rgba(255, 0, 0, 0.2); }
.stream-platform-icon.kick { background: rgba(83, 252, 24, 0.2); }

.stream-info {
    flex: 1;
    min-width: 0;
}

.stream-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stream-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.live-badge {
    background: #ff0000;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    animation: pulse-live 2s infinite;
}

.past-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.stream-item.past {
    opacity: 0.6;
}

.stream-item.past:hover {
    opacity: 1;
}

.stream-section-header {
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: rgba(102, 126, 234, 0.05);
    border-bottom: 1px solid var(--border-glow);
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* ========== Modal / Offcanvas ========== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.slide-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100%;
    background: var(--bg-card-solid);
    border-left: 1px solid var(--border-glow);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.slide-panel.show {
    right: 0;
}

.slide-panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-glow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slide-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.slide-panel-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

/* ========== Form ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--purple-start);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row .form-group {
    min-width: 0; /* Verhindert Overflow */
}

.form-row .form-input {
    width: 100%;
    min-width: 0;
}

/* DateTime Input Fix */
input[type="datetime-local"] {
    min-width: 0;
    width: 100%;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
}

.btn-danger {
    background: transparent;
    border: 1px solid rgba(255, 70, 70, 0.5);
    color: #ff6b6b;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-danger:hover {
    background: rgba(255, 70, 70, 0.1);
    border-color: #ff6b6b;
}

/* ========== Switch Toast ========== */
.switch-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card-solid);
    border: 2px solid var(--purple-start);
    border-radius: 16px;
    padding: 20px;
    width: 340px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    z-index: 2000;
    transform: translateY(150%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.switch-toast.show {
    transform: translateY(0);
}

.switch-toast-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.switch-toast-header i {
    color: var(--purple-start);
    font-size: 1.2rem;
}

.switch-toast-header span {
    flex: 1;
    font-weight: 500;
}

.countdown {
    background: linear-gradient(135deg, var(--purple-start), var(--purple-mid));
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.switch-toast-body {
    margin-bottom: 16px;
}

.switch-toast-body .title {
    font-weight: 600;
    color: var(--text-primary);
}

.switch-toast-actions {
    display: flex;
    gap: 10px;
}

.switch-toast-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-switch-now {
    background: linear-gradient(135deg, var(--purple-start), var(--purple-mid));
    border: none;
    color: white;
}

.btn-switch-now:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-cancel-switch {
    background: transparent;
    border: 1px solid var(--border-glow);
    color: var(--text-secondary);
}

.btn-cancel-switch:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ========== Header Actions ========== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========== Account Cards ========== */
.account-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.account-card:hover {
    background: rgba(102, 126, 234, 0.05);
}

.account-card.linked {
    border-color: var(--purple-start);
}

.account-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.account-icon.twitch {
    background: rgba(145, 70, 255, 0.2);
    color: #9146ff;
}

.account-icon.youtube {
    background: rgba(255, 0, 0, 0.2);
    color: #ff0000;
}

.account-info {
    flex: 1;
}

.account-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.account-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.account-status.linked {
    color: #53fc18;
}

.account-action {
    padding: 8px 16px;
}

.account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
}

/* ========== Follows Tabs ========== */
.follows-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glow);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
    background: var(--purple-start);
    border-color: var(--purple-start);
    color: white;
}

/* ========== Follows List ========== */
.follows-list {
    max-height: 400px;
    overflow-y: auto;
}

.follow-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.follow-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.follow-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
}

.follow-item.live .follow-avatar {
    border-color: #ff0000;
}

.follow-info {
    flex: 1;
    min-width: 0;
}

.follow-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-game {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-live-badge {
    background: #ff0000;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.follow-add-btn {
    background: transparent;
    border: 1px solid var(--border-glow);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.follow-add-btn:hover {
    background: var(--purple-start);
    border-color: var(--purple-start);
    color: white;
}

/* ========== Live Now ========== */
.live-stream-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-glow);
}

.live-stream-item:last-child {
    border-bottom: none;
}

.live-stream-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.live-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.live-info {
    flex: 1;
    min-width: 0;
}

.live-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.live-channel {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.live-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.live-viewers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-viewers::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ff0000;
    border-radius: 50%;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-glow);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-start);
}

/* ========== Responsive ========== */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
        min-height: 100vh;
    }

    .calendar-section,
    .player-section {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 12px;
        gap: 12px;
    }

    .slide-panel {
        width: 100%;
        right: -100%;
    }

    .switch-toast {
        left: 15px;
        right: 15px;
        width: auto;
        bottom: 15px;
    }
}

/* ========== Notifications ========== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card-solid);
    border: 1px solid var(--purple-start);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.notification.show {
    transform: translateX(0);
}

.notification i {
    font-size: 1.5rem;
}

.notification.success i {
    color: #53fc18;
}

.notification.error i {
    color: #ff6b6b;
}

.notification.error {
    border-color: #ff6b6b;
}

/* ========== Small Button ========== */
.btn-sm {
    padding: 6px 10px !important;
    font-size: 0.85rem !important;
}

.text-danger {
    color: #ff0000 !important;
}

/* ========== Auth Pages ========== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(20px);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header i {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--purple-start), var(--purple-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header h1 {
    margin: 16px 0 8px;
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--purple-start), var(--purple-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-secondary);
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-glow);
}

.auth-footer p {
    color: var(--text-secondary);
    margin: 0;
}

.auth-footer a {
    color: var(--purple-start);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: rgba(255, 70, 70, 0.15);
    border: 1px solid rgba(255, 70, 70, 0.3);
    color: #ff6b6b;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--purple-start);
}

.auth-message {
    text-align: center;
    padding: 30px 0;
}

.auth-message i {
    font-size: 4rem;
    color: #4ade80;
    margin-bottom: 16px;
}

.auth-message p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ========== User Menu ========== */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--purple-start);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-start), var(--purple-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ========== Profile Page ========== */
.profile-container {
    min-height: 100vh;
    padding: 40px 20px;
    max-width: 700px;
    margin: 0 auto;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(20px);
}

.profile-header {
    margin-bottom: 30px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--purple-start);
}

.profile-user {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-glow);
    margin-bottom: 30px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-start), var(--purple-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
}

.profile-info h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
}

.profile-info p {
    margin: 0;
    color: var(--text-muted);
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 10px;
}

.profile-section h2 i {
    color: var(--purple-start);
}

.section-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 20px;
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-danger {
    padding-top: 30px;
    border-top: 1px solid var(--border-glow);
}

.btn-danger {
    background: rgba(255, 70, 70, 0.15);
    border: 1px solid rgba(255, 70, 70, 0.3);
    color: #ff6b6b;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(255, 70, 70, 0.25);
    border-color: #ff6b6b;
}

.user-name {
    font-size: 0.85rem;
}

/* ========== Live Tabs ========== */
.live-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-glow);
}

.live-tabs .tab-btn {
    flex: 1;
}

/* ========== Calendar Events - Preview/Subscribed ========== */
.fc-event {
    border: none !important;
    padding: 2px 6px !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

/* Normal confirmed events */
.fc-event.event-confirmed {
    background: linear-gradient(135deg, var(--purple-start), var(--purple-mid)) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Preview events - halbtransparent mit animiertem Glow */
.fc-event.event-preview {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.4), 
        rgba(155, 89, 182, 0.4)) !important;
    border: 1px dashed rgba(102, 126, 234, 0.6) !important;
    animation: previewPulse 3s ease-in-out infinite;
}

.fc-event.event-preview:hover {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.7), 
        rgba(155, 89, 182, 0.7)) !important;
}

@keyframes previewPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

/* Manual events */
.fc-event.event-manual {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
}

/* Subscribed auto-imported events */
.fc-event.event-subscribed {
    background: linear-gradient(135deg, var(--twitch), #6441a5) !important;
}

.fc-event.event-subscribed.twitch {
    background: linear-gradient(135deg, var(--twitch), #6441a5) !important;
}

.fc-event.event-subscribed.youtube {
    background: linear-gradient(135deg, #ff0000, #cc0000) !important;
}

/* Event category badge */
.fc-event .event-category {
    font-size: 0.65rem;
    opacity: 0.8;
    display: block;
    margin-top: 2px;
}

/* ========== Subscribe Button ========== */
.follow-subscribe-btn {
    background: transparent;
    border: 1px solid var(--border-glow);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.follow-subscribe-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--purple-start);
    color: var(--purple-start);
}

.follow-subscribe-btn.subscribed {
    background: var(--purple-start);
    border-color: var(--purple-start);
    color: white;
}

.follow-subscribe-btn.subscribed:hover {
    background: #ff6b6b;
    border-color: #ff6b6b;
}

/* ========== Schedule Preview Modal ========== */
.schedule-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.schedule-modal.show {
    opacity: 1;
    visibility: visible;
}

.schedule-modal-content {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.schedule-modal.show .schedule-modal-content {
    transform: scale(1);
}

.schedule-modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-glow);
}

.schedule-modal-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.schedule-modal-header h3 {
    flex: 1;
    margin: 0;
}

.schedule-modal-header .close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.schedule-modal-header .close-btn:hover {
    color: var(--text-primary);
}

.schedule-list {
    margin-bottom: 20px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 8px;
}

.schedule-item:last-child {
    margin-bottom: 0;
}

.schedule-date {
    text-align: center;
    min-width: 50px;
}

.schedule-date .day {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--purple-start);
}

.schedule-date .month {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.schedule-details {
    flex: 1;
}

.schedule-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.schedule-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.schedule-category {
    font-size: 0.75rem;
    color: var(--purple-start);
}

.schedule-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-glow);
}

.schedule-actions button {
    flex: 1;
}

/* Auto-Import Toggle */
.auto-import-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    margin-top: 15px;
}

.auto-import-toggle span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-import-toggle span i {
    color: var(--purple-start);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    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: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--purple-start);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background: white;
}

/* Empty schedule state */
.schedule-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.schedule-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Loading indicator */
.schedule-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.schedule-loading i {
    font-size: 2rem;
    color: var(--purple-start);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Schedule Item Checkbox */
.schedule-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.schedule-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.schedule-checkbox .checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: transparent;
}

.schedule-checkbox .checkmark i {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
    color: white;
    font-size: 0.85rem;
}

.schedule-checkbox input:checked + .checkmark {
    background: var(--purple-start);
    border-color: var(--purple-start);
}

.schedule-checkbox input:checked + .checkmark i {
    opacity: 1;
    transform: scale(1);
}

.schedule-checkbox:hover .checkmark {
    border-color: var(--purple-start);
}

/* Select All Row */
.schedule-select-all {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Schedule item with checkbox layout */
.schedule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.schedule-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Unchecked items appear dimmed */
.schedule-item:has(.schedule-item-check:not(:checked)) {
    opacity: 0.5;
}

.schedule-item:has(.schedule-item-check:not(:checked)) .schedule-date .day {
    color: var(--text-muted);
}

/* Import button disabled state */
.schedule-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== Chat Panel ========== */
.player-area {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

.player-area #playerContainer {
    flex: 1;
    min-width: 0;
}

.chat-panel {
    width: 340px;
    min-width: 340px;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-left: 1px solid var(--border-glow);
    transition: all 0.3s ease;
}

.chat-panel.collapsed {
    width: 0;
    min-width: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(102, 126, 234, 0.05);
    border-bottom: 1px solid var(--border-glow);
    flex-shrink: 0;
}

.chat-header span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.chat-header span i {
    color: var(--purple-start);
}

.chat-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #18181b; /* Twitch dark background */
}

/* Chat toggle button active state */
#toggleChatBtn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--purple-start);
    color: var(--purple-start);
}

/* Theater mode adjustments for chat */
.app-container.theater-mode .chat-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
}

.app-container.theater-mode .chat-header {
    background: rgba(0, 0, 0, 0.9);
}

/* Responsive chat */
@media (max-width: 1400px) {
    .chat-panel {
        width: 300px;
        min-width: 300px;
        max-width: 300px;
    }
}

@media (max-width: 1100px) {
    .chat-panel {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
        width: 320px;
        min-width: 320px;
        max-width: 320px;
    }
    
    .chat-panel .chat-header {
        background: rgba(0, 0, 0, 0.9);
    }
}
