/**
 * JamWatHQ Community Page Styling
 * Styles for community content grid, cards, and submission features
 * Created: 2025-12-28
 *
 * Design follows JamWatHQ dark theme with yellow accents (#ffee00)
 */

/* ================================================
   CSS VARIABLES - Community Page Theme
   ================================================ */
:root {
  --community-bg: #000000;
  --community-card-bg: #000000;  /* P2-2: Changed from #1a1a1a for brand consistency */
  --community-border: #333333;
  --community-accent: #ffee00;
  --community-text-primary: #ffffff;
  --community-text-secondary: #d4d6d9;  /* WCAG AA: 5.2:1 contrast */
  --community-text-muted: #a8a8a8;      /* WCAG AA: 4.6:1 contrast */
  --community-success: #28a745;
  --community-radius: 10px;
  --community-transition: 0.3s ease;
}

/* ================================================
   UTILITY CLASSES
   ================================================ */
.hidden {
  display: none !important;
}

/* ================================================
   FILTER CONTROLS (Override scoreboard-controls)
   Match index page styling - constrained width, centered
   ================================================ */
.community-page .scoreboard-controls {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: var(--scoreboard-spacing-md, 1.15rem);
}

.community-page .scoreboard-controls-grid {
  justify-content: center;
  gap: 0.75em;
}

.community-page .scoreboard-sort {
  flex: 0 1 180px;
  max-width: 180px;
}

.community-page .scoreboard-results {
  flex: 0 0 auto;
  font-size: 0.9em;
  color: var(--community-text-secondary);
}

/* ================================================
   CONTENT GRID
   ================================================ */
.community-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1em;
  padding: 1em 0;
  max-width: 1400px;
  margin: 0 auto;
}

/* Loading state */
.community-grid .loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3em;
  color: var(--community-text-secondary);
}

.community-grid .loading-spinner p {
  font-size: 1.1em;
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* ================================================
   CONTENT CARD - Centered Instagram-Style Layout
   ================================================ */
.community-card {
  background: var(--community-card-bg);
  border: 2px solid var(--community-accent);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;  /* Vertical stacking */
  align-items: center;  /* Center all children horizontally */
  padding: 1.5em 1.2em;  /* More vertical padding for vertical layout */
  text-align: center;  /* Center text content */
}

.community-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(255, 238, 0, 0.3);
}

/* ================================================
   PROFILE SECTION - Centered at Top
   ================================================ */
.community-card-profile-section {
  margin-bottom: 0.8em;
  display: flex;
  justify-content: center;
}

.community-card-profile-picture {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffee00;  /* Jamaica yellow */
  box-shadow:
    0 0 0 3px rgba(255, 238, 0, 0.2),  /* Inner ring */
    0 2px 8px rgba(255, 238, 0, 0.3);  /* Outer glow */
  transition: all 0.3s ease;
  margin: 0 auto 0.8em auto;  /* Center profile */
  display: block;
}

.community-card:hover .community-card-profile-picture {
  box-shadow:
    0 0 0 3px rgba(255, 238, 0, 0.4),
    0 4px 12px rgba(255, 238, 0, 0.5);
  transform: scale(1.05);
}

.community-card-profile-initial {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffee00 0%, #ffd700 100%);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 24px;
  border: 2px solid #ffee00;
  box-shadow:
    0 0 0 3px rgba(255, 238, 0, 0.2),
    0 2px 8px rgba(255, 238, 0, 0.3);
  transition: all 0.3s ease;
  margin: 0 auto 0.8em auto;  /* Center fallback */
}

/* ================================================
   VIDEO/CONTENT PREVIEW - Centered Small Accent
   ================================================ */
.video-preview {
  width: 50px;  /* Smaller accent size */
  min-width: 50px;
  max-width: 50px;
  aspect-ratio: 9 / 16;  /* 50px wide = 88px tall */
  background: #000;
  border: none;  /* Explicitly prevent any browser default borders */
  outline: none;  /* Prevent focus-related outlines (not interactive element) */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  flex-shrink: 0;
  margin: 0 auto 1em auto;  /* Center preview */
}

