* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    font-size: medium;
}

body {
    background-color: #ffefef;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-bottom: 2px solid #ddd;
}

.logo-image {
    height: 80px;
    width: 140px;
    padding-left: 50px;
}

.stats-box {
    background: #EBE6FF;
    padding: 8px 15px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    color: #7358F2;
    margin-right: 20px;
}

/* Main Layout */
.chat-container {
    display: flex;
    flex: 1;
    padding: 10px;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}

.video-section {
    display: flex;
    flex-direction: column;
    width: 440px;
    gap: 10px;
}

.video-box {
    flex: 1;
    background-color: #555;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#local-video {
    transform: scaleX(-1);
}

.watermark {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: #ff8c00;
    font-weight: bold;
    opacity: 0.8;
}

.chat-display {
    flex: 1;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-logs {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Chat Text Styles */
.status-msg {
    font-weight: bold;
    color: #444;
    margin-bottom: 10px;
}

.warning-msg {
    color: red;
    font-weight: bold;
    margin-bottom: 5px;
}

.rules {
    list-style: none;
    color: #655c5c;
    line-height: 1.6;
    font-size: 14px;
}

/* Footer / Inputs */
.controls {
    display: flex;
    padding: 10px;
    gap: 10px;
    background: #fff;
}

.start-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding-right: 10px;
}

.input-wrapper input {
    flex: 1;
    border: none;
    padding: 10px;
    outline: none;
}

.gif-btn {
    background: #444343;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
}

.send-btn {
    background-color: #007bff;
    border: 1px solid #ccc;
    padding: 10px 30px;
    border-radius: 5px;
    color: white;
}

/* Report Button */
.report-btn {
    background: #dc3545;
    color: #ffffff;
    border: none;
    padding: 10px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: none; /* shown via JS when applicable */
    text-align: center;
}

/* Video Controls (Mute/Unmute) */
.video-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    display: flex;
    justify-content: center;
}

.video-box:hover .video-controls {
    opacity: 1;
}

.control-btn {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background 0.2s;
    padding: 10px;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.control-btn svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

#mute-alert {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* GIF Panel Styles */
.gif-panel {
    position: absolute;
    bottom: 90px;
    right: 20px;
    /* Aligned to right, or can be left */
    width: 320px;
    height: 400px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.gif-header {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

#gif-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

#close-gif-panel {
    background: none;
    border: none;
    font-size: 24px;
    margin-left: 10px;
    cursor: pointer;
    color: #666;
}

.gif-grid {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.gif-item {
    width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    object-fit: cover;
    max-height: 150px;
}

.gif-item:hover {
    transform: scale(1.02);
}

/* Scrollbar */
.gif-grid::-webkit-scrollbar {
    width: 6px;
}

.gif-grid::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

/* Responsive: Desktop down */
@media (max-width: 1200px) {
    .navbar {
        padding: 12px 16px;
    }

    .logo-image {
        height: 70px;
        width: 120px;
        padding-left: 16px;
    }

    .video-section {
        width: 380px;
    }
}

/* Responsive: Tablets — two videos side-by-side on top; chat full-width below */
@media (max-width: 992px) {
    .stats-box {
        font-size: 13px;
        padding: 6px 10px;
    }

    .chat-container {
        flex-direction: column;
        gap: 10px;
    }

    .video-section {
        width: 100%;
        flex-direction: row;
    }

    .video-box {
        flex: 1;
        aspect-ratio: 16/9;
    }

    .chat-display {
        padding: 14px;
    }

    .gif-panel {
        width: 300px;
        height: 360px;
        right: 12px;
        bottom: 84px;
    }

    /* Compact buttons on tablets */
    .start-btn { padding: 10px 18px; }
    .send-btn { padding: 10px 18px; }
    .report-btn { padding: 10px 18px; }

    .gif-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

    @media (max-width: 562px) and (min-width: 501px) {
        .controls {
            gap: 6px;
            flex-wrap: nowrap;
            align-items: center;
        }

        .start-btn, .send-btn, .report-btn {
            padding: 8px 12px;
            font-size: 12px;
            border-radius: 8px;
            height: 48px;
            min-width: 72px;
        }

        .input-wrapper {
            position: relative;
            flex: 1 1 auto;
            min-width: 0;
        }

        .input-wrapper input {
            height: 36px;
            border-radius: 8px;
        }

        .gif-btn {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        position: absolute;
        right: 8px;
        }
    }
/* 1032 X 1376 screen tablet  */
@media (max-width: 1032px) and (max-height: 1376px) {
    .stats-box {
        font-size: 13px;
        padding: 6px 10px;
    }

    .chat-container {
        flex-direction: column;
        gap: 10px;
    }

    .video-section {
        width: 100%;
        flex-direction: row;
    }

    .video-box {
        flex: 1;
        aspect-ratio: 16/9;
    }

    .chat-display {
        padding: 14px;
    }

    .gif-panel {
        width: 300px;
        height: 360px;
        right: 12px;
        bottom: 84px;
    }

    .gif-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Mobile phones: split-screen video layout with overlay */
@media (max-width: 500px) and (min-width: 300px) {
    body{
        height: 89vh;
    }
    .navbar {
        padding: 8px 12px;
    }

    .logo-image {
        height: 60px;
        width: 100px;
        padding-left: 8px;
    }

    .stats-box {
        margin-right: 8px;
        font-size: 12px;
        padding: 4px 10px;
    }

    .chat-container {
        flex-direction: column;
        gap: 10px;
        padding: 8px;
    }

    /* Video section: main video takes half screen, local overlays top-right */
    .video-section {
        position: relative;
        width: 100%;
        flex-direction: column;
        gap: 0;
    }

    /* Assume first video box is the remote/main video */
    .video-section .video-box:first-child {
        height: 50vh;
        border-radius: 12px;
    }

    /* Second video becomes overlay */
    .video-section .video-box:last-child {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 35%;
        aspect-ratio: 16/9;
        border-radius: 8px;
        overflow: hidden;
        z-index: 2;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    }

    /* Ensure video elements fill their containers correctly */
    .video-section .video-box:last-child video {
        object-fit: cover;
    }

    .watermark {
        font-size: 12px;
        bottom: 6px;
        left: 6px;
    }

    /* Chat card below videos */
    .chat-display {
        border-radius: 12px;
        padding: 16px;
    }

    /* Video controls remain accessible */
    .video-controls {
        bottom: 14px;
    }

    /* Controls: stack for mobile, full-width inputs/buttons */
    .controls {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        align-items: center;
    }

    .input-wrapper {
        position: relative;
        flex: 1 1 auto;
        min-width: 0;
    }

    .input-wrapper input {
        width: 100%;
        padding-right: 40px;
        box-sizing: border-box;
        border-radius: 8px;
        height: 36px;
    }

    .start-btn {
        flex: 0 0 auto;
        padding: 8px 12px;
        color: #fff;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        text-align: center;
        height: 48px;
        min-width: 64px;
    }

    .send-btn {
        flex: 0 0 auto;
        padding: 8px 12px;
        color: #fff;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        text-align: center;
        height: 48px;
        min-width: 64px;
    }

    .report-btn {
        flex: 0 0 auto;
        padding: 8px 12px;
        color: #fff;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        text-align: center;
        height: 48px;
        min-width: 64px;
    }

    .gif-btn {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}