@media screen and (max-width: 960px) {
     .video-grid.double {
        height: unset !important;
        margin: 20px;
        padding: 12px !important;
        margin-top: unset !important;
    }
    .notification {
        width: 320px;
        text-align: center;
        padding: 5px;
    }

    .header {
        height: 56px;
        padding: 8px 16px;
    }

    .logo {
        margin-left: 0;
        width: 54px;
        height: 20px;
    }

    .header-controls {
        margin-right: 0;
        width: 40px;
        height: 40px;
    }

    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 50%;
        border-left: none;
        border-top: 1px solid #2a2d3a;
        padding-bottom: 50px;
    }

    .chat-input-container {
        width: 100% !important;
        background: #0A0D18 !important;
    }

    .chat-profile-icon {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute;
        left: 23px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        pointer-events: none;
    }

    .profile-img-icon {
        width: 27px;
        height: 27px;
    }

    .chat-profile-icon .profile-button {
        width: 24px;
        height: 24px;
    }

    .chat-profile-icon .profile-button-inner {
        font-size: 12px;
    }

    #chatInput {
        padding-left: 52px !important;
    }

 .camera-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        padding: 10px;
        justify-content: center; 
        align-items: center;     
        overflow-y: auto;
        margin: 0 auto;          
        width: fit-content;      
    }

    .camera-item {
        width: 100%;
        margin-bottom: 0;
        flex-basis: auto;
    }

    .camera-preview {
        height: 100px;
    }

    .active-info {
        font-size: 12px;
        margin-top: 10px;
        margin-bottom: unset;
    }

    .video-grid-container {
        padding: unset;
    }

    .video-grid.single .video-item {
        grid-area: 1 / 1 / span 2 / span 2;
        height: auto;
        transform-origin: center;
    }

    .video-controls button {
        width: 32px !important;
        height: 32px !important;
        border-radius: 16px !important;
        font-size: 16px !important;
    }

    .fullscreen-btn {
        width: 100%;
    }

    #sendMessageBtn {
        background: white;
        color: black;
        border: 1px solid white;
    }
}

@media screen and (max-width: 960px) and (orientation: landscape) {
    .dashboard {
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }
    .header {
        display: none !important;
    }

    .sidebar-open .header {
        opacity: 0;
        pointer-events: none;
    }

    .main-content {
        display: flex;
        position: relative;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }

    .video-grid-container {
        position: relative;
        flex: 1;
        height: 100%;
        transition: width 0.3s ease, transform 0.3s ease;
        will-change: width, transform;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .video-grid-container:not(.sidebar-open) {
        right: 68px;
        left: 0;
        position: absolute;
        width: calc(100vw - 68px);
        max-width: calc(100vw - 68px);
    }

    .video-grid-container.sidebar-open {
        width: calc(100vw - 307px);
        max-width: calc(100vw - 307px);
        margin-right: 0;
        margin-left: 0;
        left: 0;
        right: 307px;
        position: absolute;
    }

    .video-grid {
        max-height: 100%;
        padding: 12px;
        display: grid;
        gap: 4px;
        overflow: hidden;
        width: 80%;
    }

    .sidebar-open .video-grid {
        max-width: 100% !important;
        gap: 4px;
    }

    .video-grid.single {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .video-grid.single .video-item {
        width: 100%;
        max-width: calc(100% - 24px);
        height: auto;
        max-height: calc(100vh - 24px);
        aspect-ratio: 16 / 9;
        border-radius: 16px;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-open .video-grid.single .video-item {
        width: calc(100% - 24px);
        max-height: calc(100vh - 24px);
        aspect-ratio: 16 / 9;
    }

    .video-item {
        position: relative;
        border-radius: 16px;
        overflow: hidden;
        max-height: 100%;
        aspect-ratio: 16 / 9;
    }

    .video-item video,
    .video-item .video-js {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .sidebar {
        position: fixed;
        left: 100%;
        top: 0;
        width: 254px;
        height: 100%;
        margin: 0;
        padding: 0;
        background-color: rgba(10, 13, 24, 0.95);
        border-radius: 16px 0 0 16px;
        display: none;
        z-index: 1001;
        overflow: hidden;
        transform: translateX(0);
    }

    .sidebar.open {
        transform: translateX(-307px);
        display: block;
    }

    .sidebar .tabs {
        display: none !important;
    }

    .sidebar .tab-content {
        padding-top: 0;
        height: 100vh;
        overflow-y: auto;
    }

    #camerasTab, #chatTab {
        padding-top: 0 !important;
        overflow-x: hidden;
        padding: unset;
    }

    #chatContent {
        overflow-x: hidden;
        padding: 16px;
    }

    .chat-message {
        max-width: 222px;
        word-break: break-word;
    }

    .camera-list {
        display: block!important;
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        height: calc(100vh - 32px);
        align-items: center;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 100px;;
    }

    .camera-list .camera-item,
    .camera-list .camera-preview {
        width: 222px;
        height: 120px;
        border-radius: 8px;
    }

    .camera-list .camera-item.active {
        border-radius: 8px;
        margin: 0;
        background: rgba(255, 255, 255, 0.1);
    }

    .camera-list .camera-preview {
        border-radius: 8px;
        margin-bottom: 0;
    }

    .camera-list .camera-item:hover {
        transform: translateY(-2px);
    }

    .camera-list .camera-item.active {
        background: rgba(255, 255, 255, 0.2);
    }

    .camera-list::-webkit-scrollbar {
        width: 4px;
        height: 0;
    }

    .camera-list::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
    }

    .camera-list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }


    #camerasTab {
        height: 100%;
        overflow: hidden;
    }

    #chatTab {
        height: calc(100% - 76px);
        overflow-y: auto;
    }

    .chat-input-container {
        width: 90% !important;
        background: #0A0D18 !important;
    }

    #chatInput {
        width: 80% !important;
    }
    .video-label{
        font-size: 14px !important;
        left: unset;
    }

    .menu-item {
        width: 48px;
        height: 48px;
        background-color: rgba(10, 13, 24, 0.9);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 2px solid transparent;
        margin: 5px 0;
    }

    .menu-item:hover {
        background-color: rgba(10, 13, 24, 1);
        transform: scale(1.05);
    }


    .mobile-landscape-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1001;
    }

    .mobile-landscape-menu.show-menu {
        position: fixed;
        top: 50%;
        right: 0;
        transform: translateY(-50%);
        width: 68px;
        height: 430px;
        background-color: #0a0d18;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 16px;
        gap: 10px;
        z-index: 1001;
        list-style: none;
        margin: 0;
    }
}