/* Clickable preview hover effects (Issue #2 - Clickable Video Preview) */
.video-preview.clickable-preview {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-preview.clickable-preview:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 238, 0, 0.4);
}

.video-preview.clickable-preview:focus {
  outline: 2px solid var(--community-accent);
  outline-offset: 2px;
}

/* Thumbnail image */
.video-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder for content without thumbnail - Icon-Only Design */
.video-preview .content-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 1px solid rgba(255, 238, 0, 0.3);
  border-radius: 4px;
}

.video-preview .content-placeholder i {
  font-size: 2em;
  opacity: 1;
  transition: transform 0.2s ease;
}

/* Platform-specific icon colors for brand recognition */
.video-preview .content-placeholder .fa-youtube {
  color: #ff0000;
}

.video-preview .content-placeholder .fa-tiktok {
  color: #000000;
  background: white;
  border-radius: 50%;
  padding: 0.2em;
}

.video-preview .content-placeholder .fa-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.video-preview .content-placeholder .fa-facebook {
  color: #1877f2;
}

.video-preview .content-placeholder .fa-twitter {
  color: #1da1f2;
}

.video-preview .content-placeholder .fa-blog {
  color: #ffee00;
}

.video-preview .content-placeholder .fa-globe {
  color: #9ca3af;
}

/* Hover effect */
.community-card:hover .video-preview .content-placeholder i {
  transform: scale(1.1);
}

/* ================================================
   CREATOR INFO SECTION - Centered
   ================================================ */
.community-card-creator-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
  margin-bottom: 0.8em;
}

.community-card-creator-name {
  font-size: 1.2em;
  font-weight: 600;
  color: #ffffff;  /* Pure white for maximum brightness */
  line-height: 1.2;
}

.community-card-creator-handle {
  font-size: 0.9em;
  color: #ffee00;
  font-weight: 500;
}

/* ===== TEXT OVERFLOW FIX - Domain Zero Standard ===== */
.community-card-creator-name,
.community-card-creator-handle {
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.community-card-description {
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ================================================
   BADGES ROW - Centered, Separate from Creator
   ================================================ */
.community-card-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;  /* Center badges */
  gap: 0.4em;
  margin-bottom: 1em;
}

/* ================================================
   PLATFORM BADGES - Slightly Smaller for Centered Layout
   ================================================ */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3em 0.7em;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.platform-badge.youtube {
  background: #ff0000;
  color: white;
}

.platform-badge.tiktok {
  background: #000000;
  color: white;
  border: 1px solid #ffffff;
}

.platform-badge.instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: white;
}

.platform-badge.facebook {
  background: #1877f2;
  color: white;
}

.platform-badge.twitter {
  background: #1da1f2;
  color: white;
}

.platform-badge.blog_site {
  background: var(--community-success);
  color: white;
}

.platform-badge.vlog {
  background: #9333ea;
  color: white;
}

.platform-badge.other {
  background: #6b7280;
  color: white;
}

/* ================================================
   PROGRAM BADGES (J-1 / H-2B) - Compact
   ================================================ */
.program-badge {
  display: inline-block;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
}

.program-badge.j1 {
  background: var(--community-accent);
  color: #000;
}

.program-badge.h2b {
  background: var(--community-success);
  color: white;
}

/* ================================================
   CONTENT TYPE BADGES - Compact
   ================================================ */
.content-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  font-size: 0.7em;
  font-weight: 500;
  background: rgba(255, 238, 0, 0.2);
  color: #ffee00;
  border: 1px solid rgba(255, 238, 0, 0.4);
}

/* ================================================
   CARD BODY
   ================================================ */
.community-card-title {
  color: var(--community-accent);
  font-size: 1em;
  font-weight: 700;
  margin-bottom: 0.3em;
  line-height: 1.3;
}

