/* Self-hosted fonts */
@font-face {
  font-family: 'Cinzel';
  src: url('fonts/cinzel_regular_macroman/Cinzel-Regular-webfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cinzel';
  src: url('fonts/cinzel_bold_macroman/Cinzel-Bold-webfont.woff') format('woff');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cinzel';
  src: url('fonts/cinzel_black_macroman/Cinzel-Black-webfont.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'CinzelDecorative';
  src: url('fonts/cinzeldecorative_regular_macroman/CinzelDecorative-Regular-webfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'CinzelDecorative';
  src: url('fonts/cinzeldecorative_bold_macroman/CinzelDecorative-Bold-webfont.woff') format('woff');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* Base styles and resets */
:root {
  --primary-color: #6a3093;
  --secondary-color: #a044ff;
  --accent-color: #e551e5;
  --glow-color: rgba(160, 68, 255, 0.8);
  --text-color: #f5f5f5;
  --dark-bg: #0d0221;
  --card-bg: rgba(16, 4, 35, 0.85);
  --button-border: rgba(122, 52, 226, 0.8);
}

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

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

body {
  font-family: 'Cinzel', Georgia, serif;
  /* background-color: #0a001f; Fallback solid color */
  /* background-image: -webkit-linear-gradient(to bottom, #0a001f 0%, #170033 50%, #290042 100%); */ /* Safari/Chrome prefix */
  /* background-image: linear-gradient(to bottom, #0a001f 0%, #170033 50%, #290042 100%); */ /* Standard syntax */
  background-image: url('images/background.jpeg');
  background-size: cover; /* Scale the image to cover the entire element */
  background-position: center center; /* Center the image */
  background-repeat: no-repeat; /* Do not repeat the image */
  background-attachment: fixed; /* Keep the background fixed during scroll */
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* Page structure */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 1200px;
  position: relative;
  margin: 0 auto;
  z-index: 1; /* Above stars */
  padding: 0 20px;
}

/* Header */
header {
  text-align: center;
  padding: 2rem 0;
  width: 100%;
  position: relative; /* Changed from absolute */
  margin-bottom: 2rem;
  z-index: 5;
}

header h1 {
  color: #7C1010; /* Set color to specific dark red/brown */
  text-shadow: none; /* Remove any text shadow */
  animation: none; /* Remove any animation */
}

h1 {
  font-size: 4.5rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.subtitle {
  font-size: 1.2rem;
  font-style: italic;
  color: #7C1010; /* Set color to specific dark red/brown */
  margin-top: 0;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

/* Main content */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 2rem 0;
  margin-top: 0; /* Remove the margin-top */
  min-height: 60vh;
}

/* Footer */
footer {
  width: 100%;
  text-align: center;
  padding: 2rem 0;
  position: relative; /* Changed from absolute */
  margin-top: auto;
  z-index: 5;
}

/* Typography */
h1, h2 {
  font-family: 'CinzelDecorative', 'Times New Roman', serif;
  margin-bottom: 0.5rem;
}

/* Glowing elements */
.glow-text {
  color: #fff;
  text-shadow: 
    0 0 5px var(--glow-color),
    0 0 10px var(--glow-color),
    0 0 20px var(--primary-color),
    0 0 30px var(--primary-color),
    0 0 40px var(--secondary-color),
    0 0 55px var(--secondary-color);
  animation: pulse 4s infinite alternate;
}

@keyframes pulse {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow:
      0 0 5px var(--glow-color),
      0 0 10px var(--glow-color),
      0 0 20px var(--primary-color),
      0 0 30px var(--primary-color),
      0 0 40px var(--secondary-color),
      0 0 55px var(--secondary-color);
  }
  20%, 24%, 55% {
    text-shadow: none;
  }
}

/* Card area */
.card-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
  padding: 0 20px;
}

.card-container {
  width: 100%;
  max-width: 350px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 
    0 0 15px rgba(106, 48, 147, 0.4),
    0 0 30px rgba(106, 48, 147, 0.2);
  z-index: 2;
}

.card-container.visible {
  opacity: 1;
  transform: translateY(0);
}

.tarot-card-wrap {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.tarot-card-wrap::before {
  content: '';
  display: block;
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border: 1px solid rgba(176, 130, 230, 0.3);
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(176, 130, 230, 0.2);
  z-index: 0;
  pointer-events: none;
}

.tarot-card-wrap img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 5px;
  box-shadow: 0 0 15px rgba(225, 125, 255, 0.7);
  transition: transform 0.5s ease;
}

.tarot-card-wrap img:hover {
  transform: scale(1.03);
}

.card-container h2 {
  font-size: 2rem;
  margin-top: 1.5rem;
  text-align: center;
  font-family: 'CinzelDecorative', 'Times New Roman', serif;
  color: var(--accent-color);
  text-shadow: 0 0 8px rgba(229, 81, 229, 0.4);
}

.card-container p {
  font-size: 1.1rem;
  text-align: center;
  margin-top: 0.8rem;
  line-height: 1.6;
  max-width: 90%;
  margin-bottom: 1rem;
}

/* Buttons */
.mystical-button {
  background: linear-gradient(135deg, rgba(106, 48, 147, 0.8) 0%, rgba(160, 68, 255, 0.8) 100%);
  color: white;
  border: 1px solid var(--button-border);
  padding: 12px 24px;
  font-size: 1.2rem;
  font-family: 'CinzelDecorative', 'Times New Roman', serif;
  cursor: pointer;
  border-radius: 30px;
  box-shadow: 0 0 15px rgba(106, 48, 147, 0.5);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  min-width: 180px;
  margin: 0 0 2rem 0;
}

.mystical-button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.6s ease;
  z-index: -1;
}

.mystical-button:hover:before {
  left: 100%;
}

.mystical-button:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 5px 15px rgba(106, 48, 147, 0.6),
    0 0 20px rgba(160, 68, 255, 0.4);
}

.mystical-button:active {
  transform: translateY(0);
}

.mystical-button.secondary {
  background: linear-gradient(135deg, rgba(48, 62, 147, 0.8) 0%, rgba(68, 106, 255, 0.8) 100%);
  font-size: 0.9rem;
  padding: 8px 16px;
  min-width: 150px;
}

/* Footer styles */
.footer-links {
  margin-top: 1rem;
}

.footer-links a {
  color: #7C1010; /* Set color to specific dark red/brown */
  text-decoration: none;
  transition: color 0.3s;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent-color); /* Keep hover color distinct or change if needed */
  text-decoration: underline;
}

