/* Smart TV OTT App Styles */

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Arial', sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
}

/* Canvas - Full screen with proper scaling */
#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Button Styles */
.btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  padding: 12px 20px;
  transition: all 0.3s ease;
  outline: none;
}

.btn:hover,
.btn:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
}

.btn-primary {
  background: rgba(0, 122, 255, 0.8);
  border-color: #007AFF;
}

.btn-primary:hover,
.btn-primary:focus {
  background: rgba(0, 122, 255, 1);
  border-color: #0056CC;
}

.btn-round {
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.btn-large {
  width: 96px;
  height: 96px;
  font-size: 32px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

/* Player Controls */
.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 20px;
  display: flex;
  align-items: center;
}

.player-controls > * {
  margin-right: 20px;
}

.player-controls > *:last-child {
  margin-right: 0;
}

.control-button {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  outline: none;
}

.control-button:hover,
.control-button:focus,
.control-button.focused {
  background: rgba(0, 122, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%; /* Ensure round buttons stay round */
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 122, 255, 0.5);
}

.control-button-small {
  width: 57px;
  height: 57px;
  font-size: 16px;
}

.control-button-large {
  width: 85px;
  height: 85px;
  font-size: 24px;
}

/* Progress Bar */
.progress-container {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin: 0 20px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8A2BE2, #1E90FF);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Time Display */
.time-display {
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  min-width: 120px;
  text-align: center;
}

/* Overlay Styles */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-content {
  background: rgba(20, 20, 20, 0.95);
  border-radius: 15px;
  padding: 30px;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
}

/* Loading Indicator */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #007AFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error Message */
.error {
  color: #ff4444;
  text-align: center;
  font-size: 18px;
  padding: 20px;
}

/* Movie Player Styles */
.movie-player-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 9998; /* Below AVPlay object (10000) */
  display: none;
}

.movie-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.movie-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10001; /* Above AVPlay object (10000) */
}

.movie-controls-container {
  position: absolute;
  bottom: 2%;
  left: 3%;
  right: 3%;
  background: rgba(0, 0, 0, 0.9);
  /* backdrop-filter removed for Tizen compatibility */
  border-radius: 20px;
  padding: 1.5% 2%;
  pointer-events: auto;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 100px;
  z-index: 10002; /* Above movie-overlay (10001) */
}

.movie-progress-section {
  margin-bottom: 25px;
}

.movie-progress-container {
  display: flex;
  align-items: center;
}

.movie-progress-container > * {
  margin-right: 20px;
}

.movie-progress-container > *:last-child {
  margin-right: 0;
}

.movie-progress-bar {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
}

.movie-progress-fill {
  height: 100%;
  background: white;
  border-radius: 5px;
  transition: width 0.3s ease;
}

.movie-time-display {
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  font-weight: bold;
  min-width: 80px;
  text-align: center;
}

.movie-main-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.movie-left-controls {
  display: flex;
  align-items: center;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}

.movie-center-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.movie-center-controls > * {
  margin-right: 20px;
}

.movie-center-controls > *:last-child {
  margin-right: 0;
}

.movie-right-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
}

.movie-right-controls > * {
  margin-right: 12px;
}

.movie-right-controls > *:last-child {
  margin-right: 0;
}

.movie-video-info {
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  margin: 0;
}

.movie-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.8), transparent);
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.movie-title {
  color: white;
  font-size: 28px;
  font-weight: bold;
}

.movie-close-button {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.movie-close-button:hover,
.movie-close-button:focus {
  background: rgba(255, 0, 0, 0.8);
  transform: scale(1.1);
}

.movie-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 24px;
  text-align: center;
  z-index: 10;
}

.movie-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ff4444;
  font-size: 24px;
  text-align: center;
  z-index: 10;
}

/* YouTube Player Styles */
.youtube-player-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.youtube-video-container {
  position: relative;
  width: 90%;
  height: 90%;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.youtube-video {
  width: 100%;
  height: 100%;
  /* object-fit: contain; - Not supported on old Smart TVs */
}

.youtube-close-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.youtube-close-button:hover,
.youtube-close-button:focus {
  background: rgba(255, 0, 0, 0.8);
  transform: scale(1.1);
}

.youtube-title {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 80px;
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  z-index: 10;
}

.youtube-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
  text-align: center;
  z-index: 10;
}

.youtube-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ff4444;
  font-size: 18px;
  text-align: center;
  z-index: 10;
}

.youtube-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 20px;
  display: flex;
  align-items: center;
}

.youtube-controls > * {
  margin-right: 20px;
}

.youtube-controls > *:last-child {
  margin-right: 0;
}

