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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    background-image: url('../assets/images/background.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-color: #220d21;
    overflow: hidden;
}

#unsupported-browser-overlay {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #220d21 url('../assets/images/background.jpg') no-repeat center center;
    background-size: cover;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    text-align: center;
    padding: 20px;
}

.dashboard {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 0 24px;
    height: 90px;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    margin-left: 65px;
}

.header-controls {
    display: flex;
    gap: 4px;
    margin-right: 76px;
}

.profile-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #D5FF7C, #00EB26, #004352);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-button-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #0B0B14;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: white;
}

.profile-button-image {
    background-color: #0B0B14;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 8px;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: auto;
}

.video-grid-container {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

}

.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 90%;
    justify-content: center;
    align-items: center;
    gap: 4px;
    position: relative;
}

.video-grid.single .video-item {
    grid-area: 1 / 1 / span 2 / span 2;
    width: 100%;
    height: 100%;
}

.video-grid.double {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    height: 100%;
}

.video-grid.double .video-item {
    width: 48%;
    padding-bottom: 26.25%!important;
}

.video-grid.triple {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    justify-items: center;
    align-items: center;
}

.video-grid.triple > :nth-child(1),
.video-grid.triple > :nth-child(2) {
    align-self: end;
}

.video-grid.triple > :nth-child(3) {
    align-self: start;
}

.video-grid.triple .video-item:nth-child(3) {
    grid-column: 1 / span 2;
    width: 50%;
    padding-bottom: 26.25%!important;
}

.video-grid.quad {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.video-grid.quad > :nth-child(1),
.video-grid.quad > :nth-child(2) {
    align-self: end;
}

.video-grid.quad > :nth-child(3),
.video-grid.quad > :nth-child(4) {
    align-self: start;
}

.video-item {
    overflow: hidden;
    position: relative;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    width: 100%;
    padding-bottom: 56.25%;
    flex-shrink: 1;
    min-width: 0;
    border-radius: 16px;
}

.video-item video,
.video-item .video-js,
.video-item .camera-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

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

.video-item.active {
    border: 4px solid transparent;
}

.video-item.active-border {
    border: 4px solid #ffffff !important;
}

.video-controls {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: flex;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    z-index: 1000000;
}

.video-controls button {
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-label {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

.video-item::before,
.video-item .video-label,
.video-item .video-controls {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000000;
}

#videoGrid.hovering .video-item::before,
#videoGrid.hovering .video-item .video-label,
#videoGrid.hovering .video-item .video-controls {
    opacity: 1;
    pointer-events: auto;
    z-index: 1000000;
}

.video-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 15%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.6) 40%, transparent 100%);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.no-cameras {
    display: flex;
    align-items: center;
    justify-content: start;
    color: #8892b0;
    font-size: 18px;
    height: 100%;
}

.grid-info {
    text-align: center;
    color: #8892b0;
    font-size: 14px;
}

.active-info {
    margin-top: 10px;
    text-align: left;
    color: #95969B;
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 24px;
    letter-spacing: 0.12%;
    align-self: flex-start;
    margin-left: 5%;
}

.sidebar {
    width: 414px;
    background-color: #0A0D18BF;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    margin-right: 100px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 2px solid white;
}

.camera-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100%;
}

.camera-item {
    border-radius: 12px;
    padding: 0px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}

.camera-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.6) 40%, transparent 100%);
    pointer-events: none;
    z-index: 99;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.camera-preview {
    width: 100%;
    height: 170px;
    background-color: #0a0d18;
    overflow: hidden;
    margin-bottom: 5px;
    position: relative;
    border-radius: 16px;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(35px);
    background: linear-gradient(to bottom, #0A0D184D 30%, #0A0D184D);
    z-index: 1;
    border-radius: 16px;
}

.camera-label {
    position: absolute;
    top: 40%;
    left: 5%;
    background-color: #0A0D18BF;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    width: 90%;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

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

.camera-controls {
    position: absolute;
    top: 8%;
    left: 8px;
    display: flex;
}

.camera-info {
    display: flex;
    flex-direction: column;
}

.camera-name {
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    z-index: 99;
}

.camera-status {
    font-size: 12 pair;
    color: #06d6a0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.camera-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: #06d6a0;
    border-radius: 50%;
}

.camera-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background-image: url('/assets/images/radio_button_empty.svg');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    border: none;
    background-color: transparent;
    cursor: pointer;
    z-index: 999999;
}

.camera-toggle.active {
    background-image: url('/assets/images/radio_button_filled.svg');
}

.notification {
    position: absolute;
    bottom: 2rem;
    background-color: #FFFFFF;
    color: #0A0D18;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 320px;
    width: 816px;
    height: 56px;
}

.notification.show {
    opacity: 1;
    visibility: visible;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;

    @media screen and (max-width: 768px) {
        padding: 8px;
    }
}

.notification-message {
    font-size: 14px;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: 16px;
    line-height: 1;
}

.notification-close:hover {
    opacity: 0.8;
}

.fullscreen-btn {
    background-color: #0A0D18BF;
    color: white;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    margin-top: 2rem;
    font-size: 16px;
    width: 360px;
    height: 48px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
}

#volumeButton {
    pointer-events: none;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: none;
    z-index: 10;
}