@media screen and (max-width: 768px) and (orientation: portrait) {
    .camera-list .camera-item,
    .camera-list .camera-preview {
        width: 100%;
        height: 110px;
    }

    .camera-name {
        font-size: 11px;
    }
}
@media screen and (max-width: 960px) and (orientation: portrait) {
    .video-label{
        font-size: 10px !important;
        top: 10px;
        left: unset;
    }
}

/* Show .active-info only when .sidebar is open */
.sidebar.open + .main-content .active-info,
.sidebar.open .active-info {
    display: block !important;
}
.hide-fullscreen-btn {
    display: none !important;
}

@media screen and (max-width: 768px) {
    .privacy-modal {
        align-items: flex-end;
        justify-content: center;
    }

    .privacy-modal-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0px 0px 32px;
        width: 100%;
        max-width: 430px;
        height: auto;
        max-height: 90vh;
        background: radial-gradient(37.01% 37.01% at 12.99% 6.86%, #050E2F 0%, #0A0D18 100%);
        border-radius: 24px 24px 0px 0px;
        animation: slideInUp 0.3s ease-out;
        overflow-y: auto;
        justify-content: flex-start;
        box-sizing: border-box;
    }

    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .privacy-modal-selector {
        display: block;
        width: 64px;
        height: 4px;
        background: #95969B;
        border-radius: 2px;
        margin: 16px 0;
        flex-shrink: 0;
    }

    .privacy-modal-messaging {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 24px 32px 0px;
        gap: 32px;
        width: 100%;
        flex: none;
        align-self: stretch;
    }

    .privacy-modal-title {
        width: 100%;
        max-width: 366px;
        height: 80px;
        font-size: 32px;
        line-height: 40px;
        margin: 0;
        text-align: left;
    }

    .privacy-modal-body {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0px;
        gap: 12px;
        width: 100%;
        max-width: 366px;
    }

    .privacy-modal-body .privacy-modal-intro + .privacy-modal-rules {
        margin-top: 28px;
    }

    .privacy-modal-body .privacy-modal-rules + .privacy-modal-footer-text {
        margin-top: 28px;
    }

    .privacy-modal-intro {
        font-size: 12px;
        line-height: 20px;
        letter-spacing: 0.0012em;
        width: 100%;
        margin: 0;
    }

    .privacy-modal-rules {
        font-size: 12px;
        line-height: 20px;
        letter-spacing: 0.0012em;
        width: 100%;
        padding-left: 20px;
        margin: 0;
    }

    .privacy-modal-rules li {
        margin-bottom: 16px;
    }

    .privacy-modal-rules li:last-child {
        margin-bottom: 0;
    }

    .privacy-modal-footer-text {
        font-size: 12px;
        line-height: 20px;
        letter-spacing: 0.0012em;
        width: 100%;
        margin: 0;
    }

    .privacy-modal-footer {
        padding: 0;
        width: 100%;
        max-width: 366px;
        margin-top: 0;
    }

    .privacy-accept-btn {
        width: 100%;
        max-width: 366px;
        height: 48px;
        padding: 12px 24px;
        gap: 16px;
        font-size: 16px;
        line-height: 20px;
    }

    .privacy-modal-content::-webkit-scrollbar {
        width: 4px;
    }

    .privacy-modal-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .privacy-modal-content::-webkit-scrollbar-thumb {
        background: rgba(149, 150, 155, 0.3);
        border-radius: 2px;
    }

    .privacy-modal-content::-webkit-scrollbar-thumb:hover {
        background: rgba(149, 150, 155, 0.5);
    }
}

