html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

/* Template Renderer Styles */
.template-container {
  width: 100%;
}

.zone {
  margin-bottom: 2rem;
  padding: 1rem;
}

.zone-header {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.zone-maincontent {
  min-height: 400px;
}

.zone-sidebar {
  background-color: #f8f9fa;
  padding: 1.5rem;
}

.zone-footer {
  background-color: #343a40;
  color: white;
  padding: 2rem 1rem;
  margin-top: 3rem;
}

.widget {
  margin-bottom: 1rem;
}

.html-widget {
  line-height: 1.6;
}

.image-widget img {
  max-width: 100%;
  height: auto;
  border-radius: 0.25rem;
}

/* ========================================
   ModernWeb Template Animations
   ======================================== */

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes slideRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.95); }
}

.animate-fade-in { animation: fadeIn 0.8s ease-out forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-slide-right { animation: slideRight 0.6s ease-out forwards; }
.animate-scale-up { animation: scaleUp 0.5s ease-out forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(220, 38, 38, 0.2);
}

.gradient-bg {
    background: linear-gradient(135deg, #DC2626 0%, #EA580C 50%, #F59E0B 100%);
}

.gradient-text {
    background: linear-gradient(to right, #DC2626, #EA580C, #F59E0B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animation delays */
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-500 { animation-delay: 0.5s; }
.animation-delay-1000 { animation-delay: 1s; }
.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }

/* Custom scrollbar for ModernWeb */
.modernweb-scrollbar::-webkit-scrollbar { width: 10px; }
.modernweb-scrollbar::-webkit-scrollbar-track { background: #f1f5f9; }
.modernweb-scrollbar::-webkit-scrollbar-thumb { background: #DC2626; border-radius: 5px; }

/* ========================================
   Shape Widget Styles
   ======================================== */

/* Additional animations for Shape widget */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-25%); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ping {
    75%, 100% { transform: scale(2); opacity: 0; }
}

.animate-bounce { animation: bounce 1s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

/* Animation duration modifiers */
.animation-duration-slow { animation-duration: 4s; }
.animation-duration-fast { animation-duration: 2s; }

/* Additional animation delays */
.animation-delay-3000 { animation-delay: 3s; }

/* Shape widget base */
.shape-widget {
    pointer-events: none;
}

/* ========================================
   Animated Text Widget Styles
   ======================================== */

/* Base animated text styles */
.animated-text-widget {
    overflow: hidden;
}

.animated-text-content {
    display: inline-block;
}

/* Fade animations - animate immediately */
.anim-fade-up {
    animation: animFadeUp 0.8s ease-out both;
}

.anim-fade-down {
    animation: animFadeDown 0.8s ease-out both;
}

.anim-fade-left {
    animation: animFadeLeft 0.8s ease-out both;
}

.anim-fade-right {
    animation: animFadeRight 0.8s ease-out both;
}

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

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

@keyframes animFadeLeft {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes animFadeRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Typewriter animation */
.anim-typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid currentColor;
    width: 0;
    animation: animTypewriter 3s steps(40) forwards, animBlink 0.75s step-end infinite;
}

@keyframes animTypewriter {
    to { width: 100%; }
}

@keyframes animBlink {
    50% { border-color: transparent; }
}

/* Word by word animation */
.anim-word {
    display: inline-block;
    opacity: 0;
    animation: animWordReveal 0.5s ease-out forwards;
    /* animation-delay is set inline per word */
}

@keyframes animWordReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Letter by letter animation */
.anim-letter {
    display: inline-block;
    opacity: 0;
    animation: animLetterReveal 0.3s ease-out forwards;
    /* animation-delay is set inline per letter */
}

@keyframes animLetterReveal {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight animation */
.highlight-text {
    background: linear-gradient(to bottom, transparent 50%, var(--highlight-color, #FEF08A) 50%);
    background-size: 100% 200%;
    background-position: top;
    animation: animHighlight 0.8s ease-out forwards;
}

@keyframes animHighlight {
    to { background-position: bottom; }
}

/* Underline animation */
.underline-text {
    position: relative;
    display: inline-block;
}

.underline-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--underline-color, #6366f1);
    animation: animUnderline 0.8s ease-out forwards;
}

@keyframes animUnderline {
    to { width: 100%; }
}

/* Gradient flow animation */
.gradient-flow-text {
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #d946ef, #6366f1);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: animGradientFlow 3s ease infinite;
}

@keyframes animGradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animation speed modifiers */
.anim-slow { animation-duration: 1.5s !important; }
.anim-fast { animation-duration: 0.4s !important; }

/* Gradient preview animation for editor */
.animate-gradient {
    animation: animGradientFlow 3s ease infinite;
}

/* ========================================
   Particles Widget Styles
   ======================================== */

.particles-widget {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.particles-widget.particles-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particles-content {
    position: relative;
    z-index: 10;
    min-height: 100%;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background-color: var(--particle-color, #6366f1);
    color: var(--particle-color, #6366f1);
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

/* Particle type variations */
.particle-dot {
    border-radius: 50%;
}

.particle-star {
    background: transparent !important;
    border-radius: 0;
}

.particle-bubble {
    border-radius: 50%;
    background: transparent !important;
    border: 1px solid var(--particle-color, #6366f1);
}

.particle-snow {
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.particle-confetti {
    border-radius: 2px !important;
    width: auto !important;
    aspect-ratio: 2/1;
}

.particle-firefly {
    border-radius: 50%;
    animation-name: particleFirefly !important;
}

/* Particle float animations */
@keyframes particleFloatUp {
    0% {
        transform: translateY(100%) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: var(--particle-opacity, 0.8);
    }
    90% {
        opacity: var(--particle-opacity, 0.8);
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

@keyframes particleFloatDown {
    0% {
        transform: translateY(-100%) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: var(--particle-opacity, 0.8);
    }
    90% {
        opacity: var(--particle-opacity, 0.8);
    }
    100% {
        transform: translateY(100vh) translateX(-20px);
        opacity: 0;
    }
}

@keyframes particleFloatLeft {
    0% {
        transform: translateX(100%) translateY(0);
        opacity: 0;
    }
    10% {
        opacity: var(--particle-opacity, 0.8);
    }
    90% {
        opacity: var(--particle-opacity, 0.8);
    }
    100% {
        transform: translateX(-100vw) translateY(20px);
        opacity: 0;
    }
}

@keyframes particleFloatRight {
    0% {
        transform: translateX(-100%) translateY(0);
        opacity: 0;
    }
    10% {
        opacity: var(--particle-opacity, 0.8);
    }
    90% {
        opacity: var(--particle-opacity, 0.8);
    }
    100% {
        transform: translateX(100vw) translateY(-20px);
        opacity: 0;
    }
}

@keyframes particleFirefly {
    0%, 100% {
        opacity: 0.2;
        transform: translateY(0) translateX(0);
    }
    25% {
        opacity: 1;
        transform: translateY(-20px) translateX(10px);
    }
    50% {
        opacity: 0.4;
        transform: translateY(-40px) translateX(-5px);
    }
    75% {
        opacity: 0.9;
        transform: translateY(-60px) translateX(15px);
    }
}
