/* 
 * Cues for Cancer - Custom Styles
 * Brand: Purple primary (#6a1b9a) with accessible variants
 * Theme: Modern, theatrical, hopeful with stage lighting aesthetic
 */

:root {
  /* Brand Colors */
  --primary: #6a1b9a;
  --primary-dark: #5a1687;
  --primary-darker: #4a1174;
  --primary-light: #8e24aa;
  --secondary: #d81b60;
  --accent-rose: #f48fb1;
  --accent-rose-light: #fce4ec;

  /* Neutral Colors */
  --white: #ffffff;
  --light: #f8f9fa;
  --light-gray: #e9ecef;
  --gray: #6c757d;
  --dark: #343a40;

  /* Status Colors */
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-light));
  --gradient-secondary: linear-gradient(135deg, var(--primary-dark), var(--secondary));
  --gradient-stage: linear-gradient(45deg, rgba(106, 27, 154, 0.05), rgba(244, 143, 177, 0.05));

  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-family-headings: 'Georgia', 'Times New Roman', serif;

  /* Spacing */
  --spacer: 1rem;
  --border-radius: 0.375rem;
  --border-radius-lg: 0.75rem;

  /* Shadows */
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-focus: 0 0 0 0.25rem rgba(106, 27, 154, 0.25);
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip to content link for screen readers */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius);
  z-index: 1000;
}

.skip-to-content:focus {
  top: 6px;
}

/* Base styles */
body {
  font-family: var(--font-family-base);
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--white);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-headings);
  font-weight: 600;
  line-height: 1.3;
  color: var(--primary-darker);
}

/* Brand overrides for Bootstrap */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  font-weight: 600;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:focus {
  box-shadow: var(--shadow-focus);
}

.btn-primary:active {
  background-color: var(--primary-darker);
  border-color: var(--primary-darker);
  transform: translateY(0);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* Navigation */
.navbar {
  background-color: var(--white) !important;
  border-bottom: 1px solid var(--light-gray);
  box-shadow: var(--shadow);
}

.navbar-brand {
  font-weight: 700;
  color: var(--primary) !important;
  font-size: 1.5rem;
}

.navbar-nav .nav-link {
  color: var(--dark) !important;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: var(--primary) !important;
}

.navbar-nav .nav-link[aria-current="page"] {
  color: var(--primary) !important;
  font-weight: 600;
}

.navbar-nav .nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: var(--primary);
  border-radius: 50%;
}

/* Hero section */
.hero-section {
  background: linear-gradient(135deg, #f8f0ff 0%, #e1c4ff 25%, #c49aed 50%, #8e24aa 75%, #6a1b9a 100%);
  min-height: 70vh;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  opacity: 0;
}

/* Ensure no cancer astrology symbol appears */
.hero-section::after {
  content: '';
  display: none;
}

/* Hide any potential cancer astrology symbols */
*[data-symbol="cancer"],
*[class*="cancer-symbol"],
*[class*="astrology"],
*[class*="zodiac"] {
  display: none !important;
}

/* Prevent any Unicode cancer symbol from appearing */
.hero-section *::before,
.hero-section *::after {
  content: '' !important;
}

/* Hide any content that could be the cancer astrology symbol */
.hero-section *:contains("♋") {
  display: none !important;
  visibility: hidden !important;
}

/* Completely prevent any zodiac/astrology symbols from rendering anywhere */
*[unicode-bidi*="♋"],
*:after:contains("♋"),
*:before:contains("♋") {
  display: none !important;
  content: '' !important;
}

/* Force hide any Unicode cancer symbols */
[data-symbol*="cancer"],
[class*="zodiac"],
[class*="astro"] {
  visibility: hidden !important;
  display: none !important;
}

/* Remove any potential symbol fonts */
.hero-section * {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
}

.hero-section .container {
  position: relative;
  z-index: 2;
}

.min-vh-50 {
  min-height: 50vh;
}

/* Gradients */
.bg-gradient-primary {
  background: var(--gradient-primary) !important;
}

.bg-gradient-secondary {
  background: var(--gradient-secondary) !important;
}

/* Hero image animation */
.hero-image {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-image:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  background-color: var(--light);
  border-bottom: 1px solid var(--light-gray);
  font-weight: 600;
}

/* Forms */
.form-control {
  border-radius: var(--border-radius);
  border: 1px solid var(--light-gray);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  box-shadow: var(--shadow-focus);
}

/* Alerts */
.alert {
  border: none;
  border-radius: var(--border-radius);
  border-left: 4px solid;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  color: #155724;
  border-left-color: var(--success);
}

.alert-warning {
  background-color: rgba(255, 193, 7, 0.1);
  color: #856404;
  border-left-color: var(--warning);
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: #721c24;
  border-left-color: var(--danger);
}

.alert-info {
  background-color: rgba(23, 162, 184, 0.1);
  color: #0c5460;
  border-left-color: var(--info);
}

/* Memory wall styles */
.candle-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--border-radius-lg);
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 180px;
}