/* Moon */
.moon {
  position: fixed;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(240, 240, 255, 0.9) 5%, rgba(235, 240, 255, 0.6) 30%, rgba(190, 200, 255, 0.4) 70%);
  box-shadow: 
    0 0 50px rgba(255, 255, 255, 0.8),
    0 0 100px rgba(180, 180, 255, 0.4);
  top: 15%;
  right: 10%;
  z-index: 0;
  pointer-events: none;
}

/* Stars background */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1; /* Put stars behind everything */
}

#stars1, #stars2, #stars3 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

#stars1 {
  background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><circle cx="5" cy="5" r="1" fill="rgba(255, 255, 255, 0.7)"/></svg>') repeat;
  background-size: 200px 200px;
  animation: animateStars 50s linear infinite;
  opacity: 0.7;
}

#stars2 {
  background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><circle cx="5" cy="5" r="0.8" fill="rgba(255, 255, 255, 0.5)"/></svg>') repeat;
  background-size: 300px 300px;
  animation: animateStars 100s linear infinite;
  opacity: 0.5;
}

#stars3 {
  background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><circle cx="5" cy="5" r="0.5" fill="rgba(255, 255, 255, 0.3)"/></svg>') repeat;
  background-size: 400px 400px;
  animation: animateStars 150s linear infinite;
  opacity: 0.3;
}

@keyframes animateStars {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 100% 100%;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  h1 {
    font-size: 3.5rem;
  }
  
  main {
    margin-top: 10rem;
  }
  
  .card-container {
    padding: 1rem;
  }
  
  .moon {
    width: 100px;
    height: 100px;
    top: 5%;
    right: 5%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.5rem;
  }
  
  .mystical-button {
    font-size: 1rem;
    min-width: 150px;
  }
  
  .card-container h2 {
    font-size: 1.5rem;
  }
  
  .card-container p {
    font-size: 1rem;
  }
  
  .moon {
    width: 80px;
    height: 80px;
  }
}

/* Reading Page Specific Styles */
.reading-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px; /* Allow more width for 3 cards */
  padding: 0 20px;
}

