@keyframes float {
  0% { transform: translatey(0px) rotate(0deg); }
  50% { transform: translatey(-25px) rotate(5deg); }
  100% { transform: translatey(0px) rotate(0deg); }
}
.animate-float { animation: float 8s ease-in-out infinite; }
.animate-float-fast { animation: float 5s ease-in-out infinite; }

@keyframes subtle-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}
.animate-subtle-pulse { animation: subtle-pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.animate-gradient-fast {
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
}

/* Helper for H1 gradient text */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(to right, var(--h1-grad-start), var(--h1-grad-mid), var(--h1-grad-end));
    background-size: 200% 200%;
}

/* --- More Energetic Confetti Animations --- */

/* Path 1: Explode Up-Right */
@keyframes confetti-1 {
  0% { transform: translate(0px, 0px) rotateZ(0deg) scale(1); opacity: 1; }
  100% { transform: translate(250px, -300px) rotateZ(540deg) scale(0.5); opacity: 0; }
}
/* Path 2: Explode Down-Left */
@keyframes confetti-2 {
  0% { transform: translate(0px, 0px) rotateZ(0deg) scale(1); opacity: 1; }
  100% { transform: translate(-200px, 350px) rotateZ(360deg) scale(0.7); opacity: 0; }
}
/* Path 3: Explode Up-Left */
@keyframes confetti-3 {
  0% { transform: translate(0px, 0px) rotateY(0deg) scale(1); opacity: 1; }
  100% { transform: translate(-220px, -280px) rotateY(720deg) scale(0.6); opacity: 0; }
}
/* Path 4: Explode Down-Right */
@keyframes confetti-4 {
  0% { transform: translate(0px, 0px) rotateY(0deg) scale(1); opacity: 1; }
  100% { transform: translate(210px, 320px) rotateY(600deg) scale(0.8); opacity: 0; }
}

/* Base style for confetti pieces */
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  opacity: 0; /* Start hidden */
}

/* Classes applying the animations + common properties */
.animate-confetti-1, .animate-confetti-2, .animate-confetti-3, .animate-confetti-4 {
   animation-duration: 1.8s; /* Base duration slightly faster */
   animation-timing-function: cubic-bezier(0.1, 0.8, 0.2, 1); /* Fast start, slow end */
   animation-delay: 1s; /* Base delay */
   animation-fill-mode: forwards;
}
.animate-confetti-1 { animation-name: confetti-1; }
.animate-confetti-2 { animation-name: confetti-2; }
.animate-confetti-3 { animation-name: confetti-3; animation-duration: 1.9s; } /* Slightly vary base */
.animate-confetti-4 { animation-name: confetti-4; animation-duration: 1.7s; } /* Slightly vary base */

/* --- Theme Color & Style Definitions --- */
/* The single source of truth for theme variables. */

