/* CSS Specification: Responsive Layout and Modern Design */

/* Main Container */
.app-container {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 80px); /* Adjust for header */
  width: 100%;
  margin-top: 20px;
}

/* Header */
header {
  background-color: #0d6efd;
  color: white;
  padding: 1rem;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

/* Form Section (1/3 width) */
.upload-form {
  flex: 1;
  padding: 20px;
  background-color: #f8f9fa;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
  min-width: 300px;
}

/* Video Player Section (2/3 width) */
.video-player {
  flex: 2;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background-color: #212529;
  color: #ffffff;
  min-width: 500px;
}

/* Form Sections */
.form-section {
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.form-section h2 {
  font-size: 1.3rem;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: #212529;
}

/* Upload Areas */
.upload-area {
  border: 2px dashed #dee2e6;
  border-radius: 0.375rem;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-area:hover {
  border-color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.05);
}

.upload-area.drag-over {
  border-color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.1);
}

.upload-btn {
  background-color: #0d6efd;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
  font-size: 1rem;
}

.upload-btn:hover {
  background-color: #0b5ed7;
}

/* Buttons */
button {
  display: inline-block;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.record-button {
  background-color: #dc3545;
  color: white;
  margin-right: 10px;
}

.record-button:hover {
  background-color: #bb2d3b;
}

.stop-button {
  background-color: #6c757d;
  color: white;
}

.stop-button:hover {
  background-color: #5c636a;
}

.play-button {
  background-color: #198754;
  color: white;
}

.play-button:hover {
  background-color: #157347;
}

/* Recording Status */
.recording-status {
  margin-top: 1rem;
  padding: 0.5rem;
  text-align: center;
  font-style: italic;
  color: #6c757d;
}

/* File Info */
.file-info {
  margin-top: 1rem;
  padding: 0.5rem;
  background-color: #e9ecef;
  border-radius: 0.25rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

/* Image Preview */
.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.image-preview img {
  max-width: 100px;
  max-height: 100px;
  border-radius: 0.25rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Video Player */
.player-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

video {
  width: 100%;
  max-height: 70vh;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  background-color: #000;
}

.video-controls {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin-top: 1rem;
  padding: 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.25rem;
}

#volume-slider {
  flex: 1;
  margin: 0 1rem;
}

/* Playlist */
.playlist {
  margin-top: 2rem;
  width: 100%;
  max-width: 600px;
}

.playlist h3 {
  margin-top: 0;
  border-bottom: 1px solid #495057;
  padding-bottom: 0.5rem;
}

#video-playlist {
  list-style-type: none;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
}

#video-playlist li {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background-color: #343a40;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

#video-playlist li:hover {
  background-color: #495057;
}

/* Error Notification */
.error-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #dc3545;
  color: white;
  padding: 1rem;
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    height: auto;
  }

  .upload-form {
    border-right: none;
    border-bottom: 1px solid #dee2e6;
    min-width: auto;
  }

  .video-player {
    min-width: auto;
  }

  .recording-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .record-button {
    margin-right: 0;
  }
}

/* Large devices (desktops, 1200px and up) */
@media (min-width: 1200px) {
  .upload-form {
    max-width: 400px;
  }

  .video-player {
    min-width: 800px;
  }
}

/* Medium devices (tablets, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
  .upload-form {
    max-width: 350px;
  }
}

/* Small devices (landscape phones, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
  .upload-form {
    max-width: 300px;
  }
}