@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/dist/tabler-icons.min.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100vw;
    height: 100vh;
    font-family: 'Montserrat', sans-serif;
    background: transparent;
    overflow: hidden;
    position: relative;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    object-fit: cover;
}

/* Background Overlay */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

/* =================
           CONTAINER STRUKTUR
           ================= */

/* Haupt-Container */
.main-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-areas:
        "header header header"
        "center center right"
        "footer footer footer";
    grid-template-rows: 30px 1fr 130px;
    grid-template-columns: 1fr 1fr 450px;
    gap: 30px;
    padding: 30px;
}

/* Header Container */
.header-container {
    grid-area: header;
}

.header-container:empty {
    display: none;
}

/* Center Container */
.center-container {
    grid-area: center;
}

.center-container:empty {
    display: none;
}

/* Right Container */
.right-container {
    grid-area: right;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-container:empty {
    display: none;
}

/* Footer Container */
.footer-container {
    grid-area: footer;
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.footer-container:empty {
    display: none;
}

/* Grid anpassungen wenn Container leer sind */
.main-container:has(.header-container:empty) {
    grid-template-rows: 0px 1fr 130px;
    padding-top: 0;
}

.main-container:has(.footer-container:empty) {
    grid-template-rows: 30px 1fr 0px;
    padding-bottom: 0;
}

.main-container:has(.right-container:empty) {
    grid-template-columns: 1fr 1fr 0px;
}

.main-container:has(.header-container:empty):has(.footer-container:empty) {
    grid-template-rows: 0px 1fr 0px;
    padding-top: 0;
    padding-bottom: 0;
}

/* ================= EXISTIERENDE ELEMENTE ================= */

/* Webcam - jetzt im Center Container */

.webcam {
    width: 100%;
    height: 253px;
    background: rgba(15, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 500;
    gap: 8px;
}

.webcam-justchatting {
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    font-weight: 500;
    gap: 15px;
}

.webcam-icon {
    font-size: 64px;
    color: rgba(255, 255, 255, 0.6);
}

/* =================
   MULTI-WEBCAM LAYOUT
   ================= */

/* Container für mehrere Webcams */
.multi-webcam-container {
    width: 100%;
    height: 100%;
    display: grid;
    gap: 15px;
    padding: 15px;
    background: rgba(15, 15, 25, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* 2 Personen Layout */
.multi-webcam-container.layout-2 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
}

/* 3 Personen Layout */
.multi-webcam-container.layout-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.multi-webcam-container.layout-3 .webcam-slot:first-child {
    grid-column: 1 / -1;
}

/* 4 Personen Layout */
.multi-webcam-container.layout-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

/* Individual Webcam Slots */
.webcam-slot {
    background: rgba(15, 15, 25, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.webcam-slot:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: scale(1.02);
}

.webcam-slot-icon {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.6);
}

/* Name Labels für Webcam Slots */
.webcam-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Spezielle Farben für verschiedene Personen */
.webcam-slot.host {
    border-color: rgba(34, 197, 94, 0.4);
}

.webcam-slot.guest-1 {
    border-color: rgba(59, 130, 246, 0.4);
}

.webcam-slot.guest-2 {
    border-color: rgba(168, 85, 247, 0.4);
}

.webcam-slot.guest-3 {
    border-color: rgba(245, 158, 11, 0.4);
}

/* Topic Box - ersetzt die alte Webcam-Position */
.topic-box {
    width: 100%;
    height: 80px;
    background: rgba(15, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.topic-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f59e0b, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
    flex-shrink: 0;
}

.topic-content {
    flex: 1;
}

.topic-content h4 {
    color: #f59e0b;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.topic-content p {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}

/* Stream Info Box - zusätzliches Element */
.stream-info {
    width: 100%;
    height: 80px;
    background: rgba(15, 15, 25, 0.6);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
    box-shadow:
        0 8px 32px rgba(168, 85, 247, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stream-info-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #a855f7, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
    flex-shrink: 0;
}

.stream-info-content {
    flex: 1;
}

.stream-info-content h4 {
    color: #a855f7;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stream-info-content p {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}

/* Alert Box */
.alert-box {
    width: 100%;
    height: 80px;
    background: rgba(15, 15, 25, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.4s ease-out;
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.alert-box.show {
    opacity: 1;
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.alert-content h4 {
    color: #6366f1;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.alert-content p {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
}

/* Live Chat */
.live-chat {
    flex: 1;
    background: rgba(15, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    flex-direction: column;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px 12px 0 0;
}

.chat-messages {
    flex: 1;
    overflow: hidden;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    animation: messageSlideIn 0.5s ease-out;
    opacity: 1;
    transition: opacity 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.fade-out {
    animation: messageFadeOut 0.3s ease-out forwards;
}

@keyframes messageFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.message-content {
    flex: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.user-badges {
    display: flex;
    gap: 4px;
}

.badge {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge img {
    width: 18px;
    height: 18px;
    display: block;
}

.username {
    color: #6366f1;
    font-weight: 600;
    font-size: 14px;
}

.message-text {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.4;
}

.message-text .emote {
    display: inline-block;
    height: 20px;
    vertical-align: middle;
    margin: 0 2px;
}

/* Spotify Player */
.spotify-player {
    width: 350px;
    height: 100px;
    background: rgba(15, 15, 25, 0.8);
    border: 1px solid rgba(30, 215, 96, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
    box-shadow:
        0 8px 32px rgba(30, 215, 96, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.song-artwork {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background: url('https://picsum.photos/70/70?random=1') center/cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.song-info {
    flex: 1;
    overflow: hidden;
}

.song-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1db954, #1ed760);
    border-radius: 2px;
    width: 45%;
    animation: progressMove 30s linear infinite;
    box-shadow: 0 0 10px rgba(29, 185, 84, 0.5);
}

@keyframes progressMove {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

.spotify-icon {
    color: #1db954;
    font-size: 24px;
}

/* Middle Space */
.footer-middle {
    flex: 1;
}

/* Sponsor Banner */
.sponsor-banner {
    width: 450px;
    height: 100px;
    background: rgba(15, 15, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sponsor-banner:hover {
    background: rgba(15, 15, 25, 0.3);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.sponsor-logo {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: url('https://picsum.photos/60/60?random=2') center/cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.sponsor-content {
    flex: 1;
}

.sponsor-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    max-width: 90%;
    display: flex;
    align-items: center;
    border-radius: 3px;
    font-weight: 600;
    font-size: 15px;
    background-color: #f163636b;
    border: 1px solid rgb(241 99 99 / 17%);
    color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 8px rgba(241, 99, 99, 0.2); 
    backdrop-filter: blur(10px);
    padding-left: 6px;
    padding-right: 6px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    cursor: pointer;
}

.sponsor-badge i {
    margin-right: 5px;
}

.sponsor-badge .sponsor-text {
    display: inline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sponsor-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.sponsor-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.sponsor-command {
    color: #6366f1;
    font-size: 12px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* Responsive adjustments */
@media (max-width: 1600px) {
    .main-container {
        grid-template-columns: 1fr 1fr 400px;
    }

    .sponsor-banner {
        width: 400px;
    }
}

@media (max-width: 1400px) {
    .main-container {
        grid-template-columns: 1fr 1fr 350px;
    }

    .sponsor-banner {
        width: 350px;
    }

    .spotify-player {
        width: 300px;
    }
}