:root {
    /* Default to light theme variables */
    --bg-color: #ffffff;
    --header-bg-color: rgba(255, 255, 255, 0.85); /* Light background with transparency for blur effect */
    --text-color: #111827; /* dark-gray-900 */
    --subtle-text-color: #6b7280; /* gray-500 */
    --h1-grad-start: #a855f7; /* purple-500 */
    --h1-grad-mid: #ec4899; /* pink-500 */
    --h1-grad-end: #22d3ee; /* cyan-400 */
    --float-1-bg: linear-gradient(to bottom right, #c084fc, #6366f1);
    --float-2-bg: #67e8f9;
    --float-3-bg: #f9a8d4;
    --float-4-bg: linear-gradient(to top left, #5eead4, #22d3ee);
    --float-5-bg: #a5b4fc;
    --float-6-bg: #d8b4fe;
    --float-7-bg: #fbcfe8;
    --float-8-bg: #99f6e4;
    --float-opacity: 0.7;
    --bg-color-2: #f9fafb; /* gray-50 */
    --border-color: #e5e7eb; /* gray-200 */
    --hover-bg-color: #f3f4f6; /* gray-100 */
    --placeholder-color: #9ca3af; /* gray-400 */
}

html.dark {
    --bg-color: #0d1117; /* Custom dark */
    --header-bg-color: rgba(17, 24, 39, 0.85); /* Dark background (gray-900) with transparency */
    --text-color: #f9fafb; /* gray-50 */
    --subtle-text-color: #8b949e; /* gray-400 */
    --h1-grad-start: #c084fc; /* purple-400 */
    --h1-grad-mid: #f472b6; /* pink-400 */
    --h1-grad-end: #67e8f9; /* cyan-300 */
    --float-1-bg: linear-gradient(to bottom right, #a78bfa, #818cf8);
    --float-2-bg: #5eead4;
    --float-3-bg: #fb7185;
    --float-4-bg: linear-gradient(to top left, #67e8f9, #a5f3fc);
    --float-5-bg: #c4b5fd;
    --float-6-bg: #e9d5ff;
    --float-7-bg: #fda4af;
    --float-8-bg: #a7f3d0;
    --float-opacity: 0.5;
    --bg-color-2: #161b22; /* Custom slightly lighter dark */
    --border-color: #30363d; /* Custom dark border */
    --hover-bg-color: #1f242c; /* Custom dark hover */
    --placeholder-color: #6b7280; /* gray-500 */
}

html.tiffany {
    --bg-color: #e0fbfb;
    --header-bg-color: rgba(224, 251, 251, 0.85); /* Tiffany background with transparency */
    --text-color: #0d1f23;
    --subtle-text-color: #5a7f78;
    --h1-grad-start: #0ABAB5;
    --h1-grad-mid: #0ABAB5;
    --h1-grad-end: #0ABAB5;
    --float-1-bg: #0ABAB5;
    --float-2-bg: #96D9D7;
    --float-3-bg: #0ABAB5;
    --float-4-bg: #96D9D7;
    --float-5-bg: #0ABAB5;
    --float-6-bg: #96D9D7;
    --float-7-bg: #0ABAB5;
    --float-8-bg: #96D9D7;
    --float-opacity: 0.8;
}

/* Base body and typography styles */
html, body {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* 
  NEW: Dedicated class on the body to enable theme transitions.
  JS will toggle this class. The transition is now applied directly to the body
  and any other top-level elements that need it.
*/
body.theme-transitions-enabled {
    transition: background-color 0.5s ease, color 0.5s ease;
}
body.theme-transitions-enabled .floating-element {
    transition: background 1s ease-in-out, opacity 1s ease-in-out;
}
body.theme-transitions-enabled .bg-header-themed,
body.theme-transitions-enabled main p,
body.theme-transitions-enabled footer p {
    transition: all 0.5s ease;
}

/* NEW: Class for themed header background */
.bg-header-themed {
    background-color: var(--header-bg-color);
}

/* Apply variables to specific elements */
main p, footer p {
    color: var(--subtle-text-color);
}

.floating-element {
    opacity: var(--float-opacity);
}
.float-1 { background: var(--float-1-bg); }
.float-2 { background: var(--float-2-bg); }
.float-3 { background: var(--float-3-bg); }
.float-4 { background: var(--float-4-bg); }
.float-5 { background: var(--float-5-bg); }
.float-6 { background: var(--float-6-bg); }
.float-7 { background: var(--float-7-bg); }
.float-8 { background: var(--float-8-bg); }

/* Styles for placeholder text in editable slots */
.content-slot p.is-placeholder {
    font-style: italic !important;
    color: var(--subtle-text-color) !important; /* Use existing subtle text color variable */
}

/* --- Form Control Gradients & Styles --- */

.form-control-gradient-bg {
    background-image: linear-gradient(45deg, var(--h1-grad-start), var(--h1-grad-mid));
    border-color: transparent;
}

/* --- Dev Mode --- */
/* Cyberpunk Dev Button */
@keyframes cyberpunk-gradient-button {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.dev-button {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.5), 0 0 20px rgba(59, 130, 246, 0.4);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  background: linear-gradient(45deg, #ec4899, #ef4444, #3b82f6, #6366f1);
  background-size: 300% 300%;
  animation: cyberpunk-gradient-button 5s ease infinite;
}

.dev-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.8), 0 0 30px rgba(59, 130, 246, 0.6);
}

.dev-button.active {
  border-color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.dev-highlight {
  outline: 2px dashed red !important; /* Use important to increase specificity */
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.3); /* Optional glow */
}

/* --- Dev Mode Guide Lines (Animated Gradient) --- */
@keyframes guide-gradient-shift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.dev-guide-line {
  position: fixed; /* Use fixed to position relative to viewport */
  background: linear-gradient(90deg, #ec4899, #3b82f6, #ec4899); /* Pink to Blue gradient */
  background-size: 200% 1px; /* Width for horizontal, Height for vertical */
  z-index: 9990; /* Below highlight, above most content */
  pointer-events: none; /* Make them non-interactive */
  animation: guide-gradient-shift 1s linear infinite;
}
/* Adjust background size for vertical lines */
.dev-guide-line.vertical {
    background-size: 1px 200%;
    animation: guide-gradient-shift 1s linear infinite; /* Same animation, direction doesn't matter for BG position */
}

/* --- Dev Mode Activation/Deactivation Animation --- */
@keyframes dev-activate-pulse {
  0% {
    transform: scale(0);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.5);
    opacity: 0.6;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* NEW: Reverse animation for deactivation */
@keyframes dev-deactivate-implode {
  0% {
    transform: scale(2.5);
    opacity: 0;
  }
  30% {
    transform: scale(1.5);
    opacity: 0.75; /* Adjusted opacity */
  }
  100% {
    transform: scale(0);
    opacity: 0.95;

  }
}

body.dev-mode-activating::before, 
body.dev-mode-deactivating::before { /* Apply base styles to both */
    content: '';
    position: fixed;
    right: 0;
    bottom: 0;
    width: 100vmax;
    height: 100vmax;
    transform-origin: 100% 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 100% 100%, 
        rgba(236, 72, 153, 0.85) 0%, /* Fluorescent Pink */
        rgba(59, 130, 246, 0.75) 30%, /* Electric Blue */
        rgba(59, 130, 246, 0) 70%
    );
    z-index: 10000;
    pointer-events: none;
    filter: blur(20px); /* ADD BLUR to the pulse/implode animation */
}

body.dev-mode-activating::before {
    animation: dev-activate-pulse 0.7s ease-out forwards;
}

/* NEW: Apply reverse animation */
body.dev-mode-deactivating::before {
    animation: dev-deactivate-implode 0.5s ease-in forwards; /* Slightly faster */
}

/* --- Dev Mode Glow Border using separate Div (Subtle Version + White Edge) --- */
@keyframes dev-border-subtle-glow {
  0%, 100% {
    /* Add a subtle white inner edge similar to the active button */
    box-shadow: inset 0 0 3px 1px rgba(255, 255, 255, 0.6), /* White inner edge */
                inset 0 0 8px 2px rgba(236, 72, 153, 0.5), /* Pinkish */
                inset 0 0 15px 4px rgba(59, 130, 246, 0.4);  /* Bluish */
  }
  50% {
    /* Pulse the white edge slightly too */
     box-shadow: inset 0 0 4px 1px rgba(255, 255, 255, 0.8),
                inset 0 0 10px 3px rgba(236, 72, 153, 0.7),
                inset 0 0 18px 5px rgba(59, 130, 246, 0.6);
  }
}

/* Container for the border */
.dev-mode-border-container {
    position: fixed;
    inset: 0;
    z-index: 9980; /* Below guides and button */
    pointer-events: none;
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    /* Apply animation directly here */
    animation: dev-border-subtle-glow 3s ease-in-out infinite;
}

/* Show the container when dev mode is on */
body.dev-mode-on .dev-mode-border-container {
    opacity: 1;
}

/* Remove animation from body */
body.dev-mode-on {
    /* No border animation directly on body */
}

/* Ensure body has position relative if needed for absolute children, likely not needed here */
/* body { position: relative; } */

/* --- Dev Mode Tag Display --- */
.dev-tag-display {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background-color: rgba(255, 0, 0, 0.7); /* Match highlight border */
  color: white;
  padding: 0.25rem 0.6rem;
  font-family: monospace;
  font-size: 0.8rem;
  border-radius: 4px;
  z-index: 9999; /* Above border, same as button */
  pointer-events: none; /* Non-interactive */
  opacity: 0; /* Hidden by default */
  transition: opacity 0.3s ease;
}

body.dev-mode-on .dev-tag-display.visible {
  opacity: 1; /* Show when mode is on and element selected */
}

/* --- Dev Mode Margin Visualization (JS Controlled - Vertical Text Version) --- */

/* Keyframes for entry/exit animations */
@keyframes dev-margin-enter-left {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0%); opacity: 1; }
}
@keyframes dev-margin-enter-right {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0%); opacity: 1; }
}
@keyframes dev-margin-exit-left {
  from { transform: translateX(0%); opacity: 1; }
  to   { transform: translateX(-100%); opacity: 0; }
}
@keyframes dev-margin-exit-right {
  from { transform: translateX(0%); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

.dev-margin-visualizer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 0; /* Controlled by JS */
  background-color: rgba(128, 0, 128, 0.15); /* Semi-transparent purple */
  border: 1px dashed rgba(128, 0, 128, 0.5); /* Dashed border */
  z-index: 9970; /* z-index below guides/button */
  pointer-events: none; /* Non-interactive */
  opacity: 0; /* Hidden by default, final state set by JS */
  /* Use flexbox for vertical text centering */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 11px;
  color: rgba(128, 0, 128, 0.9);
  white-space: nowrap; /* Prevent wrapping */
  text-orientation: mixed;
}

.dev-margin-visualizer.left {
  left: 0;
  border-left: none;
  border-right: 1px dashed rgba(128, 0, 128, 0.5);
  /* Vertical text */
  writing-mode: vertical-rl;
}

.dev-margin-visualizer.right {
  right: 0;
  border-right: none;
  border-left: 1px dashed rgba(128, 0, 128, 0.5);
  /* Vertical text */
  writing-mode: vertical-lr;
}

/* Class to trigger entering animation */
.dev-margin-visualizer-entering.left {
  animation: dev-margin-enter-left 0.4s ease-out forwards;
}

.dev-margin-visualizer-entering.right {
  animation: dev-margin-enter-right 0.4s ease-out forwards;
}

/* Class to trigger exiting animation */
.dev-margin-visualizer-exiting.left {
  animation: dev-margin-exit-left 0.4s ease-in forwards;
}

.dev-margin-visualizer-exiting.right {
  animation: dev-margin-exit-right 0.4s ease-in forwards;
}

/* Styles for placeholder text in editable slots */
.content-slot p.is-placeholder {
    font-style: italic !important;
    color: var(--subtle-text-color) !important; /* Use existing subtle text color variable */
    /* You can add other styles here if needed, e.g., smaller font or different weight */
    /* @apply text-lg font-normal; */
}

/* NEW: Global control for navbar text visibility */
body.navbar-text-hidden .navbar-item-text {
    display: none;
}

/* Base styles for floating elements */
.floating-element {
    opacity: var(--float-opacity);
}
.float-1 { background: var(--float-1-bg); }
.float-2 { background: var(--float-2-bg); }
.float-3 { background: var(--float-3-bg); }
.float-4 { background: var(--float-4-bg); }
.float-5 { background: var(--float-5-bg); }
.float-6 { background: var(--float-6-bg); }
.float-7 { background: var(--float-7-bg); }
.float-8 { background: var(--float-8-bg); }

/* Styles for placeholder text in editable slots */
.content-slot p.is-placeholder {
    font-style: italic !important;
    color: var(--subtle-text-color) !important; /* Use existing subtle text color variable */
}

/* --- Overrides for intl-tel-input to make it theme-aware --- */

/* Color of the selected dial code in the input field */
.iti__selected-dial-code {
    /* DEFINITIVE FIX: Use the placeholder color variable for perfect consistency. */
    color: var(--placeholder-color) !important;
}

/* Dropdown container */
.iti__country-list {
    background-color: var(--bg-color) !important; /* DEFINITIVE FIX: Use the main background color variable which is defined. */
    border: 1px solid var(--border-color) !important; /* Use standard border color */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); /* Standard shadow-lg */
    border-radius: 1rem !important; /* iOS style rounding (equivalent to rounded-xl) */
    overflow: hidden; /* Ensures content respects the new border radius */
}

/* Individual country item in the dropdown */
.iti__country, .iti__country-name, .iti__dial-code {
    color: var(--text-color) !important; /* Use standard text color for readability on ALL text */
}

/* Hover/highlight state for country items */
.iti__country:hover, .iti__country.iti__highlight {
    background-color: var(--hover-bg-color) !important; /* Use a standard hover background color */
}

/* Fallback for general text color within the component */
.iti--container {
    color: var(--text-color) !important;
}

/* Theme transition */
html.theme-transition {
  transition: background-color 0.4s ease, color 0.4s ease;
} 