.community-card-creator {
  font-size: 1em;
  font-weight: 500;
  color: #ffffff;  /* Pure white for maximum brightness */
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.community-card-creator i {
  margin-right: 0.3em;
  color: var(--community-accent);
}

.community-card-creator .user-handle {
  font-size: 0.95em;
  font-weight: 600;
  color: #ffee00;
}

.community-card-description {
  font-size: 0.95em;
  line-height: 1.5;
  color: #ffffff;  /* Pure white for maximum brightness */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 1em 0;
  text-align: left;  /* Left-align for better readability */
  width: 100%;  /* Full width */
}

/* Card footer with date and link */
.community-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.8em;
  border-top: 1px solid rgba(255, 238, 0, 0.2);
  width: 100%;  /* Full width */
  background-color: #000000; /* Pure black footer */
}

.community-card-date {
  font-size: 0.85em;
  color: #c2c6cc;  /* WCAG AA: 4.8:1 contrast */
  font-weight: 500;
}

.community-card-link {
  font-size: 0.95em;
  font-weight: 600;
  color: #ffee00;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  transition: gap 0.2s ease;
}

.community-card-link:hover {
  gap: 0.6em;
  text-decoration: underline;
}

.community-card-link i {
  font-size: 0.9em;
}

/* ================================================
   SUBMIT SECTION
   ================================================ */
.community-submit-section {
  text-align: center;
  padding: 2em 0;
}

.community-submit-section .btn-standard {
  min-width: 250px;
}

/* ================================================
   EMPTY STATE
   ================================================ */
.empty-state {
  text-align: center;
  padding: 4em 2em;
  color: var(--community-text-secondary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--community-border);
  border-radius: var(--community-radius);
  margin: 2em 0;
}

.empty-state i {
  font-size: 4em;
  margin-bottom: 0.5em;
  color: var(--community-accent);
}

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

.empty-state p {
  font-size: 1.1em;
  margin-bottom: 1.5em;
}

/* ================================================
   PAGINATION CONTROLS
   ================================================ */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5em;
  padding: 2em 0;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--community-card-bg);
  border: 2px solid var(--community-border);
  border-radius: 8px;
  color: var(--community-text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--community-transition);
}

.pagination-btn:hover {
  border-color: var(--community-accent);
  color: var(--community-accent);
}

.pagination-btn.active {
  background: var(--community-accent);
  border-color: var(--community-accent);
  color: #000;
}

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

.pagination-btn:disabled:hover {
  border-color: var(--community-border);
  color: var(--community-text-primary);
}

.pagination-info {
  color: var(--community-text-secondary);
  font-size: 0.9em;
  padding: 0 1em;
}

/* ================================================
   SUBMISSION MODAL STYLES
   ================================================ */
.community-submission-modal .modal-content {
  max-width: 600px;
  max-height: 90vh; /* Prevent modal from exceeding viewport height */
  overflow-y: auto; /* Enable scrolling for overflow content */
  margin: 2% auto; /* Reduced margin for better fit */
  padding: 1.5em; /* Slightly reduced padding */
}

.community-submission-modal .form-group {
  margin-bottom: 1.5em;
  text-align: left;
}

.community-submission-modal label {
  display: block;
  color: var(--community-accent);
  font-weight: 600;
  margin-bottom: 0.5em;
  font-size: 0.95em;
}

.community-submission-modal .required-indicator {
  color: #dc3545;
}

.community-submission-modal input[type="text"],
.community-submission-modal input[type="email"],
.community-submission-modal input[type="url"],
.community-submission-modal input[type="date"],
.community-submission-modal select,
.community-submission-modal textarea {
  width: 100%;
  padding: 0.75em 1em;
  background: var(--community-card-bg);
  border: 2px solid var(--community-border);
  border-radius: 8px;
  color: var(--community-text-primary);
  font-size: 1em;
  transition: border-color var(--community-transition);
}

