/* Custom Styles for Psicólogos Dora Boom */
/* Brand Colors: Primary #28537B (Blue) | Secondary #F5938E (Pink) */

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Body Reset */
body {
    overflow-x: hidden;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    animation: whatsappPulse 2s ease-in-out infinite;
}

@keyframes whatsappPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
}

.whatsapp-float:hover + .whatsapp-tooltip {
    opacity: 1;
    pointer-events: auto;
}

/* WhatsApp Tooltip Animation */
.whatsapp-tooltip {
    animation: slideIn 0.3s ease-out;
}

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

/* Navigation Enhancements */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-link {
    position: relative;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: #28537B;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* Service Cards Hover Effects */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

.animate-on-scroll {
    opacity: 0;
}

.animate-on-scroll.animated {
    animation: fadeInUp 0.8s ease forwards;
}

/* Form Inputs */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #4A90A4;
    box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.1);
}

/* Button Enhancements */
button,
a {
    transition: all 0.3s ease;
}

button:active {
    transform: scale(0.98);
}

/* Scroll Top Button */
#scrollTopBtn {
    transition: all 0.3s ease;
}

#scrollTopBtn.visible {
    opacity: 1;
    pointer-events: auto;
}

#scrollTopBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Loading Animation for Form Submit */
.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Success Message Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#successMessage {
    animation: slideDown 0.5s ease;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .service-card {
        margin-bottom: 1rem;
    }
    
    .nav-link::after {
        display: none;
    }
}

/* Hero Section Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

#inicio {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* Pulse Animation for CTA Buttons */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(40, 83, 123, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(40, 83, 123, 0);
    }
}

/* Accessibility Improvements */
a:focus,
button:focus {
    outline: 2px solid #28537B;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    nav,
    footer,
    #scrollTopBtn,
    #contacto {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    .service-card,
    section {
        page-break-inside: avoid;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .text-gray-600,
    .text-gray-700 {
        color: #000;
    }
    
    .bg-blue-50,
    .bg-teal-50 {
        background-color: #fff;
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Future implementation for dark mode if needed */
}

/* Selection Color */
::selection {
    background-color: #28537B;
    color: #ffffff;
}

::-moz-selection {
    background-color: #28537B;
    color: #ffffff;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #28537B;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #F5938E;
}