@import "tailwindcss";

@variant dark (&:where(.dark, .dark *));

/* Theme Variables */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-header: rgba(30, 41, 59, 0.5);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(71, 85, 105, 0.5);
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
}

.light {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.9);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: rgba(148, 163, 184, 0.3);
  --accent: #0284c7;
  --accent-hover: #0369a1;
}

/* Light theme overrides for CMS content */
.light .cms-richtext h1 {
  color: #0f172a;
}

.light .cms-richtext h1::first-line {
  color: #0f172a;
  -webkit-text-fill-color: #0f172a;
}

.light .cms-richtext h2 {
  color: #0f172a;
}

.light .cms-richtext p {
  color: #475569;
}

.light .cms-richtext ol {
  color: #334155;
}

.light .cms-richtext ol li {
  background: rgba(241, 245, 249, 0.8);
  border-color: rgba(148, 163, 184, 0.3);
}

.light .cms-richtext ol li:hover {
  border-color: rgba(2, 132, 199, 0.4);
}

.light .cms-richtext ul {
  color: #334155;
}

.light .cms-richtext a {
  color: #0284c7;
}

.light .cms-btn-secondary {
  border-color: #cbd5e1;
  color: #334155 !important;
}

.light .cms-btn-secondary:hover {
  border-color: #0284c7;
  background: rgba(241, 245, 249, 0.8);
  color: #0f172a !important;
}

/* Jodit editor dark theme overrides */
.jodit-container {
  border-color: rgba(148, 163, 184, 0.45) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.jodit-toolbar__box {
  background: rgba(15, 23, 42, 0.8) !important;
  border-bottom-color: rgba(148, 163, 184, 0.45) !important;
}

.jodit-workplace {
  background: rgba(15, 23, 42, 0.6) !important;
}

.jodit-wysiwyg {
  color: #e2e8f0 !important;
  background: transparent !important;
}

.jodit-status-bar {
  background: rgba(15, 23, 42, 0.8) !important;
  border-top-color: rgba(148, 163, 184, 0.45) !important;
  color: #94a3b8 !important;
}

.jodit-toolbar-button__button {
  color: #e2e8f0 !important;
}

.jodit-toolbar-button__button:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #38bdf8 !important;
}

.jodit-toolbar-button__button svg {
  fill: currentColor !important;
  stroke: currentColor !important;
}

.jodit-ui-separator {
  border-color: rgba(148, 163, 184, 0.3) !important;
}

.jodit-popup {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.45) !important;
}

.jodit-popup__content {
  background: #0f172a !important;
}

.jodit-ui-input__input,
.jodit-ui-input__wrapper {
  background: rgba(15, 23, 42, 0.8) !important;
  border-color: rgba(148, 163, 184, 0.45) !important;
  color: #e2e8f0 !important;
}

/* Jodit editor heading styles */
.jodit-wysiwyg h1 {
  font-size: 2em !important;
  font-weight: 700 !important;
  margin: 0.67em 0 !important;
}

.jodit-wysiwyg h2 {
  font-size: 1.5em !important;
  font-weight: 600 !important;
  margin: 0.83em 0 !important;
}

.jodit-wysiwyg h3 {
  font-size: 1.17em !important;
  font-weight: 600 !important;
  margin: 1em 0 !important;
}

.jodit-wysiwyg p {
  margin: 1em 0 !important;
}

/* Frontend rendering for Quill HTML (Tailwind preflight removes list markers by default) */
.faq-richtext ol {
  list-style: decimal !important;
  padding-left: 1.5rem;
}

.faq-richtext ul {
  list-style: disc !important;
  padding-left: 1.5rem;
}

.faq-richtext li {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

/* CMS Richtext - Enhanced Styling */
.cms-richtext {
  text-align: center;
}

.cms-richtext h1 {
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
  background: linear-gradient(to right, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
}

.cms-richtext h1::first-line {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

@media (min-width: 768px) {
  .cms-richtext h1 {
    font-size: 3rem;
    line-height: 3.5rem;
  }
}

.cms-richtext h2 {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  color: #ffffff;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.cms-richtext p {
  color: #94a3b8;
  line-height: 1.75;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
}

.cms-richtext ol {
  list-style: none !important;
  padding-left: 0;
  color: #cbd5e1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
  text-align: left;
}

@media (min-width: 640px) {
  .cms-richtext ol {
    grid-template-columns: 1fr 1fr;
  }
}

.cms-richtext ol li {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(71, 85, 105, 0.3);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.2s ease;
  counter-increment: cms-step;
}

.cms-richtext ol li:hover {
  border-color: rgba(56, 189, 248, 0.3);
}

.cms-richtext ol li::before {
  content: counter(cms-step);
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.cms-richtext ul {
  list-style: none !important;
  padding-left: 0;
  color: #cbd5e1;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.cms-richtext ul li {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.cms-richtext ul li::before {
  content: '•';
  margin-right: 0.5rem;
  color: #64748b;
}

.cms-richtext a {
  color: #38bdf8;
  text-decoration: none;
}

.cms-richtext a:hover {
  text-decoration: underline;
}

/* FAQ Block Shortcode Styles - matches FaqSection component */
.faq-block {
  margin: 2rem 0;
  text-align: left;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.faq-block .space-y-3 > * + * {
  margin-top: 0.75rem;
}

.faq-item {
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.5);
  transition: colors 0.2s ease;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.2s ease;
}

.faq-question:hover {
  background: rgba(51, 65, 85, 0.3);
}

.faq-question-text {
  flex: 1;
  padding-right: 1rem;
  font-weight: 500;
  color: #ffffff;
}

.faq-icon {
  flex-shrink: 0;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.faq-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.faq-item[data-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.faq-item[data-expanded="true"] .faq-answer {
  max-height: 800px;
}

.faq-answer-content {
  padding: 0 1rem 1rem;
  line-height: 1.625;
  color: #cbd5e1;
}

.faq-answer-content p {
  margin: 0.75rem 0;
}

.faq-answer-content ul,
.faq-answer-content ol {
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}

.faq-answer-content li {
  margin: 0.25rem 0;
}

.faq-answer-content a {
  color: #38bdf8;
}

.faq-answer-content strong {
  color: #ffffff;
}

/* Light theme FAQ styles */
.light .faq-item {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.light .faq-question:hover {
  background: #f8fafc;
}

.light .faq-question-text {
  color: #0f172a;
}

.light .faq-icon {
  color: #64748b;
}

.light .faq-answer-content {
  color: #334155;
}

.light .faq-answer-content a {
  color: #0284c7;
}

.light .faq-answer-content strong {
  color: #0f172a;
}

.cms-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  justify-content: center;
}

.cms-btn-primary,
.cms-btn-secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 200ms ease !important;
  box-sizing: border-box !important;
  height: auto !important;
  line-height: 1.5 !important;
}

.cms-btn-primary {
  border: 1px solid transparent !important;
  background: linear-gradient(to right, #0284c7, #6366f1) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 15px -3px rgba(56, 189, 248, 0.25) !important;
}

.cms-btn-primary:hover {
  background: linear-gradient(to right, #0ea5e9, #818cf8) !important;
  text-decoration: none !important;
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(56, 189, 248, 0.4) !important;
}

.cms-btn-secondary {
  border: 1px solid #475569 !important;
  background: transparent !important;
  color: #e2e8f0 !important;
}

.cms-btn-secondary:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(30, 41, 59, 0.5);
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Cookie banner animation */
@keyframes slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-slide-up {
  animation: slide-up 0.3s ease-out forwards;
}
