:root {
  color-scheme: dark;
  font-family: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --theme-primary: #85becc;
  --theme-secondary: #809398;
  --theme-light: #000000;
  --theme-dark: #f5f5f2;
  --radius: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--theme-dark);
  color: var(--theme-light);
  font-weight: 200;
  padding: 1rem;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 400px;
  height: 400px;
  background: url('img/logo-docks-design-inline-20-04.svg') no-repeat bottom right;
  background-size: contain;
  transform: rotate(-6deg);
  z-index: -1;
  pointer-events: none;
}

.player {
  width: 100%;
  max-width: 980px;
  display: grid;
  gap: 0.8rem;
}

video {
  width: 100%;
  border-radius: var(--radius);
  background: var(--theme-dark);
  max-height: 70vh;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

button {
  border: 0;
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  background: var(--theme-light);
  color: var(--theme-dark);
  font-weight: 300;
  cursor: pointer;
}

button:hover {
  background: var(--theme-light);
}

#status {
  opacity: 0.9;
  font-size: 0.9rem;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

.modal-overlay.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--theme-dark);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-actions button {
  flex: 1;
  padding: 0.6rem 0.9rem;
  background: var(--theme-light);
  color: var(--theme-dark);
}

.modal-close {
  background: var(--theme-light);
  padding: 0.4rem 0.6rem;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--theme-dark);
}

.modal-close:hover {
  background: var(--theme-light);
}

.video-grid-wrapper {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.video-item {
  padding: 0.5rem;
  border-radius: var(--radius);
  background: var(--theme-primary);
  color: var(--theme-dark);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.video-item:hover {
  background: var(--theme-light);
}

.video-item input[type="checkbox"] {
  margin-top: 0.25rem;
  cursor: pointer;
  accent-color: var(--theme-dark);
  flex-shrink: 0;
}

.video-item label {
  cursor: pointer;
  font-size: 0.75rem;
  word-break: break-word;
}

.modal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--theme-secondary);
}

.modal-tab-btn {
  border: 0;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--theme-light);
  font-weight: 300;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  opacity: 0.6;
}

.modal-tab-btn.active {
  border-bottom-color: var(--theme-primary);
  opacity: 1;
}

.modal-tab-btn:hover {
  opacity: 0.8;
}

.modal-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
}

.modal-tab-content.active {
  display: flex;
  flex-direction: column;
}

.upload-area {
  border: 2px dashed var(--theme-primary);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(133, 190, 204, 0.05);
}

.upload-area:hover {
  background: rgba(133, 190, 204, 0.1);
  border-color: var(--theme-secondary);
}

.upload-area.drag-over {
  background: rgba(133, 190, 204, 0.2);
  border-color: var(--theme-light);
}

.upload-area p {
  margin: 0;
  color: var(--theme-secondary);
}

#upload-status {
  margin-top: 1rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  display: none;
}

#upload-status.success {
  background: rgba(133, 190, 204, 0.2);
  color: var(--theme-primary);
}

#upload-status.error {
  background: rgba(255, 100, 100, 0.2);
  color: #ff6464;
}

#file-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  padding: 0.75rem;
  background: var(--theme-light);
  color: var(--theme-dark);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-item-name {
  flex: 1;
  font-size: 0.9rem;
}

.file-item-remove {
  background: none;
  border: 0;
  color: var(--theme-dark);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 1rem;
}


  body::before {
    width: min(34vw, 180px);
    height: min(34vw, 180px);
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 5.5rem;
  }

  body::before {
    top: 0.75rem;
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(44vw, 150px);
    height: min(44vw, 150px);
    background-position: center top;
    transform: translateX(-50%) rotate(-6deg);
  }
}

@media (max-width: 768px) and (orientation: portrait) {
  body {
    padding-top: 6.5rem;
  }

  body::before {
    width: min(62vw, 220px);
    height: min(62vw, 220px);
  }
}
