/* ============================================
   DENTAL MÁLAGA - Premium Dental Website
   Elegant Blue Theme with Vibrant Pop Aesthetic
   ============================================ */

:root {
    --primary: #1a6bff;
    --primary-dark: #0a1f44;
    --primary-light: #4d8eff;
    --accent: #00c2ff;
    --accent-light: #7ddfff;
    --bg: #fafbff;
    --bg-alt: #f0f4ff;
    --text: #0f172a;
    --text-light: #475569;
    --shadow-color: rgba(26, 107, 255, 0.15);
    --shadow-accent: rgba(0, 194, 255, 0.2);
}

/* ============================================
   Base & Reset
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ============================================
   Header
   ============================================ */
#header {
    background: transparent;
}

#header.scrolled {
    background: var(--primary-dark)/95;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(10, 31, 68, 0.3);
}

#header.scrolled {
    background: rgba(10, 31, 68, 0.95);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-light);
    transition: width 0.3s ease;
    border-radius: 2px;
}

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

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: white;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border-radius: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px var(--shadow-color), 0 2px 8px var(--shadow-accent);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px) rotate(-1deg);
    box-shadow: 0 8px 30px var(--shadow-color), 0 4px 15px var(--shadow-accent);
}

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

.btn-primary > * {
    position: relative;
    z-index: 1;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background: transparent;
    color: white;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border-radius: 1rem;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px) rotate(1deg);
}

/* ============================================
   Hero Section
   ============================================ */
#hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0d3a8e 40%, var(--primary) 70%, var(--accent) 100%);
}

.hero-pattern {
    background-image: radial-gradient(circle at 20% 50%, rgba(0, 194, 255, 0.15) 0%, transparent 50%),
                       radial-gradient(circle at 80% 20%, rgba(26, 107, 255, 0.2) 0%, transparent 40%),
                       radial-gradient(circle at 60% 80%, rgba(125, 223, 255, 0.1) 0%, transparent 40%);
}

.hero-clip-container {
    position: relative;
    border-radius: 2rem;
    overflow: hidden;
    transform: rotate(2deg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-clip-container:hover {
    transform: rotate(0deg) scale(1.02);
}

.hero-clip-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
    transition: transform 0.5s ease;
}

.hero-clip-container:hover .hero-clip-image {
    transform: scale(1.05);
}

.hero-floating-card {
    position: absolute;
    bottom: -20px;
    left: -20px;
    background: rgba(10, 31, 68, 0.9);
    backdrop-filter: blur(20px);
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Scroll indicator */
.scroll-indicator {
    animation: fadeInUp 1s ease 1.5s both;
}

.scroll-arrow {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================
   Services Section
   ============================================ */
.section-decoration {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.05;
    pointer-events: none;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    position: relative;
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(26, 107, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-8px) rotate(-0.5deg);
    box-shadow: 0 20px 50px var(--shadow-color), 0 8px 25px var(--shadow-accent);
    border-color: transparent;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(26, 107, 255, 0.1) 0%, rgba(0, 194, 255, 0.1) 100%);
    border-radius: 1rem;
    color: var(--primary);
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    transform: rotate(-5deg) scale(1.1);
}

.service-card.featured {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    border: none;
}

.service-card.featured h3,
.service-card.featured p {
    color: white;
}

.service-card.featured .service-icon {
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent-light);
}

.service-card.featured:hover .service-icon {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.service-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 2rem;
    letter-spacing: 0.05em;
}

/* ============================================
   About Section
   ============================================ */
.about-image-grid {
    position: relative;
    padding-right: 3rem;
    padding-bottom: 3rem;
}

.about-img-main {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.about-img-secondary {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 55%;
    height: 200px;
    object-fit: cover;
    border: 4px solid var(--bg-alt);
}

.about-experience-badge {
    position: absolute;
    top: -20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    padding: 1.25rem;
    border-radius: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 10px 30px var(--shadow-color);
    animation: float 5s ease-in-out infinite;
}

/* ============================================
   Team Cards
   ============================================ */
.team-card {
    background: white;
    border-radius: 2rem;
    overflow: hidden;
    border: 1px solid rgba(26, 107, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px var(--shadow-color);
}

.team-image-wrapper {
    overflow: hidden;
    height: 300px;
}

.team-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.team-card:hover .team-image {
    transform: scale(1.08);
}

/* ============================================
   Testimonials Section
   ============================================ */
.testimonials-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(26, 107, 255, 0.05) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 20%, rgba(0, 194, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(26, 107, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-family: 'Fraunces', serif;
    font-size: 5rem;
    line-height: 1;
    color: var(--primary);
    opacity: 0.08;
    pointer-events: none;
}

.testimonial-card:hover {
    transform: translateY(-5px) rotate(-0.5deg);
    box-shadow: 0 15px 40px var(--shadow-color);
}

.testimonial-stars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.star {
    width: 18px;
    height: 18px;
    color: #fbbf24;
}

.testimonial-text {
    color: var(--text-light);
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* ============================================
   Gallery Section
   ============================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item-large {
    grid-column: span 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: scale(1.02) rotate(-1deg);
    box-shadow: 0 15px 40px var(--shadow-color);
    z-index: 2;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 31, 68, 0.8) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-overlay span {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-overlay span {
    transform: translateY(0);
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 31, 68, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 1rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.active .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.875rem;
    opacity: 0.7;
}

/* ============================================
   CTA Section
   ============================================ */
.cta-pattern {
    background-image: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
                       radial-gradient(circle at 80% 20%, rgba(0, 194, 255, 0.15) 0%, transparent 40%);
}

/* ============================================
   Contact Form
   ============================================ */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(26, 107, 255, 0.1);
    border-radius: 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text);
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 107, 255, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

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

/* ============================================
   Contact Info
   ============================================ */
.contact-info-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-info-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: 1.25rem;
    border: 1px solid rgba(26, 107, 255, 0.08);
    transition: all 0.3s ease;
}

.contact-info-card:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(26, 107, 255, 0.1) 0%, rgba(0, 194, 255, 0.1) 100%);
    border-radius: 0.75rem;
    color: var(--primary);
    flex-shrink: 0;
}

/* ============================================
   Footer
   ============================================ */
.footer-social {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: white;
    transition: all 0.3s ease;
}

.footer-social:hover {
    background: var(--primary);
    transform: translateY(-3px) rotate(-5deg);
}

/* ============================================
   WhatsApp Floating Button
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    animation: pulse-whatsapp 2s ease-in-out infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 8px 35px rgba(37, 211, 102, 0.5);
}

@keyframes pulse-whatsapp {
    0%, 100% { box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4), 0 0 0 15px rgba(37, 211, 102, 0.1); }
}

/* ============================================
   Scroll Reveal Animations
   ============================================ */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .hero-clip-image {
        height: 300px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-clip-container {
        transform: rotate(0);
    }

    .hero-floating-card {
        bottom: -10px;
        left: 10px;
    }

    .about-image-grid {
        padding-right: 2rem;
        padding-bottom: 2rem;
    }

    .about-img-main {
        height: 300px;
    }

    .about-img-secondary {
        width: 50%;
        height: 150px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-item-large {
        grid-column: span 2;
    }

    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item-large {
        grid-column: span 1;
    }

    .whatsapp-float {
        bottom: 1rem;
        right: 1rem;
        width: 56px;
        height: 56px;
    }
}
