/* Dark Festival Design - Gold & Cyan */
:root {
  --bg-dark: #1a1a1a;
  --bg-darker: #0f0f0f;
  --bg-card: #252525;
  --gold: #ffd700;
  --cyan: #00ffff;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --error: #ff4444;
  --success: #44ff44;
  --border: #333333;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Common */
.hidden {
  display: none !important;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  margin: 10px 0;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #ffed4e);
  color: var(--bg-dark);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ffed4e, var(--gold));
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.btn-success {
  background: linear-gradient(135deg, #44ff44, #00ff88);
  color: var(--bg-dark);
}

.btn-danger {
  background: linear-gradient(135deg, #ff4444, #ff6666);
  color: white;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  margin: 20px 0;
  border: 1px solid var(--border);
}

/* Forms */
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select,
.form-control {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  background: var(--bg-darker);
  color: var(--text-primary);
  border: 2px solid var(--border);
  border-radius: 8px;
  margin: 10px 0;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cyan);
}

.form-group {
  margin: 20px 0;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Loading */
.loading-spinner {
  border: 4px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

/* Login Screen */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.logo {
  text-align: center;
  font-size: 48px;
  margin-bottom: 40px;
  text-shadow: 0 0 20px var(--gold);
}

/* Navigation */
.navbar {
  background: var(--bg-darker);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
}

.nav-logo {
  font-size: 24px;
  margin-bottom: 12px;
  text-align: center;
}

.nav-menu {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-item {
  flex: 1;
  min-width: 80px;
  padding: 12px 8px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s;
}

.nav-item.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Feed */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feed-item {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s;
}

.feed-item:active {
  transform: scale(0.98);
}

.feed-item video {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: black;
}

.feed-item-content {
  padding: 16px;
}

.feed-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.feed-item-user {
  font-weight: bold;
  color: var(--cyan);
}

.feed-item-time {
  font-size: 24px;
  font-weight: bold;
  color: var(--gold);
}

.feed-item-event {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

.feed-item-actions {
  display: flex;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn.liked {
  color: var(--gold);
}

/* Recording */
.recording-mode-selector {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}

.recording-mode-selector .btn {
  flex: 1;
}

#camera-preview {
  width: 100%;
  max-height: 60vh;
  background: black;
  border-radius: 12px;
  margin: 20px 0;
}

.camera-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timer {
  text-align: center;
  padding: 20px;
  font-size: 48px;
  font-weight: bold;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold);
}

.recording-indicator {
  text-align: center;
  color: var(--error);
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

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

/* Upload */
.upload-area {
  border: 3px dashed var(--border);
  border-radius: 16px;
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--cyan);
  background: rgba(0, 255, 255, 0.05);
}

#upload-video-preview {
  width: 100%;
  max-height: 400px;
  border-radius: 12px;
  margin: 20px 0;
}

/* Leaderboard */
.tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.tab {
  flex: 1;
  padding: 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  background: var(--gold);
  color: var(--bg-dark);
  border-color: var(--gold);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
}

.leaderboard-rank {
  font-size: 32px;
  font-weight: bold;
  min-width: 50px;
  text-align: center;
}

.leaderboard-rank.first {
  color: var(--gold);
}

.leaderboard-rank.second {
  color: #c0c0c0;
}

.leaderboard-rank.third {
  color: #cd7f32;
}

.leaderboard-info {
  flex: 1;
}

.leaderboard-user {
  font-weight: bold;
  color: var(--cyan);
}

.leaderboard-time {
  font-size: 24px;
  font-weight: bold;
  color: var(--gold);
}

/* Events */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.event-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
}

.event-name {
  font-size: 20px;
  font-weight: bold;
  color: var(--gold);
  margin-bottom: 8px;
}

.event-location {
  color: var(--cyan);
  margin-bottom: 8px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 2px solid var(--border);
}

.close,
.close-event-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 32px;
  cursor: pointer;
  color: var(--text-secondary);
  background: none;
  border: none;
}

.modal video {
  width: 100%;
  max-height: 50vh;
  border-radius: 12px;
  margin: 20px 0;
  background: black;
}

.comments-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.comment-item {
  background: var(--bg-darker);
  padding: 12px;
  border-radius: 8px;
}

.comment-user {
  font-weight: bold;
  color: var(--cyan);
  margin-bottom: 4px;
}

.comment-text {
  color: var(--text-secondary);
}

/* Error Messages */
.error {
  background: rgba(255, 68, 68, 0.2);
  color: var(--error);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--error);
  margin: 16px 0;
}

/* Success Messages */
.success {
  background: rgba(68, 255, 68, 0.2);
  color: var(--success);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--success);
  margin: 16px 0;
}

/* Admin Only */
.admin-only {
  display: none;
}

body[data-role="admin"] .admin-only {
  display: block;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 12px;
  }
  
  .btn {
    padding: 14px;
    font-size: 16px;
  }
  
  .logo {
    font-size: 36px;
  }
  
  .timer {
    font-size: 36px;
  }
}
