@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@400;500;600;700&display=swap');
html {
    scroll-behavior: smooth;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ios-card {
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.15), 0 1px 3px -2px rgb(0 0 0 / 0.15);
    backdrop-filter: blur(25px) saturate(200%);
    background: rgba(242, 242, 247, 0.85); /* Enhanced iOS Light */
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 28px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}
.ios-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.6), transparent);
}
.dark .ios-card::before {
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.6), transparent);
}
.dark .ios-card {
    background: rgba(28, 28, 30, 0.85); /* Enhanced iOS Dark */
    border-color: rgba(255, 255, 255, 0.15);
}
.ios-card-vibrant {
    backdrop-filter: blur(25px) saturate(200%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.9);
}
.dark .ios-card-vibrant {
    background: rgba(44, 44, 46, 0.9);
    border-color: rgba(255, 255, 255, 0.15);
}
.modal {
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}
.modal-content {
    transform: scale(0.85) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 28px;
}
.modal.open {
    opacity: 1;
    visibility: visible;
}
.modal.open .modal-content {
    transform: scale(1) translateY(0);
}
.toast {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateY(20px);
}
.text-input-ios:focus {
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.4);
    border-color: #007AFF;
    transform: scale(1.02);
}
.button-ios {
    border-radius: 14px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}
.button-ios::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}
.button-ios:hover::before {
    left: 100%;
}
.button-ios:active {
    transform: scale(0.95);
}
.section-header {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.6px;
    background: linear-gradient(135deg, #007AFF, #5856D6, #FF2D55);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.history-item {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 20px;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.6);
    transform: translateY(0);
}
.dark .history-item {
     background-color: rgba(44, 44, 46, 0.6);
}
.history-item:hover, .history-item:active {
    transform: translateY(-4px) scale(1.02);
    background-color: rgba(235, 235, 240, 0.9);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.dark .history-item:hover, .dark .history-item:active {
    background-color: rgba(58, 58, 60, 0.9);
}
.large-modal-image {
    max-height: 65vh;
    border-radius: 24px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.large-modal-image:hover {
    transform: scale(1.04);
}
/* Theme Toggle Icon Styling - Enhanced */
.theme-toggle-btn { position: relative; }
.theme-svg { transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.theme-toggle-btn:hover .theme-svg { transform: rotate(360deg) scale(1.2); }
.moon-path { transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); opacity: 1; transform: scale(1); }
.sun-group { transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); opacity: 0; transform: scale(0.5) rotate(-180deg); }
.sun-circle { transition: all 0.6s ease; }
.sun-rays line { transition: all 0.6s ease; transform-origin: center; }
.dark .moon-path { opacity: 0; transform: scale(0.5) rotate(180deg); }
.dark .sun-group { opacity: 1; transform: scale(1) rotate(0deg); }
/* Custom File Input */
.file-input-button { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: all 0.4s ease; }
/* Drag and Drop Zone */
.drop-zone { border: 2px dashed transparent; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.drop-zone.drag-over { border-color: #007AFF; background: rgba(0, 122, 255, 0.1); transform: scale(1.03); }
/* Loading Spinner */
.spinner { border-radius: 50%; animation: spin 1s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
/* Footer Styles and Animations */
.footer-container { position: relative; padding: 2.5rem 1.5rem; overflow: hidden; }
.footer-content { animation: fade-in-up 1.2s 0.3s ease-out forwards; opacity: 0; }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
.footer-container::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: -1; background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab); background-size: 500% 500%; animation: gradient-animation 12s ease infinite; opacity: 0.1; transition: opacity 0.6s ease; }
.dark .footer-container::before { opacity: 0.2; }
@keyframes gradient-animation { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.social-icon { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.4s ease-out; }
.social-icon:hover { transform: translateY(-6px) rotate(10deg) scale(1.2); color: #007AFF; text-shadow: 0 3px 6px rgba(0,122,255,0.4); }
.dark .social-icon:hover { color: #0A84FF; }
/* Language change animation */
[data-i18n-key] { transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.translating { opacity: 0; transform: scale(0.9); }
/* Page Load Animations */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.animate-fade-in { animation: fade-in 1s ease-out forwards; }
@keyframes slide-up { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.animate-slide-up { animation: slide-up 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; opacity: 0; }
.delay-200 { animation-delay: 0.2s; } .delay-400 { animation-delay: 0.4s; } .delay-500 { animation-delay: 0.5s; } .delay-600 { animation-delay: 0.6s; } .delay-800 { animation-delay: 0.8s; }
/* Image Preview Hover */
img.ios-card { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease; }
img.ios-card:hover { transform: scale(1.1); box-shadow: 0 25px 50px rgba(0,0,0,0.15); }

/* --- ESTILOS NUEVOS --- */

/* Contenedor de Anuncios */
.ad-container {
    width: 100%;
    min-height: 100px; /* Altura mínima esperada para un anuncio banner */
    transition: all 0.3s ease;
}
/* Regla clave: si el contenedor está vacío (sin anuncio), colapsa */
.ad-container:empty {
    min-height: 0;
    margin: 0;
    padding: 0;
    display: none; /* Lo oculta completamente */
}

/* FAQ Acordeón */
.faq-item {
    padding: 1.2rem;
    border-radius: 20px;
    background-color: rgba(128, 128, 128, 0.15);
    transition: background-color 0.4s ease;
}
.dark .faq-item {
    background-color: rgba(128, 128, 128, 0.25);
}
.faq-item[open] {
    background-color: rgba(128, 128, 128, 0.2);
}
.dark .faq-item[open] {
    background-color: rgba(128, 128, 128, 0.3);
}
.faq-item summary {
    list-style: none; /* Quita la flecha por defecto */
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-item summary::-webkit-details-marker {
    display: none; /* También para Safari */
}
.faq-item summary::after {
    content: '+';
    font-size: 1.8em;
    font-weight: 400;
    color: #007AFF;
    transition: transform 0.4s ease;
}
.faq-item[open] summary::after {
    transform: rotate(135deg);
}

/* Tutorial Interactivo (Rediseñado) */
#tutorialOverlay {
    backdrop-filter: blur(15px);
    transition: opacity 0.5s ease;
}
#tutorialContent {
    transform: scale(0.95);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.highlight-element {
    position: relative;
    z-index: 101;
    box-shadow: 0 0 0 5px rgba(0, 122, 255, 0.8), 0 0 25px rgba(0, 122, 255, 0.6);
    border-radius: 28px;
    transition: box-shadow 0.4s ease;
    animation: pulse-highlight 1.5s infinite;
}
@keyframes pulse-highlight {
    0% { box-shadow: 0 0 0 5px rgba(0, 122, 255, 0.8), 0 0 25px rgba(0, 122, 255, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(0, 122, 255, 0.6), 0 0 35px rgba(0, 122, 255, 0.4); }
    100% { box-shadow: 0 0 0 5px rgba(0, 122, 255, 0.8), 0 0 25px rgba(0, 122, 255, 0.6); }
}