.card-options-container {
  display: flex;
  justify-content: space-around; /* Space out cards */
  align-items: flex-start; /* Align tops */
  width: 100%;
  margin-bottom: 2rem;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.card-placeholder {
  width: calc(33% - 20px); /* Adjust width for spacing */
  min-width: 150px; /* Minimum size */
  max-width: 200px; /* Max size */
  margin: 10px;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: relative;
}

.card-placeholder img {
  width: 100%;
  height: auto;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(225, 125, 255, 0.5);
}

.card-placeholder:hover {
  transform: translateY(-5px) scale(1.02);
}

.card-placeholder.selected {
  /* Style for the selected card placeholder (optional, maybe highlight border) */
  /* transform: scale(1.05); */
  /* border: 2px solid var(--accent-color); */
}

.card-placeholder.not-selected {
  opacity: 0.5;
  transform: scale(0.95);
  cursor: default;
}

.reading-result-container {
  width: 100%;
  max-width: 450px; /* Similar width to single card display */
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 
    0 0 15px rgba(106, 48, 147, 0.4),
    0 0 30px rgba(106, 48, 147, 0.2);
  z-index: 2;
}

.reading-result-container.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Ensure result elements are styled similarly to main page */
.reading-result-container .tarot-card-wrap {
  max-width: 280px;
  margin-bottom: 1rem;
}

.reading-result-container h2 {
  font-size: 2rem;
  margin-top: 1rem;
  text-align: center;
  font-family: 'CinzelDecorative', 'Times New Roman', serif;
  color: var(--accent-color);
  text-shadow: 0 0 8px rgba(229, 81, 229, 0.4);
}

.reading-result-container p {
  font-size: 1.1rem;
  text-align: center;
  margin-top: 0.8rem;
  line-height: 1.6;
  max-width: 90%;
  margin-bottom: 1rem;
}


/* Responsive adjustments for reading page */
@media (max-width: 600px) {
  .card-options-container {
    flex-direction: column;
    align-items: center;
  }
  .card-placeholder {
    width: 80%;
    max-width: 250px; /* Allow slightly larger on mobile column */
    margin: 15px 0;
  }
  .reading-result-container {
    max-width: 90%;
  }
}

/* Page Overlay for Loading/Audio State */
.page-overlay {
  position: fixed; /* Cover the viewport */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(13, 2, 33, 0.7); /* Semi-transparent dark background */
  backdrop-filter: blur(5px); /* Apply blur to content behind */
  -webkit-backdrop-filter: blur(5px); /* Safari support */
  z-index: 999; /* Ensure it's on top */
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  color: var(--text-color);
  font-size: 1.5rem;
  font-family: 'CinzelDecorative', serif;
}

.page-overlay.visible {
  display: flex; /* Show it */
}

/* Optional: Add styles for a spinner if you uncomment it in HTML */
/*
.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid var(--accent-color);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Cookie Consent Banner */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(13, 2, 33, 0.95); /* Darker, less transparent */
  padding: 1rem 1.5rem;
  z-index: 1000; /* Above everything else */
  display: flex; /* Use flex to align items */
  justify-content: space-between; /* Space between text and button */
  align-items: center;
  border-top: 1px solid var(--button-border);
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.cookie-consent-banner p {
  color: var(--text-color);
  font-size: 0.9rem;
  margin: 0.5rem 1rem 0.5rem 0; /* Add some margin */
  flex-grow: 1; /* Allow text to take available space */
  line-height: 1.4;
}

.cookie-consent-banner a {
  color: var(--accent-color);
  text-decoration: underline;
}

.cookie-consent-banner button {
  margin-left: 1rem; /* Space button from text */
  padding: 8px 16px; /* Smaller padding */
  font-size: 0.9rem; /* Smaller font */
  min-width: 100px;
  flex-shrink: 0; /* Prevent button from shrinking too much */
}

/* Style the button container */
.cookie-consent-buttons {
  display: flex;
  margin-left: 1rem; /* Space button group from text */
  flex-shrink: 0; /* Prevent button group from shrinking */
}

/* Space between buttons */
.cookie-consent-buttons button + button {
  margin-left: 0.5rem; 
}

/* Optional: Style decline button differently */
.cookie-consent-buttons button.decline {
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.7) 0%, rgba(150, 150, 150, 0.7) 100%);
  border-color: rgba(150, 150, 150, 0.8);
}

.cookie-consent-buttons button.decline:hover {
  background: linear-gradient(135deg, rgba(120, 120, 120, 0.8) 0%, rgba(170, 170, 170, 0.8) 100%);
  box-shadow: 
    0 5px 15px rgba(100, 100, 100, 0.4),
    0 0 20px rgba(150, 150, 150, 0.2);
}

