/* ============================================
   ROCKO CRUZ - MEDICINA ANCESTRAL
   Tailwind CSS + Custom Styles
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Raleway:wght@300;400&family=Dancing+Script:wght@400&display=swap");

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    html {
        scroll-behavior: smooth;
    }

    body {
        font-family: Raleway, sans-serif;
        font-weight: 400;
        color: #293c0a;
        background-color: #ffffff;
        line-height: 1.8;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Tipografía */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        font-family: Playfair Display, serif;
        color: #293c0a;
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 3.5rem;
        font-weight: 700;
        letter-spacing: -0.02em;
    }

    h2 {
        font-size: 2.5rem;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

    h3 {
        font-size: 1.75rem;
        font-weight: 400;
    }

    h4 {
        font-size: 1.25rem;
        font-weight: 400;
    }

    h5 {
        font-family: Raleway, sans-serif;
        font-size: 1.125rem;
        font-weight: 400;
    }

    h6 {
        font-family: Raleway, sans-serif;
        font-size: 1rem;
        font-weight: 400;
    }

    p {
        margin-bottom: 1rem;
    }
}

@layer components {
    /* Navegación */
    .logo {
        font-family: Dancing Script, cursive;
        font-size: 1.5rem;
        font-weight: 400;
        color: #daa520;
        letter-spacing: 0.02em;
    }

    .nav-link {
        font-family: Raleway, sans-serif;
        font-weight: 400;
        font-size: 1rem;
        color: #293c0a;
        text-decoration: none;
        padding: 0.5rem 0;
        position: relative;
        transition: color 0.2s ease;
    }

    .nav-link::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        height: 2px;
        background-color: #daa520;
        width: 0;
        transition: width 0.3s ease;
    }

    .nav-link:hover,
    .nav-link.active {
        color: #daa520 !important;
    }

    .nav-link:hover::after,
    .nav-link.active::after {
        width: 100%;
    }

    /* Navegación transparente sobre video */
    .nav-link-transparent {
        font-family: Raleway, sans-serif;
        font-weight: 700;
        font-size: 1rem;
        color: #ffffff;
        text-decoration: none;
        padding: 0.5rem 0.25rem;
        position: relative;
        transition: color 0.3s ease;
    }

    .nav-link-transparent::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 2px;
        background-color: #daa520;
        width: 0;
        transition: width 0.3s ease;
        margin: 0 auto;
    }

    .nav-link-transparent:hover,
    .nav-link-transparent.active {
        color: #daa520 !important;
    }

    .nav-link-transparent:hover::after,
    .nav-link-transparent.active::after {
        width: 100%;
    }

    /* Navegación con fondo al hacer scroll */
    nav.nav-scrolled {
        background-color: #fff5e1;
        opacity: 0.95;
        box-shadow: 0 2px 4px rgba(41, 60, 10, 0.08),
            0 4px 8px rgba(41, 60, 10, 0.06);
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
    }

    /* Texto especial */
    .lead {
        font-size: 1.25rem;
        font-weight: 400;
        color: #4b5563;
        line-height: 1.8;
    }

    .accent-text {
        font-family: Dancing Script, cursive;
        font-weight: 400;
        font-size: 1.2em;
        line-height: 1.5;
    }

    /* Título decorado con líneas */
    .section-title {
        display: inline-flex;
        align-items: center;
        gap: 1rem;
        position: relative;
    }

    .section-title::before,
    .section-title::after {
        content: "";
        flex: 0 0 40px;
        height: 1px;
        background: linear-gradient(90deg, transparent, #daa520, transparent);
        position: relative;
    }

    .section-title::before {
        background: linear-gradient(90deg, transparent, #daa520);
    }

    .section-title::after {
        background: linear-gradient(90deg, #daa520, transparent);
    }

    /* Puntos decorativos en las líneas */
    .section-title-dot::before,
    .section-title-dot::after {
        content: "";
        position: absolute;
        width: 6px;
        height: 6px;
        background-color: #daa520;
        border-radius: 50%;
        box-shadow: 0 0 8px rgba(218, 165, 32, 0.4);
    }

    .section-title-dot::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .section-title-dot::after {
        right: 50%;
        transform: translateX(50%);
    }

    /* Título con iconos decorativos (alternativa) */
    .section-title-icon {
        display: inline-flex;
        align-items: center;
        gap: 0.75rem;
    }

    .section-title-icon svg {
        width: 20px;
        height: 20px;
        opacity: 0.8;
        transition: opacity 0.3s ease;
    }

    .section-title-icon:hover svg {
        opacity: 1;
    }

    /* Botones */
    .btn {
        font-family: Raleway, sans-serif;
        font-weight: 400;
        font-size: 1rem;
        padding: 0.75rem 2rem;
        border-radius: 8px;
        cursor: pointer;
        text-decoration: none;
        display: inline-block;
        text-align: center;
        position: relative;
        transition: transform 0.3s ease, opacity 0.3s ease,
            background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
        border: none;
    }

    .btn-primary {
        background-image: linear-gradient(
            180deg,
            rgba(232, 184, 68, 1) 0%,
            rgba(218, 165, 32, 1) 60%,
            rgba(194, 149, 32, 1) 100%
        );
        color: #ffffff;
        box-shadow: 0 2px 4px rgba(41, 60, 10, 0.08),
            0 4px 8px rgba(41, 60, 10, 0.06),
            inset 0 1px 2px rgba(255, 255, 255, 0.5);
        overflow: hidden;
        isolation: isolate;
    }

    .btn-primary::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(0, 0, 0, 0.03) 100%
        );
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .btn-primary::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(41, 60, 10, 0.1),
            0 8px 16px rgba(41, 60, 10, 0.08);
        opacity: 0;
        z-index: -1;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .btn-primary:hover {
        transform: translateY(-3px);
    }

    .btn-primary:hover::before {
        opacity: 1;
    }

    .btn-primary:hover::after {
        opacity: 1;
    }

    .btn-primary:active {
        transform: translateY(-1px);
    }

    .btn-primary:focus-visible {
        outline: 3px solid #daa520;
        outline-offset: 3px;
    }

    .btn-secondary {
        background-image: linear-gradient(
            180deg,
            rgba(122, 155, 74, 1) 0%,
            rgba(106, 139, 58, 1) 60%,
            rgba(90, 122, 48, 1) 100%
        );
        color: #ffffff;
        box-shadow: 0 2px 4px rgba(41, 60, 10, 0.08),
            0 4px 8px rgba(41, 60, 10, 0.06),
            inset 0 1px 2px rgba(255, 255, 255, 0.5);
        overflow: hidden;
        isolation: isolate;
    }

    .btn-secondary::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(0, 0, 0, 0.03) 100%
        );
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .btn-secondary::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(41, 60, 10, 0.1),
            0 8px 16px rgba(41, 60, 10, 0.08);
        opacity: 0;
        z-index: -1;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .btn-secondary:hover {
        transform: translateY(-3px);
    }

    .btn-secondary:hover::before {
        opacity: 1;
    }

    .btn-secondary:hover::after {
        opacity: 1;
    }

    .btn-secondary:active {
        transform: translateY(-1px);
    }

    .btn-secondary:focus-visible {
        outline: 3px solid #6a8b3a;
        outline-offset: 3px;
    }

    .btn-outline {
        background-color: transparent !important;
        border: 2px solid #daa520 !important;
        color: #daa520 !important;
        box-shadow: 0 1px 2px rgba(41, 60, 10, 0.06),
            0 2px 4px rgba(41, 60, 10, 0.04);
        overflow: hidden;
        isolation: isolate;
        position: relative;
    }

    .btn-outline::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: linear-gradient(
            180deg,
            rgba(232, 184, 68, 1) 0%,
            rgba(218, 165, 32, 1) 60%,
            rgba(194, 149, 32, 1) 100%
        );
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        z-index: -1;
        border-radius: 6px;
    }

    .btn-outline:hover {
        color: #ffffff !important;
        transform: translateY(-2px);
        border-color: #daa520 !important;
    }

    .btn-outline:hover::before {
        opacity: 1;
    }

    .btn-outline:active {
        transform: translateY(-1px);
    }

    .btn-outline:focus-visible {
        outline: 3px solid #daa520;
        outline-offset: 3px;
    }

    .btn-text {
        background-color: transparent;
        color: #daa520;
        padding: 0.5rem 1rem;
        font-weight: 400;
    }

    .btn-text:hover {
        color: #6a8b3a;
        transform: translateX(4px);
    }

    .btn-text:focus-visible {
        outline: 2px solid #daa520;
        outline-offset: 2px;
        border-radius: 4px;
    }

    /* Tarjetas (Cards) */
    .card {
        background-color: #ffffff;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(41, 60, 10, 0.08),
            0 4px 8px rgba(41, 60, 10, 0.06), 0 1px 0 rgba(255, 255, 255, 0.4);
        position: relative;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.8),
            transparent
        );
        opacity: 0.5;
        z-index: 1;
    }

    .card::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 12px;
        box-shadow: 0 4px 8px rgba(41, 60, 10, 0.1),
            0 8px 16px rgba(41, 60, 10, 0.08), 0 2px 0 rgba(255, 255, 255, 0.3);
        opacity: 0;
        z-index: -1;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .card:hover {
        transform: translateY(-6px);
    }

    .card:hover::after {
        opacity: 1;
    }

    .card:focus-within {
        outline: 2px solid #daa520;
        outline-offset: 2px;
    }

    .card-highlight {
        border: 2px solid #daa520;
        box-shadow: 0 2px 4px rgba(41, 60, 10, 0.08),
            0 4px 8px rgba(41, 60, 10, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.5),
            0 0 20px rgba(218, 165, 32, 0.15);
    }

    /* Hero Section con Video */
    .hero-video {
        position: relative;
        overflow: hidden;
    }

    .hero-video video {
        object-fit: cover;
        min-width: 100%;
        min-height: 100%;
    }

    /* Animaciones para el Hero */
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

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

    .animate-fade-in {
        animation: fadeIn 1s ease-out forwards;
    }

    .animate-slide-up {
        animation: slideUp 1s ease-out forwards;
    }

    /* Hero Section tradicional (para otras páginas) */
    .hero {
        background-image: linear-gradient(
            135deg,
            rgba(255, 245, 225, 0.6) 0%,
            rgba(255, 245, 225, 0.3) 50%,
            rgba(255, 255, 255, 0.8) 100%
        );
        padding: 6rem 0;
        text-align: center;
        position: relative;
    }

    .hero::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 80%;
        height: 100%;
        background-image: radial-gradient(
            circle at center,
            rgba(218, 165, 32, 0.15) 0%,
            rgba(218, 165, 32, 0.05) 50%,
            transparent 100%
        );
        pointer-events: none;
        transform: translate(-50%, -50%);
    }

    .hero h1,
    .hero .lead {
        position: relative;
        z-index: 10;
    }

    .hero h1 {
        color: #daa520;
    }

    .hero .lead {
        color: #293c0a;
    }

    /* Inputs y Formularios */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        width: 100%;
        padding: 0.875rem 1rem;
        font-family: Raleway, sans-serif;
        font-weight: 400;
        font-size: 1rem;
        color: #293c0a;
        border: 1px solid #9ca3af;
        border-radius: 0.375rem;
        background: linear-gradient(180deg, #ffffff 0%, #fefefe 100%);
        box-shadow: inset 0 1px 3px rgba(41, 60, 10, 0.05),
            0 1px 0 rgba(255, 255, 255, 0.8);
        transition: all 0.2s ease;
    }

    input:focus,
    textarea:focus,
    select:focus {
        outline: none;
        border-color: #daa520;
        background-color: #ffffff;
        box-shadow: inset 0 1px 3px rgba(41, 60, 10, 0.05),
            0 0 0 3px rgba(218, 165, 32, 0.15), 0 1px 2px rgba(41, 60, 10, 0.06),
            0 2px 4px rgba(41, 60, 10, 0.04);
    }

    input:focus-visible,
    textarea:focus-visible,
    select:focus-visible {
        outline: 3px solid #daa520;
        outline-offset: 2px;
    }

    input::placeholder,
    textarea::placeholder {
        color: #9ca3af;
    }

    textarea {
        resize: vertical;
        min-height: 120px;
    }

    /* Estados de validación */
    input:invalid:not(:placeholder-shown),
    textarea:invalid:not(:placeholder-shown) {
        border-color: #dc2626;
    }

    input:valid:not(:placeholder-shown),
    textarea:valid:not(:placeholder-shown) {
        border-color: #6a8b3a;
    }

    /* Footer */
    footer {
        background-color: #293c0a;
        color: #fff5e1;
        padding: 2rem 0;
        text-align: center;
    }

    footer p {
        font-size: 0.875rem;
        margin: 0;
    }

    /* Empty State Component */
    .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 4rem 2rem;
        border: 2px dashed #daa520;
        border-radius: 12px;
        min-height: 400px;
        position: relative;
        overflow: hidden;
    }

    .empty-state-icon {
        width: 80px;
        height: 80px;
        background: linear-gradient(
            135deg,
            rgba(232, 184, 68, 0.2) 0%,
            rgba(218, 165, 32, 0.1) 100%
        );
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1.5rem;
        position: relative;
        z-index: 1;
    }

    .empty-state-icon svg {
        width: 40px;
        height: 40px;
        color: #daa520;
    }

    .empty-state-title {
        font-family: "Playfair Display", serif;
        font-size: 1.75rem;
        font-weight: 700;
        color: #293c0a;
        margin-bottom: 0.75rem;
        position: relative;
        z-index: 1;
    }

    .empty-state-message {
        font-family: Raleway, sans-serif;
        font-size: 1.125rem;
        font-weight: 400;
        color: #6a8b3a;
        max-width: 500px;
        line-height: 1.6;
        margin-bottom: 2rem;
        position: relative;
        z-index: 1;
    }

    .empty-state-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.625rem 1.25rem;
        background-color: #daa520;
        color: #ffffff;
        border-radius: 50px;
        font-family: Raleway, sans-serif;
        font-size: 0.875rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        position: relative;
        z-index: 1;
        box-shadow: 0 2px 8px rgba(218, 165, 32, 0.3);
    }

    .empty-state-badge svg {
        width: 16px;
        height: 16px;
        animation: pulse 2s ease-in-out infinite;
    }

    @keyframes pulse {
        0%,
        100% {
            opacity: 1;
        }
        50% {
            opacity: 0.5;
        }
    }
}

@layer utilities {
    /* Utilidades de espaciado personalizado */
    .spacing-xs {
        padding: 0.5rem;
    }
    .spacing-sm {
        padding: 1rem;
    }
    .spacing-md {
        padding: 2rem;
    }
    .spacing-lg {
        padding: 4rem;
    }
    .spacing-xl {
        padding: 6rem;
    }

    /* Utilidad para texto sr-only */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }

    /* Skip to main content */
    .skip-to-main {
        position: absolute;
        background-color: #daa520;
        color: #ffffff;
        padding: 1rem 2rem;
        text-decoration: none;
        top: -100px;
        left: 0;
        z-index: 9999;
        transition: top 0.2s ease;
    }

    .skip-to-main:focus {
        top: 0;
    }
}

/* ============================================
   ACCESIBILIDAD - Preferencia de movimiento reducido
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   RESPONSIVE - Media Queries
   ============================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    h2 {
        font-size: 1.75rem;
    }
    h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    h3 {
        font-size: 1.25rem;
    }
}
