/* ========================================
   CSS CUSTOM PROPERTIES - DESIGN SYSTEM
   Based on Pexels/Vimeo UI Style Guide
   ======================================== */
:root {
  /* === BRAND COLORS === */
  --accent-color: var(--gray-800);            /* Dark gray (accent removed) */
  --accent-color-hover: var(--gray-900);      /* Darker gray on hover */
  --accent-color-light: rgba(38, 38, 38, 0.1); /* Gray background tint */

  /* === ACCENT COLORS (Brand Green) === */
  /* Primary brand accent - bright green for visual elements (backgrounds, borders, icons on dark backgrounds) */
  --accent-color-primary: rgb(73, 242, 100);  /* Bright green - high visibility, excellent contrast on dark backgrounds */

  /* Secondary brand accent - darker green for text/icons with better contrast on light backgrounds */
  --accent-color-for-text-icons: #16ba31;     /* Darker green - WCAG AA compliant for text, better readability on white/light backgrounds */

  /* === NEUTRAL COLORS === */
  --white: #FFFFFF;
  --gray-50: #FAFAFA;     /* Page backgrounds */
  --gray-100: #F5F5F5;    /* Card backgrounds */
  --gray-200: #EBEBEB;    /* Borders, dividers */
  --gray-300: #D4D4D4;    /* Disabled states */
  --gray-400: #A3A3A3;    /* Secondary text */
  --gray-500: #737373;    /* Body text (less important) */
  --gray-600: #525252;    /* Secondary headings */
  --gray-700: #404040;    /* Primary body text */
  --gray-800: #262626;    /* Headings */
  --gray-900: #171717;    /* High contrast text */
  --black: #000000;       /* Logo, critical emphasis */

  /* === UI SPECIFIC COLORS === */
  --text-primary: #191919;      /* Main text color globally */
  --text-dark: #212529;          /* Dark text color */
  --text-muted: #6c757d;         /* Muted text color */
  --icon-secondary: #a8a8a8;    /* Dropdown icons */
  --arrow-color: #767676;       /* Dropdown arrows - WCAG 2.1 AA compliant (4.5:1 contrast) */

  /* === ACTION COLORS === */
  --link-color: #007bff;                    /* Bootstrap primary blue */
  --link-color-hover: #0056b3;               /* Darker blue for hover */
  --notification-red: #ef4444;               /* Notification badge red */
  --hover-bg-light: rgba(0, 0, 0, 0.05);    /* Light hover background */

  /* === SPACING SYSTEM (8px base) === */
  --space-1: 4px;    /* 0.5x */
  --space-2: 8px;    /* 1x */
  --space-3: 12px;   /* 1.5x */
  --space-4: 16px;   /* 2x */
  --space-5: 20px;   /* 2.5x */
  --space-6: 24px;   /* 3x */
  --space-8: 32px;   /* 4x */
  --space-10: 40px;  /* 5x */
  --space-12: 48px;  /* 6x */
  --space-16: 64px;  /* 8x */

  /* === TYPOGRAPHY === */
  --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
               'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
  --font-logo: 'Pattaya', 'Roboto', system-ui, sans-serif;

  /* === SHADOWS === */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-dropdown: 0 10px 40px rgba(0, 0, 0, 0.15);

  /* === BORDER RADIUS === */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* === TRANSITIONS & TIMING === */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --delay-dropdown: 300ms;                   /* Hover delay before hiding dropdown */
  --duration-animation: 200ms;               /* Standard animation duration */
  --duration-slide: 0.3s;                    /* Slide animation duration */

  /* === Z-INDEX SYSTEM === */
  --z-nav: 1000;                             /* Navbar z-index */
  --z-dropdown: 2000;                        /* Dropdown z-index */
  --z-modal: 3000;                           /* Modal z-index (future use) */
  --z-skip-link: 9999;                       /* Skip to main content link */

  /* === LAYOUT DIMENSIONS === */
  --navbar-height: 70px;                     /* Desktop navbar height */
  --navbar-height-mobile: 64px;              /* Mobile navbar height */
  --container-max-width: 1280px;             /* Max container width */
  --input-height: 48px;                      /* Standard input height */
  --icon-btn-size: 40px;                     /* Icon button size */
  --logo-spacing: 25px;                      /* Logo right margin */

  /* === TYPOGRAPHY SIZES === */
  --font-size-logo: 28px;                    /* Logo font size (desktop) */
  --font-size-logo-mobile: 24px;             /* Logo font size (mobile) */
  --font-size-nav: 17px;                     /* Navigation text size */
  --font-size-base: 15px;                    /* Base text size */
  --font-size-small: 14px;                   /* Small text size */
  --font-size-xs: 13px;                      /* Extra small text size */
  --font-size-icon: 18px;                    /* Standard icon size */
  --font-size-icon-large: 24px;              /* Large icon size */
  --letter-spacing-logo: -0.5px;             /* Logo letter spacing */

  /* === BUTTON SIZE VARIANTS === */
  --btn-text-sm: 14px;                       /* Small button text */
  --btn-padding-sm: 10px 20px;               /* Small button padding */

  /* === SEMANTIC COLORS (WCAG AA Compliant) === */
  --success: #059669;              /* Green - positive actions (4.54:1 contrast) */
  --success-hover: #047857;        /* Darker green on hover */
  --success-light: #D1FAE5;        /* Light green backgrounds */

  --error: #DC2626;                /* Red - errors, destructive (4.83:1 contrast) */
  --error-hover: #B91C1C;          /* Darker red on hover */
  --error-light: #FEE2E2;          /* Light red backgrounds */

  --warning: #F59E0B;              /* Orange - warnings, cautions */
  --warning-light: #FEF3C7;        /* Light orange backgrounds */

  --info: #1d4ed8;                 /* Darker blue - WCAG AA compliant */
  --info-light: #DBEAFE;           /* Light blue backgrounds */

  /* === LEGACY SUPPORT (for existing styles) === */
  --main-blue: var(--gray-800);
  --light-blue: #f5f5f5;
  --main-blue-hover: var(--gray-900);
  --accent-primary: var(--gray-800);  /* Alias for backward compatibility */

  /* Deprecated - use var(--radius-lg) instead */
  --radius-standard: var(--radius-lg);  /* DEPRECATED: Use --radius-lg */

  /* === LEADERBOARD VARIABLES (Phase G Part C) === */
  --leaderboard-bg: var(--white);
  --leaderboard-row-bg: var(--white);
  --leaderboard-row-hover: var(--gray-50);
  --leaderboard-border: var(--gray-200);
  --leaderboard-rank-color: var(--text-primary);
  --leaderboard-rank-size: 2em;
  --leaderboard-avatar-size: 80px;
  --leaderboard-thumbnail-size: 180px;
  --leaderboard-thumbnail-gap: 8px;
  --leaderboard-row-padding: 16px 24px;

  /* Tab Variables (for leaderboard and similar components) */
  --tab-bg: transparent;
  --tab-bg-active: var(--gray-900);
  --tab-text: var(--gray-500);
  --tab-text-active: var(--white);
  --tab-border-radius: 20px;
  --tab-padding: 8px 16px;
}

