/* =========================================================
   GustudsTV
   ========================================================= */

* {
   box-sizing: border-box;
   margin: 0;
   padding: 0;
}

html,
body {
   width: 100%;
   height: 100%;
}

body {
   font-family: Arial, sans-serif;
   background-color: #000;
   color: #fff;
   overflow: hidden;
}


/* =========================================================
   HEADER
   ========================================================= */

.header {
   height: 80px;
   background-color: #111;
   padding: 10px 20px;

   display: flex;
   align-items: center;

   border-bottom: 1px solid #333;
}

.header img {
   height: 55px;
   width: auto;
   max-width: 120px;
   object-fit: contain;
   margin-right: 15px;
}

.header h1 {
   font-size: 28px;
   font-weight: 600;
}


/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.main-container {
   display: flex;

   width: 100%;
   height: calc(100vh - 80px);
}


/* =========================================================
   PLAYER
   ========================================================= */

.player-container {
   flex: 3;

   position: relative;

   background-color: #000;

   display: flex;
   align-items: center;
   justify-content: center;

   min-width: 0;
}

.player-container video {
   width: 100%;
   height: 100%;

   background-color: #000;

   object-fit: contain;
}


/* =========================================================
   LOADING SPINNER
   ========================================================= */

.spinner-overlay {
   position: absolute;

   top: 0;
   left: 0;

   width: 100%;
   height: 100%;

   background: rgba(0, 0, 0, 0.6);

   display: flex;
   align-items: center;
   justify-content: center;

   z-index: 10;

   display: none;
}

.spinner {
   border: 8px solid #333;
   border-top: 8px solid #3498db;

   border-radius: 50%;

   width: 60px;
   height: 60px;

   animation: spin 1s linear infinite;
}

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


/* =========================================================
   CHANNEL PANEL
   ========================================================= */

.channel-list {
   flex: 1;

   min-width: 300px;
   max-width: 420px;

   background-color: #181818;

   padding: 12px;

   overflow-y: auto;
}


/* =========================================================
   SEARCH
   ========================================================= */

.search-container {
   margin-bottom: 10px;
}

#searchInput {
   width: 100%;

   padding: 12px 14px;

   background-color: #0d0d0d;

   color: #fff;

   border: 1px solid #444;
   border-radius: 6px;

   font-size: 17px;

   outline: none;
}

#searchInput:focus {
   border-color: #3498db;
}

#searchInput::placeholder {
   color: #888;
}


/* =========================================================
   CATEGORIES
   ========================================================= */

.categories-container {
   display: flex;

   flex-wrap: wrap;

   gap: 6px;

   margin-bottom: 12px;
}

.category {
   background-color: #292929;

   color: #ddd;

   border: 1px solid #444;

   border-radius: 5px;

   padding: 8px 12px;

   cursor: pointer;

   font-size: 14px;

   transition:
      background-color 0.15s ease,
      border-color 0.15s ease;
}

.category:hover {
   background-color: #3a3a3a;
}

.category.active {
   background-color: #3498db;

   color: #fff;

   border-color: #3498db;
}


/* =========================================================
   CHANNELS
   ========================================================= */

#channelsContainer {
   width: 100%;
}

.channel {
   padding: 11px 12px;

   margin-bottom: 4px;

   border-bottom: 1px solid #333;

   background-color: #202020;

   color: #eee;

   cursor: pointer;

   border-radius: 4px;

   font-size: 15px;

   transition:
      background-color 0.12s ease,
      padding-left 0.12s ease;
}

.channel:hover {
   background-color: #303030;
}

.channel.selected {
   background-color: #3498db;

   color: #fff;

   border-color: #3498db;

   padding-left: 16px;
}


/* =========================================================
   NO RESULTS
   ========================================================= */

.no-results {
   padding: 25px 10px;

   text-align: center;

   color: #888;

   font-size: 15px;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

.channel-list::-webkit-scrollbar {
   width: 8px;
}

.channel-list::-webkit-scrollbar-track {
   background: #111;
}

.channel-list::-webkit-scrollbar-thumb {
   background: #444;

   border-radius: 4px;
}

.channel-list::-webkit-scrollbar-thumb:hover {
   background: #555;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

   body {
      overflow: auto;
   }

   .main-container {
      flex-direction: column;

      height: auto;
   }

   .player-container {
      width: 100%;
      height: 50vh;
   }

   .channel-list {
      width: 100%;
      max-width: none;
      min-width: 0;

      height: 50vh;
   }
}

/* =========================================================
   КАНАЛ
   ========================================================= */

.channel {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* =========================================================
   ЛОГОТИП КАНАЛА
   ========================================================= */

.channel-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}


/* =========================================================
   НАЗВАНИЕ
   ========================================================= */

.channel-title {
    flex: 1;
    min-width: 0;
}


/* =========================================================
   КНОПКА ИЗБРАННОГО
   ========================================================= */

.favorite-button {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
}

.favorite-button:hover {
    transform: scale(1.15);
}


/* =========================================================
   ВЫБРАННЫЙ КАНАЛ
   ========================================================= */

.channel.selected {
    outline: 2px solid #fff;
    outline-offset: -2px;
}


/* =========================================================
   КАТЕГОРИЯ В ФОКУСЕ
   ========================================================= */

.category:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}


/* =========================================================
   ПОИСК В ФОКУСЕ
   ========================================================= */

#searchInput:focus {
    outline: 2px solid #fff;
}