.community-submission-modal input:focus,
.community-submission-modal select:focus,
.community-submission-modal textarea:focus {
  outline: none;
  border-color: var(--community-accent);
  background-color: var(--community-card-bg) !important; /* Override main.css #f8f8f8 focus */
  color: var(--community-text-primary) !important; /* Ensure white text stays visible */
}

.community-submission-modal textarea {
  min-height: 100px;
  resize: vertical;
}

.community-submission-modal .char-count {
  text-align: right;
  font-size: 0.8em;
  color: var(--community-text-muted);
  margin-top: 0.3em;
}

.community-submission-modal .char-count.warning {
  color: #ffc107;
}

.community-submission-modal .char-count.error {
  color: #dc3545;
}

.community-submission-modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
}

.community-submission-modal .form-actions {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-top: 2em;
}

/* TOS Acceptance Checkbox Styling */
.community-submission-modal .tos-acceptance {
  background: rgba(255, 238, 0, 0.05);
  border: 2px solid rgba(255, 238, 0, 0.3);
  border-radius: 8px;
  padding: 1em;
  margin-top: 1.5em;
}

.community-submission-modal .tos-acceptance .checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 0.75em;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.community-submission-modal .tos-acceptance input[type="checkbox"] {
  /* Hide default checkbox */
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 0;
  height: 0;
}

.community-submission-modal .tos-acceptance .checkmark {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background-color: rgba(255, 238, 0, 0.25);  /* VISIBILITY FIX: 25% opacity for better visibility */
  border: 2px solid var(--community-accent);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
  margin-top: 2px; /* Align with text baseline */
}

.community-submission-modal .tos-acceptance .checkmark:hover {
  background-color: rgba(255, 238, 0, 0.35);  /* ENHANCED: 35% opacity for brighter hover feedback */
  box-shadow: 0 0 8px rgba(255, 238, 0, 0.4);  /* ENHANCED: Stronger glow effect */
}

.community-submission-modal .tos-acceptance input[type="checkbox"]:checked ~ .checkmark {
  background-color: var(--community-accent);
  border-color: var(--community-accent);
}

.community-submission-modal .tos-acceptance input[type="checkbox"]:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  display: block;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid #000000;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.community-submission-modal .tos-acceptance input[type="checkbox"]:focus ~ .checkmark {
  outline: 2px solid var(--community-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 238, 0, 0.3);  /* ENHANCED: Keyboard focus glow */
}

.community-submission-modal .tos-acceptance label {
  color: var(--community-text-primary);
  font-weight: 400;
  font-size: 0.95em;
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.community-submission-modal .tos-acceptance label a {
  color: var(--community-accent);
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s ease;
}

.community-submission-modal .tos-acceptance label a:hover {
  color: #fff45a;
}

/* Field error styles */
.community-submission-modal .field-error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.community-submission-modal .field-error-message {
  display: flex;
  align-items: center;
  gap: 0.4em;
  color: #dc3545;
  font-size: 0.85em;
  margin-top: 0.4em;
  padding: 0.4em 0.6em;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 4px;
  animation: errorShake 0.4s ease;
}

.community-submission-modal .field-error-message i {
  flex-shrink: 0;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Error toast notification */
.community-error-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 1em 1.5em;
  background: #dc3545;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(220, 53, 69, 0.4);
  z-index: 10005;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: 90%;
}

.community-error-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.community-error-toast i {
  font-size: 1.2em;
  flex-shrink: 0;
}

.community-error-toast span {
  flex: 1;
  font-size: 0.95em;
  line-height: 1.4;
}

.community-error-toast .toast-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.4em;
  cursor: pointer;
  padding: 0 0.25em;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.community-error-toast .toast-close:hover {
  opacity: 1;
}

/* ================================================
   WELCOME MODAL STYLES
   ================================================ */
.community-welcome-modal .modal-content {
  max-width: 800px;
  max-height: 95vh;
  padding: 2em 2.5em;
  overflow-y: auto;
  text-align: center;
  scroll-behavior: smooth;
}

.community-welcome-modal .welcome-icon {
  font-size: 2.5em;
  color: var(--community-accent);
  margin-bottom: 0.5em;
}

.community-welcome-modal .welcome-icon i {
  color: #ffee00;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.community-welcome-modal .welcome-title {
  color: var(--community-accent);
  font-size: 1.6em;
  margin-bottom: 0.3em;
  line-height: 1.2;
}

.community-welcome-modal .welcome-subtitle {
  color: var(--community-text-secondary);
  font-size: 1em;
  margin-bottom: 1.25em;
}

/* 2-Column Content Grid - Nobara's Compact Design */
.community-welcome-modal .content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5em;
  margin-bottom: 1em;
}