/* ===== FONT FAMILY DECLARATIONS ===== */
/* Prevent horizontal scrollbar globally (CRITICAL FIX) */
*, *::before, *::after {
  box-sizing: border-box;  /* Ensure padding/borders are included in width */
}

html, body {
  overflow-x: hidden;  /* Prevent horizontal scrollbar */
  max-width: 100vw;    /* Ensure nothing exceeds viewport width */
  margin: 0;
  padding: 0;
}

/* Base font for body and most text */
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background-color: white;
  color: var(--text-primary);  /* Global text color #191919 */
}

/* Headings and navigation use Roboto */
h1, h2, h3, h4, h5, h6,
.hero-main-title,
.hero-subtitle,
.form-title,
.sidebar-title,
.nav-link {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Logo uses Fugaz One consistently */
.logo-text,
.footer-header.logo {
  font-family: var(--font-logo);
  font-weight: 400;
}

/* Buttons use Roboto for consistency */
.btn,
.hero-btn-primary,
.hero-btn-secondary,
.action-btn,
.upload-btn,
.login-btn {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

a {
  text-decoration: none;
  color: #0071eb;
}

/* Main button color */
.btn-primary {
  background-color: var(--gray-800);
  border-color: var(--gray-800);
}

.btn-primary:hover {
  background-color: var(--gray-900);
  border-color: var(--gray-900);
}

main {
  margin-bottom: 100px;
}

.alert-success {
  background-color: var(--light-blue);
}

.main-bg {
  background-color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card {
  border: none;
  background-color: transparent;
}

.image-container {
  position: relative;
}

/* Enhanced faded style for unapproved comments */
.faded {
  opacity: 0.6;
  background-color: #f8f9fa;
  border-left: 3px solid #ffc107;
  border-radius: 5px;
  padding: 10px;
  margin: 10px 0;
  color: #6c757d;
  font-style: italic;
}

/* Enhanced approval message styling */
.approval {
  color: #856404;
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.875rem;
  margin-top: 10px;
  font-weight: 500;
  display: inline-block;
}

/* ===== HERO SECTION STYLES ===== */
.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-meta {
  font-size: 1.1rem;
  margin-bottom: 0;
}

.author-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem 0.25rem 0;
  border-radius: 15px;
  font-weight: 500;
}

.date-text {
  opacity: 0.9;
}


/* ===== SIDEBAR STYLES ===== */
.sidebar-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.prompt-metadata .fa-calendar-alt {
  margin: 0 2px 0 4px;
}

/* ===== TAGS STYLES ===== */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-badge {
  display: inline-block;
  background: var(--gray-200);
  color: var(--gray-800);
  padding: 0.375rem 0.75rem;
  border-radius: 15px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.tag-badge:hover {
  background: var(--gray-300);
  color: var(--gray-900);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===== COMMENTS STYLES ===== */
/* This the label above the comment field on the detail list page */
#commentForm .form-label {
  display: none;
}

.comment-card {
  background: #fff;
  border: 2px solid var(--main-border-color);
  border-radius: 8px;
}

.comment-form {
  margin-top: 1rem;
}

.posting-as {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ===== Copy Button Styles ===== */
.copy-btn {
  transition: all 0.2s ease;
  border-radius: 20px;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  color: var(--gray-700);
  border-color: var(--gray-400);
  font-weight: 500;
}

.copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: var(--gray-900);
  border-color: var(--gray-600);
}

.copy-btn i {
  font-size: 0.75rem;
}

.btn-success:focus {
  background-color: #198754;
}

/* ===== MASONRY LAYOUT - FLEXBOX COLUMN APPROACH ===== */
.masonry-container {
  max-width: 1600px;
  margin: 0 auto;  /* Center align content */
  padding: 40px 0;
  width: 100%;
  box-sizing: border-box;  /* Ensure padding doesn't cause overflow */
}

/* Masonry grid flexbox layout */
.masonry-grid {
  display: flex;
  gap: 15px;
  width: 100%;
}

.masonry-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.masonry-item {
  display: block;
  width: 100%;
  background: none;
  border-radius: 8px;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.masonry-item.new-item {
  animation: slideInFade 0.6s ease forwards;
}

@keyframes fadeIn {
  to {
      opacity: 1;
  }
}

@keyframes slideInFade {
  from {
      opacity: 0;
      transform: translateY(20px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

.prompt-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #fff;
  width: 100%;
  height: fit-content;
}

.prompt-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Image wrapper */
.image-wrapper {
  position: relative;
  width: 100%;
}

.image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* Clickable link overlay */
.card-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  text-decoration: none;
}

/* Overlay styles - Bottom gradient only */
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 90%,
      rgba(0, 0, 0, 0.5) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.prompt-card:hover .card-overlay {
  opacity: 1;
}

/* Overlay content */
.overlay-top {
  display: flex;
  justify-content: flex-start;
  opacity: 0;
}

.overlay-bottom {
  display: flex;
  align-items: center;
  opacity: .9;
  position: absolute;
  height: 40px;
  width: 100%;
  bottom: 5px;
  padding: 0 10px 0 20px;
  z-index: 99;
}

.user-info {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.platform-info {
  color: white;
  font-size: 1rem;
  font-weight: 500;
}

.platform-info i {
  margin-right: 4px;
}

/* View Count Badge - Top Left Corner (Phase G Part B) */
.view-count-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
}

.view-count-badge i {
  font-size: 0.75rem;
}

.heart-counter {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  width: 80px;
  margin-left: auto;
  margin-right: 20px;
}

.heart-counter i {
  margin-right: 4px;
}



/* Mobile video optimizations */
@media (max-width: 768px) {
    /* Disable video autoplay on mobile to save data */
    
    .video-thumbnail {
        opacity: 1 !important;
    }
    
    .video-play-icon {
        opacity: 1 !important;
    }
    
    /* Add click-to-play on mobile */
    .video-card {
        cursor: pointer;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    
    .video-thumbnail {
        opacity: 1 !important;
    }
}

/* ===== LOAD MORE BUTTON STYLING ===== */
.load-more-container {
  margin: 60px auto;
  max-width: 300px;
}

#load-more-btn {
  background: var(--gray-800);
  border: none;
  border-radius: 25px;
  padding: 12px 30px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background: var(--gray-900);
}

#loading-spinner {
  color: #666;
  font-size: 1.1rem;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
  position: sticky;
  top: 20px;
  z-index: 10;
}

.button-group {
  background: none;
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 0;
  justify-content: right;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  border: none;
  border-radius: 20px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  padding: 0 12px;
  white-space: nowrap;
}

.action-btn:hover {
  background: var(--gray-200);
  text-decoration: none;
  transform: translateY(-1px);
  color: var(--gray-900);
}

.action-btn i {
  font-size: 18px;
}

/* Like button specific styles */
.btn-like {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0 16px;
  min-width: auto;
  font-weight: 700;
}

.btn-like:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.btn-like.liked {
  background: var(--gray-800);
  color: white;
}

.btn-like.liked:hover {
  background: var(--gray-900);
}

.like-count {
  margin-left: 4px;
  font-weight: 600;
}

/* ===== MODERN FORM STYLING ===== */
/* Form Container */
.form-container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 40px;
  border: 1px solid #f1f3f4;
}

/* Form Header */
.form-header {
  text-align: center;
  margin-bottom: 32px;
}

.form-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.form-subtitle {
  color: #6b7280;
  font-size: 1rem;
  margin: 0;
}

/* Field Groups */
.field-group {
  margin-bottom: 24px;
}

/* Labels */
.field-label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-control {
  border: 2px solid var(--main-border-color);
}

/* FIXED: Input Fields - Basic Styling with corrected syntax */
.edit-form .form-control {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--main-border-color);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: var(--light-blue);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.edit-form .form-control:focus {
  outline: none;
  border-color: var(--main-blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  background: #ffffff;
}

/* Form input classes from forms.py */
.modern-input,
.modern-textarea,
.modern-select {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.modern-input:focus,
.modern-textarea:focus,
.modern-select:focus {
  border-color: var(--main-blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Help Text */
.field-help {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 6px;
  line-height: 1.4;
}

/* Button Styling */
.form-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  justify-content: center;
}

.btn-primary,
.btn-secondary {
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.btn-primary {
  background: var(--main-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--main-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background: #e5e7eb;
  color: #374151;
  text-decoration: none;
}

/* Red button - mostly used when the user wants to delete a prompt or comment */
.btn-danger {
  border-radius: 100px;
  padding: 14px 28px;
}

/* Small buttons - mainly for the comment form */
.btn-small {
  font-size: 14px;
  padding: 10px 10px;
  min-width: 96px;
  background-color: var(--light-blue);
  color: var(--main-blue-hover);
}

.btn-small:hover {
  background-color: var(--main-blue);
}

/* Popular Tags Styling */
.popular-tags {
  margin-top: 12px;
}

.popular-tags-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 8px;
  display: block;
}

.popular-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-option {
  background: var(--light-blue);
  color: var(--main-blue);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.tag-option:hover {
  background: var(--main-blue);
  color: white;
  transform: translateY(-1px);
}

/* Modern Button Classes */
.modern-btn {
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.modern-btn-primary {
  background: var(--main-blue);
  color: white;
}

.modern-btn-primary:hover {
  background: var(--main-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  color: white;
  text-decoration: none;
}

.modern-btn-secondary {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.modern-btn-secondary:hover {
  background: #e5e7eb;
  color: #374151;
  text-decoration: none;
}

/* Footer styling */
.modern-form-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #f3f4f6;
}

.modern-form-footer-text {
  color: #6b7280;
  font-size: 0.95rem;
}

/* ===== FILE UPLOAD STYLING ===== */
/* Current Image Display */
.current-image {
  margin-bottom: 16px;
}

.current-image-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 8px;
}

.current-image-preview {
  max-width: 200px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid #e5e7eb;
  transition: all 0.2s ease;
}

.current-image-preview:hover {
  border-color: var(--main-blue);
  transform: scale(1.02);
}

/* File Upload Area */
.file-upload-area {
  position: relative;
  width: 100%;
}

.file-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  color: #6b7280;
  font-weight: 500;
  min-height: 80px;
}

.file-upload-label:hover {
  border-color: var(--main-blue);
  background: var(--light-blue);
  color: var(--main-blue);
}

.file-upload-label i {
  font-size: 24px;
  margin-right: 12px;
  color: #9ca3af;
}

.file-upload-label:hover i {
  color: var(--main-blue);
}

/* ===== SELECT DROPDOWN WITH ARROW ===== */
.edit-form .modern-select-dropdown,
select.modern-select-dropdown {
  background-image: url("data:image/svg+xml;charset=utf-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 30px;
  padding-right: 48px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.edit-form .modern-select-dropdown:focus,
select.modern-select-dropdown:focus {
  background-image: url("data:image/svg+xml;charset=utf-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23007bff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

/* Fallback for specific select element */
select#id_ai_generator {
  background-image: url("data:image/svg+xml;charset=utf-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 48px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* ===== TAG FILTER HEADER STYLES ===== */
.tag-filter-header {
  background: var(--light-blue);
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e9ecef;
}

.tag-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.tag-name {
  color: var(--main-blue);
  font-weight: 700;
}

.tag-subtitle {
  color: #666;
  font-size: 1rem;
  margin-bottom: 1rem;
  font-weight: 700;
  margin: 20px 0;
}

.tag-filter-header .btn {
  border-radius: 20px;
  padding: 0.5rem 1.5rem;
  transition: all 0.2s ease;
  color: var(--main-blue-hover);
  border-color: var(--main-blue-hover);
  font-weight: 600;
}

.tag-filter-header .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
  background-color: var(--main-blue);
  color: white;
  border-color: var(--main-blue);
}

/* ===== HERO SECTION WITH ORGANIC BLUR EFFECT ===== */
.hero-section {
  padding: 20px 0 0px 0;
  margin-top: 0;
  position: relative;
  overflow: hidden;
  height: auto;
  padding-top: 50px;
  min-height: 787px;
}

/* Primary organic blur shape */
.hero-section::before {
  content: '';
  position: absolute;
  right: 5%;
  top: 16%;
  z-index: -10;
  width: 38%;
  height: 60%;
  filter: blur(80px);
  background: conic-gradient(
      from 45deg at 97% 50%,
      rgba(99, 102, 241, 0.3) 0deg,
      rgba(168, 85, 247, 0.25) 120deg,
      rgba(244, 114, 182, 0.2) 240deg,
      rgba(59, 130, 246, 0.3) 360deg);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  transform: rotate(15deg);
  animation: float 20s ease-in-out infinite;
}

/* Floating animation for organic movement */
@keyframes float {
  0%, 100% {
      transform: rotate(15deg) translateY(0px) scale(1);
  }
  25% {
      transform: rotate(18deg) translateY(-10px) scale(1.02);
  }
  50% {
      transform: rotate(12deg) translateY(-5px) scale(0.98);
  }
  75% {
      transform: rotate(20deg) translateY(-15px) scale(1.01);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-right: 2rem;
}

.hero-main-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.hero-brand {
  background: linear-gradient(135deg, var(--main-blue-hover) 0%, var(--main-blue) 40%, var(--main-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.hero-description {
  font-size: 1.125rem;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 2.5rem;
  max-width: 90%;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-btn-primary {
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  background: var(--black);
}

.hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  background: var(--gray-800);
  color: white;
  text-decoration: none;
}

.hero-btn-secondary {
  background: white;
  color: var(--gray-800);
  border: 2px solid var(--gray-800);
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
}

.hero-btn-secondary:hover {
  background: var(--gray-800);
  color: white;
  transform: translateY(-2px);
  text-decoration: none;
  border-color: var(--gray-800);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ===== HERO IMAGE GALLERY STYLES ===== */
.hero-gallery-container {
  overflow: hidden;
  position: relative;
}

.hero-image-grid {
  display: flex;
  justify-content: flex-end;
  gap: 1.6rem;
  height: 100%;
  width: 100%;
  align-items: flex-start;
}

.image-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: none;
}

/* Column layouts */
.column-1 {
  padding-top: 2rem;
  order: 3;
}

.column-2 {
  padding-top: 10em;
  order: 2;
}

.column-2 .image-item:last-child,
.column-1 .image-item:last-child {
  margin-bottom: 0;
}

.column-2 .image-item:first-child {
  margin-top: 0;
}

.column-3 {
  padding-top: 22rem;
  order: 1;
}

.column-1, .column-2, .column-3 {
  width: 30%;
}

/* Image item styling */
.image-item {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgba(55, 65, 81, 0.05);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  aspect-ratio: 2 / 3;
  max-height: 245px;
  margin: .4em 0;
}

.image-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Image overlay for subtle border effect */
.image-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 0.75rem;
  border: 1px solid rgba(55, 65, 81, 0.1);
}

footer {
  box-shadow: -1px -3px 3px rgba(0, 0, 0, 0.1);
}

/* ===== MODALS ===== */
.modal-footer {
  justify-content: center;
}

/* ===== RESPONSIVE DESIGN ===== */
/* Large screens adjustments */
@media (max-width: 1200px) {
  .hero-section {
      padding: 60px 0;
      min-height: 617px;
  }
  
  .hero-description {
      max-width: none;
  }
  
  .hero-section::before {
      top: 8%;
  }
  
  .hero-btn-secondary {
      display: none;
  }
  
  .hero-gallery-container {
      margin-left: 1rem;
  }
  
  .column-2 {
      padding-top: 0em
  }
  
  .column-3 {
      padding-top: 7rem
  }
  
  .hero-content {
      padding-right: 0;
  }
  
  .column-1 {
      display: none;
  }
  
  .column-2, .column-3 {
      width: 40%;
  }
}

/* Medium screens (991px and below) */
@media (max-width: 991px) {
  .hero-section {
      margin-top: 60px;
      overflow: unset;
      min-height: auto;
      padding: 0;
  }
  
  .hero-main-title {
      font-size: 2.5rem;
  }
  
  .hero-content {
      padding-right: 0;
      text-align: center;
      margin-bottom: 3rem;
  }
  
  .hero-actions {
      justify-content: center;
  }
  
  .hero-gallery-container-shell {
      display: none;
  }
}

@media (max-width: 768px) {
  .form-actions {
      flex-direction: column;
  }
}

@media (max-width: 500px) {
  .hero-section {
      min-height: 450px;
  }
}
/* ===== ALERT UNDO BUTTON STYLING ===== */
.alert form button.btn-link {
    text-decoration: none;
    padding: 0;
    margin: 0;
    vertical-align: baseline;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: inherit;
    font-weight: inherit;
}

.alert form button.btn-link:hover {
    text-decoration: underline;
}

.alert form button.btn-link:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Undo button loading state */
.alert form button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.alert form button[disabled]::after {
    content: '...';
    animation: dots 1s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ============================================
   MODERN TOGGLE SWITCH COMPONENT
   ============================================ */

/* Custom toggle switch - larger and more modern than Bootstrap default */
.form-switch.form-switch-lg {
    padding-left: 3.5rem;
    min-height: 2rem;
}

.form-switch.form-switch-lg .form-check-input {
    width: 52px;
    height: 28px;
    margin-left: -3.5rem;
    margin-top: 0;
    cursor: pointer;
    background-color: #e5e7eb;
    border: none;
    border-radius: 14px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-position: left center;
    background-size: 22px;
    transition: background-color 0.2s ease-in-out, background-position 0.2s ease-in-out;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-switch.form-switch-lg .form-check-input:checked {
    background-color: #16ba31;  /* Brand green */
    background-position: right center;
}

.form-switch.form-switch-lg .form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 186, 49, 0.25);
}

.form-switch.form-switch-lg .form-check-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-switch.form-switch-lg .form-check-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-700, #404040);
    padding-top: 0.25rem;
    cursor: pointer;
}

.form-switch.form-switch-lg .form-check-input:disabled + .form-check-label {
    cursor: not-allowed;
    color: var(--gray-500, #737373);
}

/* Toggle helper text */
.toggle-helper-text {
    font-size: 0.875rem;
    color: var(--gray-500, #737373);
    margin-top: 0.25rem;
    margin-left: 3.5rem;
}

/* Status indicator for toggle */
.toggle-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.toggle-status.draft {
    color: #856404;
}

.toggle-status.published {
    color: #0f5132;
}

.toggle-status.pending {
    color: #6c757d;
}

/* ========================================
   TRASH BIN BUTTON & CARD STYLING
   Modern, consistent button hierarchy
   ======================================== */

/* === TRASH CARD STRUCTURE === */
.trash-card-meta {
    padding: 16px;
    padding-bottom: 8px;
}

.trash-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    line-height: 1.4;
}

.trash-card-info {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.trash-card-info i {
    width: 16px;
    margin-right: 6px;
    color: var(--gray-400);
}

.trash-card-actions {
    padding: 16px;
    background-color: var(--white);
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* === UNIFIED ACTION BUTTON (Dark Gray - matches .pexels-upload-btn) === */
.trash-btn-action {
    background-color: var(--black, #000);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--btn-padding-sm);
    font-size: var(--btn-text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px; /* Touch target WCAG AAA */
    text-decoration: none;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.trash-btn-action:hover {
    background-color: var(--gray-900, #171717);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.trash-btn-action:active {
    transform: translateY(0);
}

.trash-btn-action:focus-visible {
    outline: 2px solid var(--gray-600);
    outline-offset: 2px;
}

/* === DESTRUCTIVE: Delete Forever (Red - 14px) === */
.trash-btn-delete {
    background-color: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--btn-padding-sm);
    font-size: var(--btn-text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    text-decoration: none;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.trash-btn-delete:hover {
    background-color: var(--error-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    text-decoration: none;
}

.trash-btn-delete:active {
    transform: translateY(0);
}

.trash-btn-delete:focus-visible {
    outline: 2px solid var(--error);
    outline-offset: 2px;
}

/* === PAGE-LEVEL: Empty Trash (Red, Larger) === */
.trash-btn-empty {
    background-color: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    text-decoration: none;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.trash-btn-empty:hover {
    background-color: var(--error-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    text-decoration: none;
}

.trash-btn-empty:active {
    transform: translateY(0);
}

.trash-btn-empty:focus-visible {
    outline: 2px solid var(--error);
    outline-offset: 2px;
}

/* === MODAL BUTTONS === */
.trash-modal-btn-cancel {
    background-color: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.trash-modal-btn-cancel:hover {
    background-color: var(--gray-200);
    color: var(--gray-800);
}

.trash-modal-btn-confirm {
    background-color: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.trash-modal-btn-confirm:hover {
    background-color: var(--error-hover);
    color: white;
}

/* === EMPTY TRASH MODAL === */
.trash-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.trash-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.trash-modal {
    background-color: var(--white, #FFFFFF);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.trash-modal-backdrop.show .trash-modal {
    transform: translateY(0);
}

.trash-modal-title {
    color: var(--error);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.trash-modal-body {
    color: var(--gray-700);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.trash-modal-warning {
    background-color: var(--error-light);
    border: 1px solid var(--error);
    color: var(--error-hover);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

.trash-modal-warning strong {
    font-weight: 600;
}

.trash-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}

/* Enhanced modal button styles for Empty Trash modal */
.trash-modal-actions .trash-modal-btn-confirm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
}

.trash-modal-actions .trash-modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.trash-modal-actions .trash-modal-btn-cancel {
    padding: 12px 24px;
}

.trash-modal-actions .trash-modal-btn-cancel:hover {
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════
   LEADERBOARD PAGE STYLES (Phase G Part C)
   ═══════════════════════════════════════════════════════════════ */

.leaderboard-page {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.leaderboard-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.leaderboard-subtitle {
    font-size: 1rem;
    color: var(--gray-500);
    margin-bottom: 0;
}

/* Controls Row (Tabs + Filter) */
.leaderboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.leaderboard-tabs {
    display: flex;
    gap: var(--space-2);
}

.leaderboard-tab {
    padding: var(--tab-padding);
    border-radius: var(--tab-border-radius);
    background: var(--tab-bg);
    color: var(--tab-text);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-small);
    transition: all var(--transition-fast);
}

.leaderboard-tab:hover {
    background: var(--tab-bg-active);
    color: var(--tab-text-active);
}

.leaderboard-tab.active {
    background: var(--tab-bg-active);
    color: var(--tab-text-active);
}

.period-select {
    /* Pexels-style dropdown */
    position: relative;
    padding: 10px 44px 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 500;
    background: var(--white);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;

    /* Custom dropdown arrow */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px 12px;
}

.period-select:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.period-select:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

.period-select:active {
    transform: scale(0.98);
}

/* Period Dropdown (Custom Pexels-style) */
.period-dropdown {
    position: relative;
    display: inline-block;
}

.period-dropdown-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.period-dropdown-btn:hover {
    border-color: var(--gray-500);
}

.period-dropdown-btn:focus {
    outline: none;
    border-color: var(--gray-800);
    box-shadow: 0 0 0 2px rgba(38, 38, 38, 0.1);
}

.period-dropdown-chevron {
    transition: transform var(--transition-fast);
}

.period-dropdown.open .period-dropdown-chevron {
    transform: rotate(180deg);
}

.period-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 140px;
    padding: var(--space-2) 0;
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.period-dropdown.open .period-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.period-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-small);
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.period-dropdown-item:hover {
    background-color: var(--gray-100);
    text-decoration: none;
    color: var(--text-primary);
}

.period-dropdown-item:focus {
    outline: 2px solid var(--gray-800);
    outline-offset: -2px;
    background-color: var(--gray-100);
}

.period-dropdown-item.active {
    font-weight: 600;
}

.period-check-icon {
    color: var(--gray-800);
    flex-shrink: 0;
}

/* Leaderboard List Container */
.leaderboard-list {
    border: 1px solid var(--leaderboard-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--leaderboard-bg);
}

/* Leaderboard Row */
.leaderboard-row {
    display: flex;
    align-items: center;
    padding: var(--leaderboard-row-padding);
    background: var(--leaderboard-row-bg);
    border-bottom: 1px solid var(--leaderboard-border);
    gap: var(--space-4);
    transition: background var(--transition-fast);
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row:hover {
    background: var(--leaderboard-row-hover);
}

/* Rank Number */
.leaderboard-rank {
    font-size: var(--leaderboard-rank-size);
    font-weight: 500;
    color: var(--leaderboard-rank-color);
    min-width: 48px;
    text-align: center;
    flex-shrink: 0;
}

/* User Info Section */
.leaderboard-user {
    display: flex;
    align-items: center;
    gap: 25px;
    flex: 1;
    min-width: 200px;
}

.leaderboard-avatar,
.leaderboard-avatar-placeholder {
    width: var(--leaderboard-avatar-size);
    height: var(--leaderboard-avatar-size);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.leaderboard-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--main-blue);
    color: var(--white);
    font-weight: 600;
    font-size: 1.25rem;
}

.leaderboard-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.leaderboard-username {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-username:hover {
    text-decoration: underline;
}

.leaderboard-stats {
    font-size: 16px;
    font-weight: 600;
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Actions Section */
.leaderboard-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

.leaderboard-follow-btn {
    padding: var(--space-2) var(--space-4);
    border-radius: 9999px;
    font-size: var(--font-size-small);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--gray-900);
    background: var(--gray-900);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    min-width: 90px;
}

.leaderboard-follow-btn:hover {
    background: var(--gray-800);
    border-color: var(--gray-800);
}

.leaderboard-follow-btn.following {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.leaderboard-follow-btn.following:hover,
.leaderboard-follow-btn.hover-unfollow {
    background: var(--error-light);
    color: var(--error);
    border-color: var(--error);
}

.leaderboard-follow-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Thumbnails Section */
.leaderboard-thumbnails {
    display: flex;
    gap: var(--leaderboard-thumbnail-gap);
    align-items: center;
    flex-shrink: 0;
}

.thumbnail-link {
    display: block;
    flex-shrink: 0;
}

.leaderboard-thumbnail {
    width: var(--leaderboard-thumbnail-size);
    height: var(--leaderboard-thumbnail-size);
    object-fit: cover;
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast);
}

.leaderboard-thumbnail:hover {
    transform: scale(1.05);
}

/* Thumbnail Overlay Container (5th thumbnail with +X more) */
.thumbnail-overlay-container {
    position: relative;
    width: var(--leaderboard-thumbnail-size);
    height: var(--leaderboard-thumbnail-size);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.thumbnail-overlay-container .leaderboard-thumbnail {
    width: 100%;
    height: 100%;
}

.thumbnail-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.thumbnail-overlay-link:hover .thumbnail-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.thumbnail-overlay-text {
    color: var(--white);
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Empty State */
.leaderboard-empty {
    padding: var(--space-12);
    text-align: center;
    color: var(--gray-500);
}

.leaderboard-empty i {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    color: var(--gray-300);
}

.leaderboard-empty p {
    margin-bottom: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════════
   LEADERBOARD RESPONSIVE STYLES
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
    .leaderboard-row {
        flex-wrap: wrap;
    }

    .leaderboard-thumbnails {
        width: 100%;
        margin-top: var(--space-3);
        padding-left: calc(48px + var(--space-4));
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--gray-300) transparent;
    }

    .leaderboard-thumbnails::-webkit-scrollbar {
        height: 4px;
    }

    .leaderboard-thumbnails::-webkit-scrollbar-track {
        background: transparent;
    }

    .leaderboard-thumbnails::-webkit-scrollbar-thumb {
        background: var(--gray-300);
        border-radius: 2px;
    }

    .leaderboard-user {
        min-width: 150px;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .leaderboard-page {
        padding: var(--space-4);
    }

    .leaderboard-title {
        font-size: 1.5rem;
    }

    .leaderboard-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .leaderboard-tabs {
        justify-content: center;
    }

    .leaderboard-filter {
        text-align: center;
    }

    .period-select {
        width: 100%;
    }

    .leaderboard-row {
        padding: var(--space-3) var(--space-4);
        gap: var(--space-3);
    }

    .leaderboard-rank {
        font-size: 1.5rem;
        min-width: 32px;
    }

    .leaderboard-avatar,
    .leaderboard-avatar-placeholder {
        width: 56px;
        height: 56px;
    }

    .leaderboard-user {
        min-width: 0;
        flex: 1;
    }

    .leaderboard-username {
        font-size: 1.1em;
    }

    .leaderboard-stats {
        font-size: 14px;
    }

    .leaderboard-follow-btn {
        padding: var(--space-1) var(--space-3);
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 480px) {
    .leaderboard-actions {
        display: none;
    }
}
