:root {
  --netflix-red: #e50914;
  --netflix-dark: #141414;
  --netflix-gray: #333;
  --netflix-light-gray: #757575;
  --netflix-white: #fff;
  --controls-height: 50px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--netflix-dark);
  color: var(--netflix-white);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.4;
  margin: 0;
  padding: 10px;
  min-height: 100vh;
  touch-action: manipulation;
}

body.embed-mode {
  padding: 0;
  background: #000;
  overflow: hidden;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 10px;
}

body.embed-mode .container {
  padding: 0;
}

.title {
  color: var(--netflix-red);
  margin-bottom: 20px;
  font-size: 1.8rem;
  text-align: center;
}

.input-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.input-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
  width: 100%;
}

.input-group input {
  padding: 10px 12px;
  width: 100%;
  max-width: 400px;
  border-radius: 4px;
  border: 1px solid var(--netflix-gray);
  background-color: rgba(0, 0, 0, 0.7);
  color: var(--netflix-white);
  font-size: 14px;
  outline: none;
}

.netflix-button {
  padding: 10px 20px;
  background: var(--netflix-red);
  color: var(--netflix-white);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.player-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto 20px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

body.embed-mode .player-wrapper {
  border-radius: 0;
  margin: 0;
}

.netflix-logo {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 80px;
  z-index: 100;
  opacity: 0.9;
}

:fullscreen .netflix-logo {
  width: 100px;
  top: 15px;
  right: 15px;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
}

body.embed-mode .video-container {
  padding-bottom: 0;
  height: 100vh;
}

video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

:fullscreen video {
  object-fit: contain !important;
}

.controls-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  padding: 8px 10px;
  z-index: 10;
  transition: opacity 0.3s;
}

.progress-container {
  width: 100%;
  margin-bottom: 5px;
}

.netflix-progress {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.netflix-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--netflix-red);
}

.main-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--controls-height);
}

.left-controls, .right-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-button {
  background: transparent;
  border: none;
  color: var(--netflix-white);
  font-size: 18px;
  padding: 5px;
}

.control-button.active {
  color: var(--netflix-red);
}

.volume-slider {
  width: 60px;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.2);
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--netflix-white);
}

.time-display {
  font-size: 12px;
  font-family: monospace;
}

/* Modal de ajustes */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  z-index: 10000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.embed-mode .modal {
  position: absolute;
}

.modal-content {
  background: var(--netflix-dark);
  margin: 20px auto;
  padding: 25px;
  width: calc(100% - 40px);
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 5px 30px rgba(0,0,0,0.6);
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--netflix-gray);
}

body.embed-mode .modal-content {
  top: 20px;
  transform: none;
  margin: 20px auto;
}

.modal-content h3 {
  margin-bottom: 20px;
  text-align: center;
  color: var(--netflix-red);
  font-size: 1.3rem;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--netflix-light-gray);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--netflix-gray);
  color: var(--netflix-white);
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 14px;
}

#saveSubSettings {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background: var(--netflix-red);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  font-size: 15px;
}

/* Estilos para móviles */
@media (max-width: 767px) {
  .container {
    padding: 5px;
  }
  
  .title {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }
  
  .netflix-logo {
    width: 70px;
  }
  
  .controls-container {
    padding: 5px 8px;
  }
  
  .control-button {
    font-size: 16px;
  }
  
  .volume-slider {
    width: 50px;
  }
  
  .time-display {
    font-size: 11px;
  }
  
  /* Modal en móviles */
  .modal-content {
    margin: 20px auto;
    width: calc(100% - 30px);
    padding: 20px 15px;
    top: 20px;
    transform: none;
  }
  
  body.embed-mode .modal-content {
    top: 10px;
    margin: 10px auto;
  }
  
  .form-group {
    margin-bottom: 15px;
  }
  
  #saveSubSettings {
    padding: 10px;
  }
}

/* Orientación horizontal en móviles */
@media screen and (orientation: landscape) {
  .video-container {
    height: 100vh;
    padding-bottom: 0;
  }
  
  .controls-container {
    padding: 5px 8px;
  }
  
  .control-button {
    font-size: 16px;
  }
  
  .time-display {
    font-size: 11px;
  }
  
  /* Modal en landscape */
  @media (max-height: 500px) {
    .modal-content {
      margin: 10px auto;
      padding: 15px;
      top: 10px;
    }
    
    body.embed-mode .modal-content {
      top: 5px;
    }
    
    .form-group {
      margin-bottom: 10px;
    }
  }
}

.error-message {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(229, 9, 20, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
    font-size: 14px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}