.candle-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.candle-card:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.candle-flame,
.candle-large {
  filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.3));
}

/* Story cards */
.story-card {
  transition: all 0.3s ease;
}

.story-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Team cards */
.team-card {
  transition: all 0.3s ease;
}

.team-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.team-photo {
  transition: all 0.3s ease;
}

.team-card:hover .team-photo {
  transform: scale(1.05);
}

/* Footer */
.bg-gradient-secondary {
    background: linear-gradient(135deg, #6a1b9a 0%, #8e24aa 25%, #ab47bc 50%, #ce93d8 75%, #e1bee7 100%) !important;
}

.footer {
    background-color: #2d1b69;
    color: white;
}

.footer a {
    color: #e1bee7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

.footer .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0 5px;
    transition: all 0.3s ease;
}

.footer .social-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Back to top button */
.btn-floating {
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.btn-floating:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(106, 27, 154, 0.3);
}

/* Pagination */
.pagination .page-link {
  color: var(--primary);
  border-color: var(--light-gray);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
}

.pagination .page-link:hover,
.pagination .page-link:focus {
  color: var(--primary-dark);
  border-color: var(--primary-light);
}

/* Modal enhancements */
.modal-content {
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: 1px solid var(--light-gray);
  background: linear-gradient(135deg, var(--light), var(--white));
}

.modal-title {
  color: var(--primary-darker);
}

/* Loading states */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error pages */
.error-illustration svg {
  max-width: 100%;
  height: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-section {
    min-height: 60vh;
  }

  .display-4 {
    font-size: 2.5rem;
  }

  .display-5 {
    font-size: 2rem;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .card-body {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    min-height: 50vh;
  }

  .display-4 {
    font-size: 2rem;
  }

  .display-5 {
    font-size: 1.75rem;
  }
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .btn,
  .alert,
  #back-to-top {
    display: none !important;
  }

  .container {
    max-width: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
  }

  h1, h2, h3, h4, h5, h6 {
    color: #000 !important;
    page-break-after: avoid;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary: #4a0e6b;
    --primary-dark: #3a0b55;
    --light-gray: #cccccc;
  }

  .btn-outline-primary {
    border-width: 2px;
  }

  .form-control {
    border-width: 2px;
  }
}

/* Large text support */
@media (min-resolution: 192dpi) {
  body {
    font-size: 16px;
  }
}

/* Focus styles for better accessibility */
*:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:focus {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.form-control:focus,
.form-check-input:focus {
  outline: none;
}

/* Sponsor logos */
.sponsor-logo {
  transition: all 0.3s ease;
}

.sponsor-image {
  filter: grayscale(20%) opacity(0.9);
  transition: all 0.3s ease;
}

.sponsor-logo:hover .sponsor-image {
  filter: grayscale(0%) opacity(1);
  transform: scale(1.05);
}

.sponsor-logo a:focus .sponsor-image {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: var(--border-radius);
}

/* Ensure sponsor logos are responsive */
@media (max-width: 768px) {
  .sponsor-image {
    max-height: 100px !important;
  }
}

@media (max-width: 576px) {
  .sponsor-image {
    max-height: 80px !important;
  }
}

/* Custom utility classes */
.text-primary {
  color: var(--primary) !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.border-primary {
  border-color: var(--primary) !important;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-primary {
  box-shadow: 0 4px 15px rgba(106, 27, 154, 0.2) !important;
}

/* Animation classes */
.fade-in {
  animation: fade-in 0.6s ease-out;
}

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

.slide-up {
  animation: slide-up 0.5s ease-out;
}

@keyframes slide-up {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Ensure adequate color contrast for accessibility */
.text-muted {
  color: #6c757d !important; /* Ensures 4.5:1 contrast ratio on white */
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.8) !important; /* Better contrast on dark backgrounds */
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1055;
}

/* Sponsor logo styling */
.sponsor-logo {
    padding: 20px;
    transition: all 0.3s ease;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sponsor-logo:hover {
    transform: translateY(-5px);
}

.sponsor-image {
    max-height: 120px !important;
    max-width: 200px !important;
    height: auto;
    width: auto;
    object-fit: contain;
    filter: grayscale(20%) brightness(1.1);
    transition: all 0.3s ease;
    display: block;
    background-color: transparent;
}

.sponsor-image:hover {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.05);
}

/* Ensure logos are centered and responsive */
.sponsor-logo a {
    display: inline-block;
    text-decoration: none;
    max-width: 100%;
}

@media (max-width: 768px) {
    .sponsor-image {
        max-height: 100px !important;
        max-width: 150px !important;
    }
    
    .sponsor-logo {
        min-height: 120px;
    }
}