.video-play-button:hover {
    background: #21242E;
}

.video-item.active .video-play-button {
    display: block;
}

.video-js {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.camera-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.video-js .vjs-big-play-button {
    font-size: 3em;
    line-height: 1.5em;
    height: 1.5em;
    width: 3em;
    border-radius: 0.3em;
}

.tv-play-overlay {
  position: absolute;
  top: 0; 
  left: 0; 
  
  right: 0; 
  bottom: 0;
  background: rgb(0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

video::-webkit-media-controls {
    display: none !important;
    -webkit-appearance: none;
}

.tabs {
    display: flex;
    margin-bottom: 10px;
    color: white;
    padding: 24px 24px 0px 24px;
}

#camerasTab {
    padding: 24px;
    padding-bottom: 100px;
    @media screen and (max-width: 768px) {
        padding: 0px;
    }
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 0px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #95969B;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
    margin-right: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.tab-button.active {
    border-bottom-color: white;
    color: white;
}

.active-count {
    b {
        font-family: 'Inter', sans-serif;
        font-weight: 700;
    }
}

#chatContent {
    height: 74vh;
    overflow-y: auto;
    padding: 24px;
    font-family: 'Inter', sans-serif;
    color: #C3C4C6;
    overflow-x: clip;
}

.chat-message {
    padding: 10px 0;
    font-size: 14px;
    word-break: break-word;
    overflow-wrap: anywhere;
    color: #C3C4C6;
}

.chat-message.my-message {
    text-align: right;
    border-right: 2px solid #2ecc71;
    margin-bottom: 5px;
    padding-right: 15px;
}

.chat-input-container {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #0A0D18BF;
    position: fixed;
    bottom: 0;
    width: 414px;
}

#chatInput {
    flex: 1;
    padding: 8px;
    border: 2px solid #C3C4C6;
    border-radius: 30px;
    background: #0A0D18;
    color: #95969B;
    margin-top: 10px;
    margin-bottom: 10px;
    min-height: 40px;
}

#sendMessageBtn {
    margin-left: 10px;
    padding: 8px 16px;
    background: transparent;
    color: #95969B;
    border: 1px solid #95969B;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 10px;
    min-height: 40px;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: #0A0D18BF;
    border-radius: 30px;
}

::-webkit-scrollbar-thumb {
    background: #F2F2F233;
    border-radius: 30px;
}

::-webkit-scrollbar-thumb:hover {
    background: #F2F2F233;
}

.video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-loader.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.video-loader.dots {
    display: flex;
    gap: 4px;
}

.video-loader.dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ffffff;
    animation: pulse 1.5s ease-in-out infinite;
}

.video-loader.dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.video-loader.dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.video-loader.dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.no-access {
    color: white;
}

.mobile-landscape-menu {
    display: none;
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 68px;
    height: 430px;
    background-color: rgba(10, 13, 24, 0.75);
    border-radius: 8px;
}

@media screen and (max-width: 1200px) {
    .sidebar {
        width: 280px;
    }

    .chat-input-container {
        width: 280px !important;
    }
}

#active-cameras{
    font-weight: 500;
    color: #ffffff;
}

/** TESING */
#testText {
   overflow: auto;
}

.rotation-prompt-overlay {
    margin-top: 80px;
    position: absolute;
    top: 65%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}
.rotation-prompt-landscape-overlay{
      position: absolute;
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
background-color: rgba(33, 36, 46, 0.9);
}
.rotation-prompt-content {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: -50px;
}

.rotation-animation {
    max-width: 90px;
    max-height: 90px;
    margin-bottom: 20px;
    animation: rotateAnimation 2s infinite ease-in-out;
}

.rotation-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

@keyframes rotateAnimation {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(90deg);
    }
}

@media 
  (max-device-width: 1290px) 
  and (orientation: landscape) { 
     .video-grid-container {
            padding-bottom: 100px;
        }
}