* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: white;
  padding: 20px 30px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 28px;
  color: #333;
  margin: 0;
}

.back-link {
  padding: 10px 20px;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
}

.back-link:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.recordings-section {
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

#downloads {
  display: grid;
  gap: 16px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

.download-item {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  gap: 12px;
  transition: all 0.3s;
}

.download-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.download-info {
  flex: 1;
}

.download-info .name {
  font-weight: 700;
  color: #333;
  font-size: 16px;
  word-break: break-word;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.download-info .meta {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.meta-item {
  display: inline-block;
  margin-right: 16px;
  margin-bottom: 4px;
}

.meta-label {
  font-weight: 600;
  color: #555;
}

.download-item .button-group {
  display: flex;
  gap: 10px;
}

.download-item button {
  flex: 1;
  font-size: 15px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.download-item button:first-child {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
}

.download-item button:first-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.download-item .delete-btn {
  background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
  color: white;
}

.download-item .delete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.download-item button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none !important;
  box-shadow: none !important;
}

.download-item button:active {
  transform: translateY(0) !important;
}

/* Status badge */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.recording {
  background: #ff4444;
  color: white;
  animation: pulse 2s infinite;
}

.status-badge.error {
  background: #ff9800;
  color: white;
}

.status-badge.completed {
  background: #4CAF50;
  color: white;
}

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

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: #666;
}

/* Messages */
.msg {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.5;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg.info {
  background: #e3f2fd;
  border-left: 4px solid #2196F3;
  color: #1565C0;
}

.msg.error {
  background: #ffebee;
  border-left: 4px solid #f44336;
  color: #c62828;
  font-weight: 500;
}

#messages {
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  header {
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    text-align: center;
  }

  header h1 {
    font-size: 24px;
  }

  .back-link {
    width: 100%;
    text-align: center;
  }

  .recordings-section {
    padding: 20px;
  }

  .download-item {
    padding: 16px;
  }

  .download-info .name {
    font-size: 14px;
  }

  .download-info .meta {
    font-size: 12px;
  }

  .meta-item {
    display: block;
    margin-right: 0;
  }

  .download-item .button-group {
    flex-direction: column;
  }

  .download-item button {
    width: 100%;
    font-size: 14px;
    padding: 12px;
  }
}

@media (max-width: 400px) {
  header h1 {
    font-size: 20px;
  }

  .download-item {
    padding: 12px;
  }
}