/* Responsive adjustments for banner */
@media (max-width: 768px) { /* Adjust breakpoint slightly */
  .cookie-consent-banner {
    flex-direction: column;
    align-items: stretch; /* Stretch items */
    text-align: center;
  }
  .cookie-consent-banner p {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  .cookie-consent-banner button {
    margin-left: 0;
    width: auto; /* Allow buttons to size naturally */
    margin-bottom: 0.5rem; /* Add space below buttons */
  }
  .cookie-consent-buttons {
    width: 100%;
    justify-content: center; /* Center buttons on mobile */
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* General Popup Styles */
.popup-overlay {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(13, 2, 33, 0.8); /* Slightly more transparent than page overlay? */
  backdrop-filter: blur(3px); 
  -webkit-backdrop-filter: blur(3px); 
  z-index: 1010; /* Above cookie banner */
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.popup-overlay.visible {
  display: flex; /* Show it */
}

.popup-content {
  background: var(--card-bg);
  padding: 2.5rem 2rem 2rem 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(160, 68, 255, 0.3);
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  border: 1px solid var(--button-border);
}

.popup-content h2 {
  font-family: 'CinzelDecorative', serif;
  color: var(--accent-color);
  margin-top: 0;
  margin-bottom: 1rem;
}

.popup-content p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.popup-content .mystical-button {
    display: block; /* Make link button block */
    width: fit-content;
    margin: 1rem auto 0 auto;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-color);
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.close-button:hover {
  opacity: 1;
}

/* Action Buttons on Reading Page */
.reading-action-buttons {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  justify-content: center; /* Center buttons */
  gap: 1rem; /* Space between buttons */
  margin-top: 1.5rem;
  width: 100%;
}

.reading-action-buttons .mystical-button {
  margin: 0.5rem 0; /* Vertical margin */
}

/* Accordion Styles (offers.html) */
.accordion-container {
  margin-top: 2rem;
  border: 1px solid var(--button-border);
  border-radius: 8px;
  overflow: hidden; /* Important for border-radius */
}

.accordion-item {
  border-bottom: 1px solid var(--button-border);
}

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

.accordion-header {
  background-color: rgba(160, 68, 255, 0.15); 
  color: var(--text-color);
  cursor: pointer;
  padding: 1rem 1.5rem;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  font-size: 1.2rem;
  font-family: 'CinzelDecorative', serif;
  transition: background-color 0.3s ease;
  position: relative; /* Keep for potential absolute children if not using flex for ::after */
  display: flex; /* Use flexbox */
  justify-content: space-between; /* Push text and indicator apart */
  align-items: center; /* Vertically align text and indicator */
}

.accordion-header::after {
  content: '+'; 
  font-size: 1.3rem; /* Reduced font size */
  line-height: 1; /* Explicit line height */
  color: var(--accent-color);
  transition: transform 0.3s ease;
  flex-shrink: 0; 
  margin-left: 1rem; 
}

.accordion-header.active::after {
  content: "−"; 
  transform: rotate(180deg);
}

.accordion-header:hover {
  background-color: rgba(160, 68, 255, 0.25);
}

.accordion-content {
  padding: 0 1.5rem; /* No padding top/bottom initially */
  background-color: rgba(13, 2, 33, 0.5); /* Slightly darker background */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out; /* Smooth transition */
}

.accordion-content p {
    margin-top: 1rem; /* Add space inside */
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
}

.accordion-header.active + .accordion-content {
  max-height: 1500px; /* INCREASED max-height significantly */
  padding: 1rem 1.5rem; 
  transition: max-height 0.5s ease-in, padding 0.5s ease-in;
}

.legal-notice {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-top: 1rem;
}

/* Responsive Styles for Accordion */
@media (max-width: 600px) {
  .accordion-header {
    padding: 0.8rem 1rem; /* Reduced padding */
    font-size: 1rem; /* Reduced font size */
  }

  .accordion-header::after {
    font-size: 1.1rem; /* Reduced indicator size */
    margin-left: 0.5rem; /* Reduced space */
  }

  .accordion-content {
    padding: 0 1rem; /* Adjust content padding */
  }

  .accordion-header.active + .accordion-content {
    padding: 0.8rem 1rem; /* Adjust content padding when open */
  }
  
  .accordion-content p {
      font-size: 0.9rem; /* Slightly smaller text */
  }
}