:root {
    --primary: #1c4b5d;
    --secondary: white;
    --danger: #db2c2c;
    --live-red: #eb0909;
    --gray-light: #f4f2f2;
    --gray-border: #e3e3e3;
}

.stream-interface-wrapper {
    position: relative;
    max-width: 800px;
    border-radius: 15px;
    margin: 0 auto;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0 80px 0 80px;
    min-height: 99vh !important;
}
.video-background1 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.video-preview {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.video-preview video {
    width: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/*Déplacement du stream quand les flottantes sont ouverts === */
.stream-interface-wrapper.with-comments,
.stream-interface-wrapper.with-viewers,
.stream-interface-wrapper.with-shares {
    transform: translateX(-190px);
    max-width: 500px;
}

.stream-interface {
    position: relative;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Stream Container */
.stream-container {
    background: #d9d9d9;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    height: 93vh;
}

.stream-background {
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, #1c4b5d 0%, #1c4b5d 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #1c4b5d 100%);
    position: relative;
}

/* Live Indicator */
.live-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 20;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 16px;
}

.live-circle {
    width: 20px;
    height: 20px;
    border: 1px solid rgb(150, 147, 147);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-dot {
    width: 14px;
    height: 14px;
    background: rgb(150, 147, 147);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* User Tag */
.user-tag {
    position: absolute;
    top: 60px;
    left: 20px;
    background: rgba(255, 255, 255, 0.87);
    border-radius: 6px;
    padding: 4px 14px;
    font-size: 10px;
    color: black;
    opacity: 0.8;
    border: 0.28px solid rgba(255, 255, 255, 0.27);
    z-index: 20;
}

/* Start Live Buttons */
.start-live-top {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    z-index: 20;
}

.start-live-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 15;
}

.profile-avatar {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: #f0f0f0;
    border: 2px solid var(--primary);
    margin: 0 auto 20px;
}

.start-live-profile {
    background: var(--secondary);
    color: var(--primary);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
}

/* Bottom Controls */
.controls-bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 20;
}

.control-btn {
    background: var(--gray-light);
    border: 0.5px solid var(--gray-border);
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
}

.control-btn:hover {
    background: #bc143b;
    transform: translateY(-2px);
}

.control-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    font-size: 18px;
}

.side-controls {
    position: absolute;
    bottom: 0 !important;
    /* transform: translateX(-50%); */
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 25;
}

.side-btn {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
}

.side-btn:hover {
    background: #153945;
    transform: scale(1.1);
}

.side-icon {
    width: 24px;
    height: 24px;
    color: white;
    font-size: 18px;
}

/* Fenêtre flottantes fixe  */
.comments-panel,
.viewers-panel,
.shares-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    height: 100vh;
    background: white;
    border-radius: 16px 0 0 16px;

    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    border: 1px solid var(--gray-border);
    border-right: none;
}

.comments-panel.active,
.viewers-panel.active,
.shares-panel.active {
    right: 0;
}

.comments-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.comments-overlay.active,
.viewers-overlay.active,
.shares-overlay.active {
    opacity: 1;
    visibility: visible;
}

.comments-header,
.viewers-header,
.shares-header {
    padding: 0px 10px 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.comments-header h6,
.viewers-header h6,
.shares-header h6 {
    margin: 0;
    font-weight: 500;
    color: var(--primary);
    font-size: 16px;
}

.btn-close-comments,
.btn-close-viewers,
.btn-close-shares {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: white;
    border-radius: 5px;
}

.btn-close-comments:hover,
.btn-close-viewers:hover,
.btn-close-shares:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.comments-body,
.viewers-body,
.shares-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: white;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--gray-light);
}

.comments-body::-webkit-scrollbar,
.viewers-body::-webkit-scrollbar,
.shares-body::-webkit-scrollbar {
    width: 6px;
}

.comments-body::-webkit-scrollbar-track,
.viewers-body::-webkit-scrollbar-track,
.shares-body::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 3px;
}

.comments-body::-webkit-scrollbar-thumb,
.viewers-body::-webkit-scrollbar-thumb,
.shares-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.comments-body::-webkit-scrollbar-thumb:hover,
.viewers-body::-webkit-scrollbar-thumb:hover,
.shares-body::-webkit-scrollbar-thumb:hover {
    background: #153945;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-item {
    display: flex;
    gap: 10px;
    animation: slideInComment 0.4s ease-out;
    padding: 5px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.comment-item:hover {
    background: #e9ecef;
    border-color: var(--gray-border);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.comment-avatar,
.viewer-avatar,
.shares-avatar {
    flex-shrink: 0;
}

.comment-avatar img,
.viewer-avatar img,
.shares-avatar img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--primary);
    transition: transform 0.3s ease;
}