.community-welcome-modal .benefits-section,
.community-welcome-modal .rules-list {
  margin-bottom: 0;
}

.community-welcome-modal .benefits-section h4,
.community-welcome-modal .rules-list h4 {
  font-size: 1.1em;
  margin-bottom: 0.75em;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

/* Rules List - Compact Design */
.community-welcome-modal .rules-list {
  text-align: left;
  padding-left: 1.5em;
}

.community-welcome-modal .rules-list ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.community-welcome-modal .rules-list ul li {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  margin-bottom: 0.6em;
}

.community-welcome-modal .rules-list ul li i {
  color: #28a745;
  margin-top: 0.15em;
  flex-shrink: 0;
}

.community-welcome-modal .rules-list ul li span {
  font-size: 0.85em;
  line-height: 1.4;
  color: #ffffff;  /* Pure white for visibility on dark background */
}

/* Welcome Message - Compact */
.community-welcome-modal .welcome-message {
  font-size: 0.95em;
  text-align: center;
  margin-bottom: 1em;
  color: #ffffff;  /* Pure white for visibility on dark background */
  font-weight: 500;
}

/* Acknowledgment Checkbox - Compact */
.community-welcome-modal .acknowledgment {
  margin-bottom: 1.25em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
}

.community-welcome-modal .acknowledgment label {
  font-size: 0.9em;
  cursor: pointer;
}

/* Custom Checkbox Styling - Visible gold on dark background */
.community-welcome-modal .acknowledgment input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background-color: rgba(255, 238, 0, 0.25);
  border: 2px solid var(--community-accent);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.community-welcome-modal .acknowledgment input[type="checkbox"]:hover {
  background-color: rgba(255, 238, 0, 0.35);
  box-shadow: 0 0 8px rgba(255, 238, 0, 0.4);
}

.community-welcome-modal .acknowledgment input[type="checkbox"]:checked {
  background-color: var(--community-accent);
}

.community-welcome-modal .acknowledgment input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #1a1a1a;
  font-size: 14px;
  font-weight: bold;
}

/* Modal Buttons - Compact */
.community-welcome-modal .modal-buttons {
  display: flex;
  gap: 1em;
  justify-content: center;
  margin-top: 0;
}

.community-welcome-modal .modal-buttons button {
  padding: 0.7em 1.5em;
  font-size: 0.95em;
  min-width: 180px;
}

/* Benefits Section - Compact Design with Divider */
.community-welcome-modal .benefits-section {
  text-align: left;
  border-right: 2px solid #f0f0f0;
  padding-right: 1.5em;
}

