/* Modern dark aesthetic for cheese-link */

:root {
  --bg-primary: #0b0f19;
  --bg-surface: #151d2f;
  --bg-surface-elevated: #1e293b;
  --border-subtle: #2d3b55;
  --border-focus: #38bdf8;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #38bdf8;
  --accent-hover: #0284c7;
  --accent-spin: #f59e0b;
  --accent-spin-hover: #d97706;

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-bg: rgba(239, 68, 68, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-display {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Main Layout: Side-by-side on desktop, stacked on mobile */
.main-container {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .main-container {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem;
    gap: 2rem;
  }
}

/* Wheel Section */
.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.wheel-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pointer at top (12 o'clock) */
.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid #f8fafc;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
  z-index: 10;
}

.wheel-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.wheel-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.winner-announcement {
  min-height: 2.25rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #38bdf8;
  text-align: center;
  letter-spacing: -0.01em;
  padding: 0.25rem 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

/* List Section */
.list-section {
  width: 100%;
}

.list-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.list-header {
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Add Form */
.add-form {
  margin-bottom: 1.5rem;
}

.add-input-group {
  display: flex;
  gap: 0.5rem;
}

.form-input {
  flex: 1;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--border-focus);
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.25rem;
}

/* Movie List */
.movie-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.movie-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  gap: 0.75rem;
}

.movie-item-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 1rem;
}

.movie-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.movie-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-added-by {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  padding: 0.65rem 1.25rem;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #0b0f19;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-secondary:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-spin {
  background-color: var(--accent-spin);
  color: #0b0f19;
  font-size: 1.15rem;
  padding: 0.85rem 3rem;
  border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.btn-spin:hover:not(:disabled) {
  background-color: var(--accent-spin-hover);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-remove {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.btn-remove:hover:not(:disabled) {
  background-color: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

/* Login Page Styling */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.brand .logo {
  font-size: 1.85rem;
}

.brand .tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  border-color: var(--border-focus);
}

/* Mobile Responsiveness down to 360px */
@media (max-width: 400px) {
  .site-header {
    padding: 0.65rem 0.85rem;
  }

  .main-container {
    padding: 1rem 0.5rem;
  }

  .list-card {
    padding: 1rem 0.75rem;
  }

  .login-card {
    padding: 1.5rem 1.25rem;
  }

  .wheel-wrapper {
    max-width: 320px;
  }

  .btn-spin {
    padding: 0.75rem 2.25rem;
    font-size: 1.05rem;
  }
}