.comment-item:hover .comment-avatar img {
    transform: scale(1.1);
}

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

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
}

.comment-time {
    font-size: 12px;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 10px;
}

.comment-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    word-wrap: break-word;
}

.comments-input {
    padding: 20px;
    position: relative;
}

.comments-input .input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    border-radius: 50% !important;
}

.comments-input .form-control {
    border: 1px solid var(--gray-border);
    padding: 12px 20px;
    font-size: 14px;
    flex: 1;
    transition: all 0.3s ease;
    background: white;
}

.comments-input .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(28, 75, 93, 0.1);
    transform: translateY(-1px);
}

.comments-input .btn {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(28, 75, 93, 0.3);
}

.comments-input .btn:hover {
    background: #153945;
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(28, 75, 93, 0.4);
}

.comments-input .btn:active {
    transform: scale(0.95);
}

/* Animations */
@keyframes slideInComment {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (min-width: 769px) {
    #commentsContainer,
    #viewersContainer,
    #sharesContainer {
        display: none;
    }
    .stream-interface-wrapper {
        max-width: 500px;
        max-height: 200px;
    }

    /*  Déplacement desktop */
    .stream-interface-wrapper.with-comments,
    .stream-interface-wrapper.with-viewers,
    .stream-interface-wrapper.with-shares {
        transform: translateX(-190px);
    }

    .side-controls {
        right: -64px;
        /* top: 50%;
        transform: translateY(-50%); */
    }

    .side-btn {
        background: var(--primary);
        backdrop-filter: none;
    }

    .comments-panel {
        width: 380px;
        right: -380px;
    }

    .comments-panel.active {
        right: 0;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

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

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}
.slide-in-bottom {
    animation: slideInBottom 0.8s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.viewer-name {
    font-size: 12px;
}

.btns-shares .btn-1,
.btns-shares .btn-2 {
    color: var(--primary);
    min-width: 49% !important;
    border-color: var(--primary);
    transition: all 0.3s ease-in-out;
}
.btns-shares .btn-1:hover,
.btns-shares .btn-2:hover {
    background-color: var(--primary);
    color: white;
}

.btn-1.active,
.btn-2.active {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    min-width: 49% !important;
    background-color: var(--primary) !important;
    color: white !important;
    animation: pulse 0.6s ease-in-out;
}

.btns-shares {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    max-width: 450px;
    padding: 0 !important;
    margin: 0 auto;
}
.btn-animate {
    transform: scale(0.95);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}
.footer-shares-2 {
    transition: all 0.5s ease-in-out;
}

.user-item-shares {
    animation: slideInUp 0.5s ease-out;
}

.user-item-shares {
    padding: 6px 14px 6px 0;
}
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    animation: fadeIn 0.4s ease-out;
}

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

.user-info-shares {
    width: 216px;
    gap: 8px;
}

.user-avatar-shares {
    width: 48px;
    height: 48px;
    position: relative;
}

.user-avatar-img-shares {
    width: 45px;
    height: 45px;
    left: 1px;
    top: 1px;
    position: absolute;
}

/* Détails utilisateur */
.user-details-shares {
    width: 148px;
    gap: 4px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.user-name-shares {
    color: #2b2b2b;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    width: 100%;
}

/* Checkbox circulaire */
.checkbox-container {
    width: 36px;
    height: 36px;
    position: relative;
}

.circle-checkbox {
    width: 36px;
    height: 36px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    appearance: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

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

.circle-checkbox:checked::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
}

.circle-checkbox:hover {
    border-color: var(--primary);
}
.btn-shares-bottom,
.btn-viewer-bottom {
    background-color: var(--primary) !important;
    color: white;
}
.btn-shares-bottom:hover,
.btn-shares-bottom:hover {
    background-color: var(--primary) !important;
    color: white;
}

.content-shares-1,
.content-shares-2 {
    transition: all 0.4s ease-in-out;
}

.comments-in-stream {
    display: none;
    padding: 5px 5px !important;
    max-height: 200px;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}
.bottom-comment-in-stream {
    bottom: 8% !important;
}

.btn-cancel-stop-live {
    background-color: var(--primary) !important;
    color: white;
}

@media (max-width: 768px) {
    /* ===== Interface principale ===== */
    .stream-interface {
        max-width: 100%;
        padding: 0 !important;
    }

    .stream-interface-wrapper {
        padding: 0 !important;
    }

    .stream-interface-wrapper.with-comments,
    .stream-interface-wrapper.with-viewers,
    .stream-interface-wrapper.with-shares {
        transform: translateX(0);
    }

    .stream-container {
        height: 90vh;
        border-radius: 12px;
        margin-top: 70px !important;
    }

    /* ===== Contrôles latéraux ===== */
    /* .side-controls {
        right: 0px !important;
        bottom: 0% !important;
        transform: translateY(-50%);
        display: none;
    }
    .side-controls > * + * {
        margin-top: 8px;
    } */
    .side-controls {
        position: absolute !important;
        bottom: -15% !important;
        left: 85% !important;   
        transform: translateY(-50%) !important;
        display: flex !important;  
        flex-direction: column;
        gap: 12px;
        z-index: 50 !important;    
    }

    .side-btn {
        width: 40px;
        height: 40px;
        background: rgba(28, 75, 93, 0.9);
        backdrop-filter: blur(15px);
    }

    .side-icon {
        width: 18px;
        height: 18px;
        font-size: 20px;
    }

    /* ===== Profil et live ===== */
    .profile-avatar {
        width: 50px;
        height: 50px;
    }

    .start-live-profile {
        font-size: 12px;
        padding: 5px 10px;
    }

    /* ===== Boutons inférieurs ===== */
    .controls-bottom {
        bottom: 10px;
        gap: 6px;
        display: none;
    }

    .control-btn {
        padding: 8px 12px;
    }

    /* ===== Indicateurs ===== */
    .live-indicator {
        top: 15px;
        left: 15px;
    }

    .user-tag {
        top: 50px;
        left: 15px;
    }

    .start-live-top {
        top: 15px;
        right: 15px;
    }

    /* ===== Panneaux de commentaires, viewers, shares ===== */
    .comments-panel {
        width: 100vw;
        height: 50vh;
        top: 50%;
        right: 0;
        border-radius: 12px 0 0 12px;
        background-color: transparent !important;
        pointer-events: none;
        color: white;
        display: none !important;
    }

    .comments-panel.active {
        right: 0;
    }

    /* ===== Overlay sombre ===== */
    .comments-overlay-test,
    .viewers-overlay-test,
    .shares-overlay-test {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    .comments-overlay-test.active,
    .viewers-overlay-test.active,
    .shares-overlay-test.active {
        opacity: 1;
        visibility: visible;
    }

    /* ===== Containers ===== */
    .comments-container,
    .viewers-container,
    .shares-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 50vh;
        background: white;
        border-radius: 20px 20px 0 0;
        z-index: 1000;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
    }

    .comments-container.active,
    .viewers-container.active,
    .shares-container.active {
        transform: translateY(0);
    }

    /* ===== Header ===== */
    .comments-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid #f0f0f0;
        background-color: transparent !important;
    }

    .comments-count {
        font-weight: 600;
        font-size: 16px;
        color: var(--primary);
    }

    .btn-close-comments,
    .btn-close-viewers,
    .btn-close-shares {
        background: white !important;
        border-radius: 50% !important;
        border: 1px solid var(--primary);
        font-size: 20px;
        color: var(--primary) !important;
        padding: 8px;
    }

    /* ===== Liste des commentaires mobile ===== */
    .comments-list {
        flex: 1;
        overflow-y: auto;
        padding: 0 20px;
    }

    .comment-item {
        display: flex;
        padding: 12px 0;
        border-bottom: 1px solid #f8f8f8;
        animation: slideInUp 0.3s ease-out forwards;
        opacity: 0;
        transform: translateY(20px);
    }

    .comment-avatar,
    .viewer-avatar,
    .shares-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        overflow: hidden;
        margin-right: 12px;
        flex-shrink: 0;
    }

    .comment-avatar img,
    .viewer-avatar img,
    .shares-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .comment-content {
        flex: 1;
    }

    .comment-author {
        font-weight: 600;
        font-size: 14px;
        margin-bottom: 4px;
    }

    .comment-text {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 4px;
    }

    .comment-time {
        font-size: 12px;
        color: #999;
    }

    .comment-content .text-muted {
    }

    /* ===== Zone d’entrée ===== */
    .comment-input-container,
    .viewer-input-container {
        padding: 16px 20px;
        border-top: 1px solid #f0f0f0;
        background: white;
    }

    .comment-input {
        border-radius: 20px;
        padding: 12px 16px;
        display: none;
    }

    .btn-send-comment {
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 8px;
    }

    /* ===== Animation ===== */
    @keyframes slideInUp {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .comment-item:nth-child(1) {
        animation-delay: 0.1s;
    }
    .comment-item:nth-child(2) {
        animation-delay: 0.2s;
    }
    .comment-item:nth-child(3) {
        animation-delay: 0.3s;
    }
    .comment-item:nth-child(4) {
        animation-delay: 0.4s;
    }

    .comment-item {
        border-bottom: none !important;
    }

    .live-comment {
        border-bottom: none !important;
    }

    .comment {
        border-bottom: none !important;
    }

    .comments-stack .comment-item {
        border-bottom: none !important;
    }
}