@media screen and (max-width: 960px) and (orientation: landscape) {
    .privacy-modal {
        align-items: stretch;
        justify-content: flex-end;
    }

    .privacy-modal-overlay {
        background: rgba(10, 13, 24, 0.9);
    }

    .privacy-modal-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 40px 48px;
        width: 494px;
        max-width: 70%;
        height: 100%;
        background: radial-gradient(37.01% 37.01% at 12.99% 6.86%, #050E2F 0%, #0A0D18 100%);
        border-radius: 18px 0px 0px 18px;
        animation: slideInRight 0.3s ease-out;
        overflow-y: auto;
        overflow-x: hidden;
        box-sizing: border-box;
    }

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

    .privacy-modal-selector {
        display: none;
    }

    .privacy-modal-messaging {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 10px;
        width: 100%;
        flex: none;
    }

    .privacy-modal-title {
        width: 100%;
        height: auto;
        font-family: 'Inter', sans-serif;
        font-style: normal;
        font-weight: 600;
        font-size: 28px;
        line-height: 36px;
        background: white;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin: 0;
        text-align: left;
    }

    .privacy-modal-codigo {
        background: linear-gradient(138.46deg, #CA2173 5.46%, #FF5900 56.85%);
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        font-weight: bold;
    }

    .privacy-modal-body {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0px;
        gap: 0px;
        width: 100%;
    }

    .privacy-modal-intro {
        font-size: 12px;
        line-height: 18px;
        letter-spacing: 0.0012em;
        width: 100%;
        margin: 0;
    }

    .privacy-modal-rules {
        font-size: 12px;
        line-height: 18px;
        letter-spacing: 0.0012em;
        width: 100%;
        padding-left: 18px;
        margin: 0;
    }

    .privacy-modal-rules li {
        margin-bottom: 12px;
    }

    .privacy-modal-rules li:last-child {
        margin-bottom: 0;
    }

    .privacy-modal-footer-text {
        font-size: 12px;
        line-height: 18px;
        letter-spacing: 0.0012em;
        width: 100%;
        margin: 0;
    }

    .privacy-modal-footer {
        padding: 0;
        width: 100%;
        margin-top: 20px;
    }

    .privacy-accept-btn {
        width: 100%;
        height: 48px;
        padding: 12px 24px;
        gap: 16px;
        font-size: 14px;
        line-height: 20px;
    }

    .report-modal-footer {
        display: flex;
        flex-direction: row;
        gap: 12px;
        margin-top: 20px;
    }

    .report-modal-footer .privacy-accept-btn,
    .report-modal-footer .report-cancel-btn {
        flex: 1;
        font-size: 14px;
    }

    .privacy-modal-content::-webkit-scrollbar {
        width: 4px;
    }

    .privacy-modal-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .privacy-modal-content::-webkit-scrollbar-thumb {
        background: rgba(149, 150, 155, 0.3);
        border-radius: 2px;
    }

    .privacy-modal-content::-webkit-scrollbar-thumb:hover {
        background: rgba(149, 150, 155, 0.5);
    }
}