/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8f9fa;
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header styles */
header {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

header p {
  font-size: 1.1rem;
  color: #6c757d;
}

/* Main content layout */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  flex: 1;
}

/* Controls panel */
.controls-panel {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  height: fit-content;
}

.recording-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary {
  background: #dc3545;
  color: white;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-download {
  background: #28a745;
  color: white;
}

.btn-icon {
  font-size: 1.1em;
}

/* Status indicator */
.status-indicator {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 1rem;
  margin-bottom: 2rem;
  text-align: center;
  border: 2px solid #e9ecef;
}

#recordingStatus {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.status-idle {
  color: #6c757d;
}

.status-recording {
  color: #dc3545;
  animation: pulse 2s infinite;
}

.status-paused {
  color: #ffc107;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.recording-timer {
  font-size: 1.5rem;
  font-weight: 700;
  color: #495057;
  font-family: 'Courier New', monospace;
}

/* Settings panel */
.settings-panel h3 {
  color: #495057;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.setting-group {
  margin-bottom: 1rem;
}

.setting-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #495057;
}

.setting-group select {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  transition: border-color 0.3s ease;
}

.setting-group select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.setting-group input[type="checkbox"] {
  margin-right: 0.5rem;
  transform: scale(1.2);
}

/* Video panel */
.video-panel {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.video-container {
  position: relative;
}

.video-container video {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.video-label {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.download-section {
  text-align: center;
  padding-top: 1rem;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 2rem;
  color: #6c757d;
  font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  header h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .controls-panel,
  .video-panel {
    padding: 1.5rem;
  }
  
  .recording-controls {
    flex-direction: column;
  }
  
  .btn {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.8rem;
  }
  
  header p {
    font-size: 1rem;
  }
  
  .controls-panel,
  .video-panel {
    padding: 1rem;
  }
}

/* Animation for smooth transitions */
.video-container,
.btn,
.setting-group select {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading states */
.btn.loading {
  position: relative;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.hidden {
  display: none;
}

.page {
  text-align: center;
  padding: 40px;
}

.settings-panel {
  display: inline-block;
  text-align: left;
  margin-top: 20px;
  border: 1px solid #ccc;
  padding: 20px;
  border-radius: 8px;
  background: #f9f9f9;
}

.setting-group {
  margin-bottom: 10px;
}

.video-container {
  margin-top: 20px;
}

.recording-controls {
  margin-top: 15px;
}

.btn {
  padding: 10px 20px;
  margin: 5px;
  cursor: pointer;
}

.btn-primary {
  background-color: #e74c3c;
  color: white;
  border: none;
}

.btn-secondary {
  background-color: #3498db;
  color: white;
  border: none;
}

#preview{
  width: 50%;
  border: 2px solid #3498db;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#startBtn {
  width: 30%;
  margin: 0 auto;
  display: block;
}