/**
 * Custom Styles for Farmacia Iconika Landing Page
 * Extends Tailwind CSS with custom animations and utilities
 */

/* ============================================
   Custom Fonts (Disabled - Using Google Fonts)
   ============================================ */
/*
@font-face {
    font-family: 'Avenir';
    src: url('../assets/Avenir.ttc') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Avenir';
    src: url('../assets/Avenir.ttc') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Avenir';
    src: url('../assets/Avenir.ttc') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Avenir';
    src: url('../assets/Avenir.ttc') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
*/

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --color-primary: #3F5850;       /* Verde bosque Iconika */
    --color-secondary: #FF5416;     /* Caldera Iconika */
    --color-accent: #C5FF90;        /* Verde Lima Iconika */
    --color-dark: #1F2B3A;          /* azul oscuro, más profundo y elegante */
    --color-light: #EDF2F4;         /* gris muy claro para contraste suave */
    --transition-speed: 0.3s;
    --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-accent-subtle: 0 10px 15px -3px rgba(197, 255, 144, 0.2), 0 4px 6px -2px rgba(197, 255, 144, 0.1);
    --shadow-accent-hover: 0 20px 25px -5px rgba(197, 255, 144, 0.25), 0 10px 10px -5px rgba(197, 255, 144, 0.15);
}

/* ============================================
   Base Styles
   ============================================ */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {

    transition: opacity 0.5s ease-in-out;
    padding-top: 80px; /* Offset for fixed header */
}

body.loaded {
    opacity: 1;
}

/* ============================================
   Animations
   ============================================ */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Animation Delays */
.animation-delay-200 {
    animation-delay: 0.2s;
    opacity: 0;
}

.animation-delay-400 {
    animation-delay: 0.4s;
    opacity: 0;
}

.animation-delay-600 {
    animation-delay: 0.6s;
    opacity: 0;
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

/* Bounce */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

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

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   Utility Classes
   ============================================ */

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hover Effects */
.hover-lift {
    transition: transform var(--transition-speed) var(--transition-easing);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-light);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-light);
}

/* ============================================
   Component Styles
   ============================================ */

/* CTA Buttons */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-speed) var(--transition-easing);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button:active {
    transform: scale(0.98);
}

/* Primary Button - Base class for all CTA buttons */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-accent);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Secondary Button - Inverted colors */
.btn-secondary {
    background-color: var(--color-accent);
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-accent);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* Form Inputs */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 168, 168, 0.1);
}

input.border-red-500:focus,
select.border-red-500:focus,
textarea.border-red-500:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Form Labels */
label {
    transition: color var(--transition-speed) var(--transition-easing);
}

/* Modal Backdrop */
#form-modal {
    animation: fadeIn 0.3s ease-out;
}

#form-modal > div {
    max-height: calc(100vh - 2rem);
}

/* Modal Close Button */
#close-modal {
    transition: transform var(--transition-speed) var(--transition-easing);
}

#close-modal:hover {
    transform: rotate(90deg);
}

/* Cards */
.card {
    transition: all var(--transition-speed) var(--transition-easing);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .animate-fade-in-up {
        animation-duration: 0.5s;
    }

    /* Adjust spacing */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* Stack language selector vertically if needed */
    .lang-btn {
        min-width: 48px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Optimize for tablet viewing */
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    /* Enable hover effects only on desktop */
    .hover-effect {
        transition: all var(--transition-speed) var(--transition-easing);
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    /* Hide unnecessary elements when printing */
    .lang-btn,
    .cta-button,
    #form-modal,
    footer {
        display: none;
    }

    /* Ensure proper page breaks */
    section {
        page-break-inside: avoid;
    }

    /* Print-friendly colors */
    body {
        color: black;
        background: white;
    }
}

/* ============================================
   Accessibility
   ============================================ */

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduce Motion for Users Who Prefer It */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .cta-button {
        border: 2px solid currentColor;
    }

    input,
    select,
    textarea {
        border-width: 2px;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode support */
    /*
    :root {
        --color-dark: #F8F9FA;
        --color-light: #1A1A2E;
    }

    body {
        background-color: #1A1A2E;
        color: #F8F9FA;
    }
    */
}

/* ============================================
   Loading States
   ============================================ */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Button Loading State */
button[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 20px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================
   Custom Utilities
   ============================================ */

/* Text Selection */
::selection {
    background-color: var(--color-primary);
    color: white;
}

::-moz-selection {
    background-color: var(--color-primary);
    color: white;
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[data-src].loaded {
    opacity: 1;
}

/* Aspect Ratio Utilities */
.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-ratio-1-1 {
    aspect-ratio: 1 / 1;
}

/* Container Queries Support (Progressive Enhancement) */
@supports (container-type: inline-size) {
    .container-query {
        container-type: inline-size;
    }
}

/* ============================================
   Corporate Values Section - Flip Card Effect
   ============================================ */

/* Values Image Grid */
.values-image-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
}

@media (max-width: 1024px) {
    .values-image-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .values-image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 425px) {
    .values-image-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Flip Card Container */
.value-image-container {
    position: relative;
    aspect-ratio: 1 / 2;
    perspective: 1000px;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Flip Card Inner */
.value-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.value-image-container:hover .value-flip-inner {
    transform: rotateY(180deg);
}

/* Front and Back Face */
.value-flip-front,
.value-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Front Face */
.value-flip-front {
    background: #f0f0f0;
}

.value-flip-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Value Icon Overlay */
.value-icon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.value-image-container:hover .value-icon-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* Plus Icon */
.plus-icon {
    width: 80px;
    height: 80px;
    position: relative;
}

.plus-icon::before,
.plus-icon::after {
    content: '';
    position: absolute;
    background: #7FFF00;
    /* box-shadow: 0 0 20px #7FFF00, 0 0 40px #7FFF00; */
}

.plus-icon::before {
    width: 100%;
    height: 10%;
    top: 45%;
    left: 0;
}

.plus-icon::after {
    width: 10%;
    height: 100%;
    top: 0;
    left: 45%;
}

/* Value Label on Image */
.value-label {
    position: absolute;
    top: 0px;
    left: 0px;
    background: var(--color-primary);
    color: var(--color-accent);
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    width: 100%;
    text-align: center;
}

/* Back Face */
.value-flip-back {
    background: var(--color-primary);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    color: var(--color-light);
    text-align: center;
}

.value-flip-back h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.value-flip-back p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-accent);
}

@media (max-width: 640px) {
    .value-flip-back {
        padding: 1rem;
    }
    
    .value-flip-back h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .value-flip-back p {
        font-size: 1.25rem;
    }
    
    .plus-icon {
        width: 60px;
        height: 60px;
    }
}

/* ============================================
   Vendor Prefixes (if needed)
   ============================================ */

/* Ensure compatibility with older browsers */
button,
input,
select,
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}


#key-points{
    p{margin: 0;}
}