.community-welcome-modal .benefits-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.community-welcome-modal .benefit-item {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.community-welcome-modal .benefit-item i {
  font-size: 1.2em;
  color: #ffee00;
  margin-bottom: 0.25em;
}

.community-welcome-modal .benefit-item strong {
  font-size: 0.95em;
  color: #000;
}

.community-welcome-modal .benefit-item span {
  font-size: 0.85em;
  color: #ffffff;  /* Pure white for visibility on dark background */
  line-height: 1.4;
}

/* Responsive Breakpoints for Community Welcome Modal */
@media (max-width: 768px) {
  .community-welcome-modal .content-grid {
    grid-template-columns: 1fr;
    gap: 1.5em;
  }

  .community-welcome-modal .modal-content {
    max-height: 96vh;
    padding: 1.5em;
  }

  .community-welcome-modal .benefits-section {
    border-right: none;
    padding-right: 0;
    margin-bottom: 1.5em;
  }

  .community-welcome-modal .rules-list {
    padding-left: 0;
  }

  .community-welcome-modal .modal-buttons {
    flex-direction: column;
  }

  .community-welcome-modal .modal-buttons button {
    width: 100%;
    min-width: unset;
  }
}

@media (max-width: 480px) {
  .community-welcome-modal .modal-content {
    max-height: 97vh;
    padding: 1em;
  }

  .community-welcome-modal .welcome-title {
    font-size: 1.3em;
  }

  .community-welcome-modal .welcome-icon {
    font-size: 2em;
  }
}

/* ================================================
   DROPDOWN/SELECT FIX - Dark background for options
   ================================================ */
.community-submission-modal select {
  background-color: #1a1a1a;
  color: #ffffff;
}

.community-submission-modal select option {
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 0.5em;
}

.community-submission-modal select option:hover,
.community-submission-modal select option:focus,
.community-submission-modal select option:checked {
  background-color: #333333;
  color: #ffee00;
}

/* ================================================
   SUCCESS CONFIRMATION MODAL
   ================================================ */
.community-success-modal .modal-content {
  max-width: 450px;
  text-align: center;
  padding: 2em;
}

.community-success-modal .success-icon {
  font-size: 4em;
  color: var(--community-success);
  margin-bottom: 0.5em;
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.community-success-modal h2 {
  color: var(--community-accent);
  font-size: 1.6em;
  margin-bottom: 0.75em;
}

.community-success-modal .success-message {
  color: var(--community-text-primary);
  font-size: 1.1em;
  margin-bottom: 0.75em;
  line-height: 1.5;
}

.community-success-modal .success-details {
  color: var(--community-text-secondary);
  font-size: 0.95em;
  margin-bottom: 1.25em;
  line-height: 1.5;
}

.community-success-modal .success-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.75em 1.25em;
  background: rgba(255, 238, 0, 0.1);
  border: 1px solid rgba(255, 238, 0, 0.3);
  border-radius: 8px;
  color: var(--community-accent);
  font-size: 0.9em;
  margin-bottom: 1.5em;
}

.community-success-modal .success-info i {
  color: var(--community-accent);
}

.community-success-modal #btn-close-success {
  min-width: 180px;
}

/* Mobile responsive for success modal */
@media (max-width: 480px) {
  .community-success-modal .modal-content {
    max-width: 95%;
    padding: 1.5em;
  }

  .community-success-modal .success-icon {
    font-size: 3em;
  }

  .community-success-modal h2 {
    font-size: 1.3em;
  }

  .community-success-modal .success-message {
    font-size: 1em;
  }

  .community-success-modal .success-details {
    font-size: 0.9em;
  }
}

/* ================================================
   RESPONSIVE STYLES
   ================================================ */
@media (max-width: 768px) {
  .community-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75em;
    padding: 0.75em 1em;
  }

  .community-card {
    padding: 1.2em 1em;
  }

  .community-card-creator-name {
    font-size: 1.1em;
  }

  .community-card-description {
    font-size: 0.9em;
  }

  .video-preview {
    width: 45px;  /* Slightly smaller on tablet */
    min-width: 45px;
    max-width: 45px;
  }

  .platform-badge {
    font-size: 0.7em;
  }

  .community-submission-modal .form-row {
    grid-template-columns: 1fr;
  }

  .community-submission-modal .modal-content {
    max-width: 95%;
    max-height: 85vh;
    margin: 5% auto;
    padding: 1.25em;
  }

  .community-submission-modal h2 {
    font-size: 1.4em;
  }

  .community-submission-modal .form-actions {
    flex-direction: column;
    gap: 0.75em;
  }

  .community-submission-modal .form-actions .btn-standard {
    width: 100%;
  }

  .video-preview[data-platform="tiktok"],
  .video-preview[data-platform="instagram"] {
    max-width: 100%;
  }

  .community-page .scoreboard-controls-grid {
    gap: 0.5em;
  }

  .community-page .scoreboard-sort {
    flex: 0 1 160px;
    max-width: 160px;
  }
}

