/* MovieGauge Premium Styling */

:root {
  --primary-color: #8B5CF6;
  --primary-dark: #7C3AED;
  --primary-light: #A78BFA;
  --secondary-color: #EC4899;
  --accent-color: #F59E0B;
  --success-color: #10B981;
  --danger-color: #EF4444;
  --dark-bg: #0F172A;
  --light-bg: #F8FAFC;
  --card-bg: #FFFFFF;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --border-color: #E2E8F0;
}

/* General typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Container */
.container {
  max-width: 1200px;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Cards - Premium Design */
.card {
  border: none;
  border-radius: 12px;
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.1);
}

.card-body {
  padding: 1.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* Badges */
.badge {
  border-radius: 20px;
  font-weight: 600;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  backdrop-filter: blur(10px);
  border: none;
}

.badge.bg-warning {
  background: linear-gradient(135deg, var(--accent-color) 0%, #D97706 100%) !important;
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.badge.bg-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

/* Alerts */
.alert-info {
  background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
  border: none;
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
  font-weight: 500;
}

.alert-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #DC2626 100%);
  border: none;
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

/* Grid & Layout */
.row {
  row-gap: 2rem;
}

.col-md-4, .col-md-6, .col-md-8 {
  display: flex;
  flex-wrap: wrap;
}

/* Page Headers */
.page-header {
  padding: 3rem 0 2rem 0;
}

.page-header h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.page-header small {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Movie Cards */
.movie-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.2);
}

.card-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 280px;
  background: linear-gradient(135deg, var(--light-bg) 0%, #E2E8F0 100%);
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.movie-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.rating-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--accent-color) 0%, #D97706 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  backdrop-filter: blur(10px);
}

.card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.card-body > .btn {
  margin-top: auto;
}

/* Form Inputs */
.form-control, .form-select {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: 'Manrope', sans-serif;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-control-lg {
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: block;
}

/* Rating Input */
.rating-input {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.rating-input input {
  max-width: 120px;
}

/* Search Results */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--light-bg);
}

.search-result-item img {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

/* Movies Index Page */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 3rem 0 2rem 0;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.empty-state h4 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Movie Show Page */
.movie-details {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 3rem;
  padding: 2rem 0;
  align-items: start;
}

.movie-details > * {
  min-width: 0;
}

.movie-poster {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 320px;
  aspect-ratio: 2 / 3;
}

.movie-poster img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.movie-poster-placeholder {
  min-height: 0;
}

.movie-show-left-column {
  width: 100%;
}

.movie-info,
.overview-section p,
.rating-card,
.user-rating-card {
  overflow-wrap: anywhere;
}

.movie-info h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  row-gap: 0.75rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.movie-show-actions {
  align-items: center;
}

.signin-warning-header,
.signin-warning-actions {
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-item small {
  color: var(--text-secondary);
  font-weight: 500;
}

.overview-section {
  margin-bottom: 2rem;
}

.overview-section h5 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.overview-section p {
  line-height: 1.8;
  color: var(--text-secondary);
}

.rating-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.rating-average {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.rating-count {
  color: var(--text-secondary);
  font-weight: 500;
}

.user-rating-card {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: none;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.2);
}

.user-rating-card h5 {
  color: #92400E;
  margin-bottom: 1rem;
}

.user-rating-card .display-5 {
  color: #F59E0B;
}

/* Responsive */
@media (max-width: 768px) {
  .movie-details {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .movie-poster {
    max-width: 280px;
    margin: 0 auto;
  }

  .movie-poster-placeholder {
    min-height: 0;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header h1 {
    font-size: 2.1rem;
  }

  .movie-info h1 {
    font-size: 1.75rem;
  }

  .col-md-4 {
    flex: 1 1 calc(50% - 1rem);
    max-width: calc(50% - 1rem);
  }
}

@media (max-width: 480px) {
  .col-md-4 {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .movie-info h1 {
    font-size: 1.5rem;
  }

  .rating-average {
    font-size: 2.5rem;
  }

  .movie-poster-placeholder {
    min-height: 0;
  }

  .movie-poster {
    max-width: 240px;
  }
}

  /* Movies Index view-only styles extracted from ERB */
  .movies-index-page .movie-item {
    transition: transform 0.3s ease;
  }

  .movies-index-page .movie-item:hover {
    transform: scale(1.02);
  }

  .movies-index-page #collection-search {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border: 2px solid #E2E8F0 !important;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: block !important;
  }

  .movies-index-page #collection-search:focus {
    outline: none;
    border-color: #8B5CF6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  }

  .movies-index-page .landing-hero {
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    color: white;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
  }

  .movies-index-page .landing-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.1;
  }

  .movies-index-page .landing-content {
    position: relative;
    z-index: 1;
  }

  .movies-index-page .landing-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  }

  .movies-index-page .landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
  }

  .movies-index-page .landing-brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
    background: rgba(255, 255, 255, 0.15);
  }

  .movies-index-page .landing-subtitle {
    font-size: 1.4rem;
    color: #F8FAFC;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(15, 23, 42, 0.35);
    margin-bottom: 2rem;
    max-width: 600px;
  }

  .movies-index-page .auth-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .movies-index-page .search-section {
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15);
  }

  .movies-index-page .search-section h3 {
    margin-bottom: 1.5rem;
    color: #0F172A;
    font-size: 1.5rem;
  }

  .movies-index-page .search-input-wrapper {
    display: flex;
    gap: 0.5rem;
  }

  .movies-index-page .search-input-wrapper input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
  }

  .movies-index-page .search-input-wrapper input:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  }

  .movies-index-page .search-input-wrapper button {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  }

  .movies-index-page .search-input-wrapper button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
  }

  .movies-index-page .trending-section {
    margin-top: 4rem;
    padding: 0;
  }

  .movies-index-page .trending-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #0F172A;
    font-weight: 800;
  }

  .movies-index-page .movie-card-landing {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    height: 100%;
  }

  .movies-index-page .movie-card-landing:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.2);
  }

  .movies-index-page .movie-card-landing .card-img-wrapper {
    height: 250px;
    background: linear-gradient(135deg, #F0F4F8 0%, #E2E8F0 100%);
    overflow: hidden;
    position: relative;
  }

  .movies-index-page .movie-card-landing img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }

  .movies-index-page .movie-card-landing:hover img {
    transform: scale(1.05);
  }

  .movies-index-page .movie-card-landing .card-body {
    padding: 1.25rem;
  }

  .movies-index-page .movie-card-landing .card-body h5 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #0F172A;
  }

  .movies-index-page .movie-card-landing .card-body small {
    color: #64748B;
  }

  .movies-index-page .cta-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
    border-radius: 12px;
    margin-top: 4rem;
  }

  .movies-index-page .cta-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #0F172A;
  }

  .movies-index-page .cta-section p {
    font-size: 1.1rem;
    color: #64748B;
    margin-bottom: 2rem;
  }

  [data-theme="dark"] .movies-index-page .page-header small {
    color: #94A3B8 !important;
  }

  [data-theme="dark"] .movies-index-page .empty-state {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.55) 0%, rgba(30, 41, 59, 0.55) 100%) !important;
    border-color: #334155 !important;
  }

  [data-theme="dark"] .movies-index-page .empty-state h4 {
    color: #E2E8F0 !important;
  }

  [data-theme="dark"] .movies-index-page .empty-state p,
  [data-theme="dark"] .movies-index-page .movie-card .card-text,
  [data-theme="dark"] .movies-index-page .movie-card small,
  [data-theme="dark"] .movies-index-page .movie-card .text-muted {
    color: #94A3B8 !important;
  }

  [data-theme="dark"] .movies-index-page .movie-card .card-title a {
    color: #E2E8F0 !important;
  }

  [data-theme="dark"] .movies-index-page #collection-search {
    background: #0F172A;
    color: #E2E8F0;
    border-color: #334155 !important;
  }

  [data-theme="dark"] .movies-index-page .landing-hero {
    box-shadow: inset 0 -80px 120px rgba(2, 6, 23, 0.3);
  }

  [data-theme="dark"] .movies-index-page .trending-title,
  [data-theme="dark"] .movies-index-page .search-section h3,
  [data-theme="dark"] .movies-index-page .cta-section h2 {
    color: #E2E8F0 !important;
  }

  [data-theme="dark"] .movies-index-page .cta-section {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.8) 100%);
    border: 1px solid #334155;
  }

  [data-theme="dark"] .movies-index-page .cta-section p {
    color: #94A3B8;
  }
  