/* ========================================
   LEGALIAPRO - ADVANCED INTERACTIONS CSS
   ======================================== */

/* ========================================
   1. BUTTON RIPPLE EFFECT
   ======================================== */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: ripple-anim 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-anim {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ========================================
   2. TESTIMONIAL CAROUSEL
   ======================================== */
.testimonial-carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.testimonial-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-track .testimonial-card {
    min-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
}

.carousel-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-white);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    transition: all 0.2s ease;
}

.carousel-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: scale(1.08);
}

.carousel-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--color-border);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.carousel-dot.active-dot {
    background: var(--color-primary);
    width: 28px;
    border-radius: 5px;
}

.carousel-dot:hover:not(.active-dot) {
    background: var(--color-primary-light);
    opacity: 0.5;
}

/* ========================================
   3. READING PROGRESS BAR
   ======================================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
    z-index: 9999;
    width: 0;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ========================================
   4. HERO CURSOR GLOW
   ======================================== */
.hero-cursor-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 168, 83, 0.12) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

/* ========================================
   5. FAQ ACCORDION
   ======================================== */
.faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(var(--color-primary-rgb), 0.2);
}

.faq-item.faq-open {
    border-color: rgba(var(--color-primary-rgb), 0.3);
    box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.08);
}

.faq-question {
    padding: 18px 20px;
    font-weight: 600;
    font-size: 15px;
    color: var(--color-heading);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}

.faq-question::after {
    content: '+';
    font-size: 20px;
    font-weight: 300;
    color: var(--color-text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-open .faq-question::after {
    transform: rotate(45deg);
    color: var(--color-primary);
}

.faq-answer {
    padding: 0 20px 18px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-light);
}

/* Toast notifications: uses inline styles from main.js showToast() */

/* ========================================
   7. CARD SHINE EFFECT
   ======================================== */
.servicio-card,
.calc-card,
.caso-mini {
    position: relative;
    overflow: hidden;
}

.servicio-card::after,
.calc-card::after,
.caso-mini::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at var(--shine-x, 50%) var(--shine-y, 50%),
        rgba(255, 255, 255, 0.08) 0%,
        transparent 60%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.servicio-card:hover::after,
.calc-card:hover::after,
.caso-mini:hover::after {
    opacity: 1;
}

/* ========================================
   8. DARK MODE
   ======================================== */
.dark-mode-toggle {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-white);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    line-height: 1;
}

.dark-mode-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Dark mode variables */
.dark-mode {
    --color-bg: #0f172a;
    --color-white: #1e293b;
    --color-light: #0f172a;
    --color-text: #cbd5e1;
    --color-text-light: #94a3b8;
    --color-text-muted: #64748b;
    --color-heading: #f1f5f9;
    --color-dark: #f8fafc;
    --color-border: #334155;
    color-scheme: dark;
}

.dark-mode body {
    background: #0f172a;
    color: #cbd5e1;
}

.dark-mode .header {
    background: rgba(15, 23, 42, 0.9);
    border-bottom-color: #334155;
}

.dark-mode .footer {
    background: #0c1322;
}

.dark-mode .hero-page {
    background: linear-gradient(135deg, #0a1628, #1e3a6e);
}

.dark-mode .testimonial-card,
.dark-mode .servicio-card,
.dark-mode .calc-card,
.dark-mode .caso-mini,
.dark-mode .article-card,
.dark-mode .blog-featured-card,
.dark-mode .contacto-form-container,
.dark-mode .calc-form-container,
.dark-mode .calc-resultados {
    background: #1e293b;
    border-color: #334155;
}

.dark-mode input,
.dark-mode select,
.dark-mode textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.dark-mode .nav-menu > li > a {
    color: #cbd5e1;
}

.dark-mode .stats-bar {
    background: #1e293b;
}

.dark-mode .blog-article-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.dark-mode .blog-index-item a:hover,
.dark-mode .blog-index-item a.active-index {
    background: rgba(255, 255, 255, 0.06);
}

.dark-mode .breadcrumb-nav {
    background: #1e293b;
    border-bottom-color: #334155;
}

.dark-mode .mobile-bottom-nav {
    background: #1e293b;
    border-top-color: #334155;
}

.dark-mode .dark-mode-toggle {
    background: #334155;
    border-color: #475569;
    color: #f59e0b;
}

.dark-mode .blog-lead-box,
.dark-mode .cta-final {
    background: linear-gradient(135deg, #1e3a6e, #0f172a);
}

/* Scroll progress bar: defined in style.css */

/* ========================================
   10. ENHANCED FORM FOCUS
   ======================================== */
.form-group {
    position: relative;
}

.input-focused label {
    color: var(--color-primary);
}

.input-focused input,
.input-focused select,
.input-focused textarea {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.08);
}

/* ========================================
   11. HOVER LINK UNDERLINE ANIMATION
   ======================================== */
.footer-col a,
.nav-menu > li > a {
    position: relative;
}

.footer-col a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1.5px;
    background: currentColor;
    transition: width 0.3s ease;
}

.footer-col a:hover::after {
    width: 100%;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .dark-mode-toggle {
        bottom: 80px;
        left: 16px;
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .carousel-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

}