@media (max-width: 480px) {
  .community-grid {
    grid-template-columns: 1fr;
    gap: 0.5em;
    padding: 0.5em 0.75em;
  }

  .community-submit-section .btn-standard {
    width: 100%;
  }

  .pagination-controls {
    gap: 0.3em;
  }

  .pagination-btn {
    min-width: 35px;
    height: 35px;
    font-size: 0.9em;
  }

  .community-page .scoreboard-controls-grid {
    gap: 0.4em;
  }

  .community-page .scoreboard-sort {
    flex: 0 1 140px;
    max-width: 140px;
  }

  .community-card {
    padding: 1em 0.8em;
  }

  .community-card-creator-name {
    font-size: 1em;
  }

  .community-card-creator-handle {
    font-size: 0.85em;
  }

  .community-card-badges {
    gap: 0.3em;
  }

  .platform-badge,
  .program-badge,
  .content-type-badge {
    font-size: 0.65em;
    padding: 0.25em 0.5em;
  }

  .community-card-description {
    font-size: 0.85em;
    -webkit-line-clamp: 2;  /* 2 lines on mobile */
  }

  .video-preview {
    width: 45px;  /* Maintain smaller size */
    min-width: 45px;
    max-width: 45px;
    margin-bottom: 0.8em;
  }

  .community-card-footer {
    flex-direction: column;
    align-items: center;  /* Center on mobile */
    gap: 0.5em;
    text-align: center;
  }

  .community-card-link {
    font-size: 0.9em;
  }

  /* Mobile modal optimizations */
  .community-submission-modal .modal-content {
    max-width: 98%;
    max-height: 90vh;
    margin: 2% auto;
    padding: 1em;
  }

  .community-submission-modal h2 {
    font-size: 1.2em;
    margin-bottom: 0.75em;
  }

  .community-submission-modal .modal-description {
    font-size: 0.9em;
    margin-bottom: 1em;
  }

  .community-submission-modal .form-group {
    margin-bottom: 1em;
  }

  .community-submission-modal label {
    font-size: 0.85em;
    margin-bottom: 0.4em;
  }

  .community-submission-modal input,
  .community-submission-modal select,
  .community-submission-modal textarea {
    padding: 0.6em 0.75em;
    font-size: 0.95em;
  }

  .community-submission-modal .tos-acceptance label {
    font-size: 0.85em;
    line-height: 1.4;
  }
}

/* ================================================
   SOCIAL HANDLE INPUT PREFIX STYLING
   CSP-compliant replacement for inline styles
   Created: 2025-12-31 (Issue #1 - CSP Violation Fix)
   ================================================ */

.social-handle-input-group {
  display: flex;
  align-items: center;
}

.social-handle-prefix {
  padding: 8px 12px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 4px 0 0 4px;
  color: #333;
  font-weight: 500;
  font-size: 1em;
  user-select: none;
}

.social-handle-input {
  flex: 1;
  border-radius: 0 4px 4px 0;
}

/* ================================================
   ACCESSIBILITY
   ================================================ */
@media (prefers-reduced-motion: reduce) {
  .community-card,
  .video-preview .play-overlay,
  .pagination-btn,
  .community-card-link {
    transition: none;
  }

  .community-card:hover {
    transform: none;
  }
}

/* Focus styles for keyboard navigation */
.community-card:focus-within {
  outline: 2px solid var(--community-accent);
  outline-offset: 2px;
}

.community-card-link:focus,
.pagination-btn:focus {
  outline: 2px solid var(--community-accent);
  outline-offset: 2px;
}