.youtube-play-button {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  width: 60px;
  height: 60px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.youtube-play-button:hover,
.youtube-play-button:focus {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.youtube-progress-container {
  flex: 1;
  display: flex;
  align-items: center;
}

.youtube-progress-container > * {
  margin-right: 15px;
}

.youtube-progress-container > *:last-child {
  margin-right: 0;
}

.youtube-progress-bar {
  flex: 1;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.youtube-progress-fill {
  height: 100%;
  background: #ff4444;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.youtube-time-display {
  color: white;
  font-size: 16px;
  min-width: 100px;
  text-align: center;
}

.youtube-volume-button {
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 10px;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.youtube-volume-button:hover,
.youtube-volume-button:focus {
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 1280px) {
  .btn {
    font-size: 14px;
    padding: 10px 16px;
  }
  
  .control-button-small {
    width: 50px;
    height: 50px;
    font-size: 14px;
  }
  
  .control-button-large {
    width: 75px;
    height: 75px;
    font-size: 20px;
  }
  
  .time-display {
    font-size: 16px;
    min-width: 100px;
  }
}

@media (max-width: 720p) {
  .btn {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .control-button-small {
    width: 45px;
    height: 45px;
    font-size: 12px;
  }
  
  .control-button-large {
    width: 65px;
    height: 65px;
    font-size: 18px;
  }
  
  .time-display {
    font-size: 14px;
    min-width: 80px;
  }
  
  .youtube-title {
    font-size: 20px;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-center {
  text-align: center;
}

.text-white {
  color: #fff;
}

.text-accent {
  color: #007AFF;
}

.bg-transparent {
  background: transparent;
}

.bg-dark {
  background: rgba(0, 0, 0, 0.8);
}

.rounded {
  border-radius: 8px;
}

.rounded-full {
  border-radius: 50%;
}

.shadow {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.transition {
  transition: all 0.3s ease;
}

/* Focus Styles for Smart TV */
.focusable:focus,
.focused {
  outline: 3px solid #007AFF;
  outline-offset: 2px;
  border-radius: inherit; /* Inherit border radius from parent */
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

.fade-out {
  animation: fadeOut 0.3s ease-out;
}

.scale-in {
  animation: scaleIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Movie Menu Styles */
.movie-menu {
  position: absolute;
  bottom: 270px;
  right: 50px;
  width: 360px;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 15px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 30;
}

.movie-menu-title {
  color: white;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

.movie-menu-button {
  display: block;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 14px 24px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  font-size: 19px;
  border-radius: 10px;
}

.movie-menu-button.focused {
  background: rgba(99, 102, 241, 0.8);
  border: 3px solid #6366f1;
  border-radius: 10px; /* Maintain consistent border radius */
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Movie Player Button Specific Styles */
.movie-skip-button {
  font-size: 16px;
}

.movie-audio-button {
  margin-right: 12px;
}

.movie-quality-button {
  margin-right: 12px;
}

/* Movie Player Responsive Fixes */
@media (max-width: 1280px) {
  .movie-controls-container {
    padding: 20px 30px;
    min-height: 120px;
  }
  
  .movie-progress-section {
    margin-bottom: 20px;
  }
  
  .control-button-large {
    width: 70px;
    height: 70px;
    font-size: 20px;
  }
  
  .control-button-small {
    width: 50px;
    height: 50px;
    font-size: 14px;
  }
  
  .movie-video-info {
    font-size: 16px;
  }
}
/
* Additional Movie Player Styles */
.hidden {
  display: none !important;
}

.loading-spinner {
  width: 80px;
  height: 80px;
  border: 6px solid rgba(255,255,255,0.3);
  border-top: 6px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.movie-video {
  object-fit: contain;
}

.movie-overlay {
  pointer-events: none;
}

.movie-controls-container {
  backdrop-filter: blur(20px);
}
/* Movie P
layer Loading Spinner */
.movie-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
}

.movie-loading-spinner-icon {
  width: 80px;
  height: 80px;
  border: 6px solid rgba(255,255,255,0.3);
  border-top: 6px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.movie-loading-text {
  color: white;
  font-size: 24px;
  text-align: center;
}

/* Movie Player Error Message */
.movie-error-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: #ff4444;
  padding: 30px 40px;
  border-radius: 10px;
  font-size: 24px;
  text-align: center;
  z-index: 10;
  display: none;
  pointer-events: none;
}

/* Movie Player Progress Section */
.movie-progress-section-container {
  margin-bottom: 20px;
}

.movie-progress-controls {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.movie-current-time {
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  min-width: 60px;
  margin-right: 12px;
}

.movie-progress-bar-container {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  position: relative;
  cursor: pointer;
  margin-left: 12px;
  margin-right: 12px;
}

.movie-progress-bar-fill {
  height: 100%;
  background: white;
  border-radius: 5px;
  width: 0%;
  position: relative;
}

.movie-duration-time {
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  min-width: 60px;
  margin-left: 12px;
}

/* Movie Player Main Controls */
.movie-main-controls-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  height: 60px;
}

.movie-left-controls-container {
  display: flex;
  align-items: center;
  flex-direction: column;
  min-width: 200px;
  justify-content: center;
}

.movie-center-controls-container {
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.movie-right-controls-container {
  display: flex;
  align-items: center;
  min-width: 200px;
  justify-content: flex-end;
}

/* Movie Player Buttons */
.movie-skip-back-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 57px;
  height: 57px;
  border-radius: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  font-size: 16px;
}

.movie-play-button-main {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 104px;
  height: 78px;
  border-radius: 21px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.movie-skip-forward-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 57px;
  height: 57px;
  border-radius: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 20px;
  font-size: 16px;
}

.movie-subtitle-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 85px;
  height: 55px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  margin-right: 12px;
}

.movie-audio-track-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 85px;
  height: 55px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  margin-right: 12px;
}

.movie-quality-select-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 85px;
  height: 55px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  margin-right: 12px;
}

.movie-fullscreen-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 85px;
  height: 55px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* Movie Player Top Bar */
.movie-top-bar-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(rgba(0,0,0,0.7), transparent);
  padding: 3% 2% 3%;
  pointer-events: auto;
  z-index: 10003;
}

.movie-close-button-top {
  position: absolute;
  top: 30px;
  right: 40px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Movie Player Video Info */
.movie-video-info-display {
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  padding: 6px 12px;
  display: inline-block;
  margin: 0;
}

/* YouTube Player Container */
.youtube-player-iframe-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
}