/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #2C5AA0;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    /* Deshabilitar el efecto bounce en móviles */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Container principal */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    /* Asegurar que el contenido se pueda hacer scroll sin bounce */
    padding-bottom: 2rem;
}

/* Sección del perfil */
.profile-section {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 1s ease-out;
}

.profile-image {
    position: relative;
    margin-bottom: 1.5rem;
}

.doctor-photo {
    width: 144px;
    height: 144px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 0 30px rgba(74, 144, 194, 0.6),
        0 0 60px rgba(44, 90, 160, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    animation: float 6s ease-in-out infinite;
    object-fit: cover;
    object-position: center 30%;
}

.doctor-photo:hover {
    transform: scale(1.1);
    box-shadow: 
        0 0 40px rgba(74, 144, 194, 0.8),
        0 0 80px rgba(44, 90, 160, 0.6);
}

.profile-info {
    position: relative;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #4a90c2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.verified-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #4a90c2, #2c5aa0);
    border-radius: 50%;
    color: white;
    box-shadow: 0 0 15px rgba(74, 144, 194, 0.6);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.verified-badge svg {
    width: 14px;
    height: 14px;
    fill: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.profile-description {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 0.5rem;
}

.profile-subtitle {
    font-size: 0.95rem;
    color: #aaa;
    opacity: 0.8;
}

/* Iconos sociales */
.social-icons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    animation: fadeIn 1s ease-out 0.3s both;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
    animation-play-state: paused !important;
}

/* Efecto de ola automático para iconos sociales */
.social-icon:nth-child(1) {
    animation: waveHover 1.6s ease-in-out infinite, waveHoverInstagram 1.6s ease-in-out infinite;
    animation-delay: 0s, 0s;
}

.social-icon:nth-child(2) {
    animation: waveHover 1.6s ease-in-out infinite, waveHoverFacebook 1.6s ease-in-out infinite;
    animation-delay: 0.2s, 0.2s;
}

.social-icon:nth-child(3) {
    animation: waveHover 1.6s ease-in-out infinite, waveHoverTwitter 1.6s ease-in-out infinite;
    animation-delay: 0.4s, 0.4s;
}

.social-icon:nth-child(4) {
    animation: waveHover 1.6s ease-in-out infinite, waveHoverLinkedin 1.6s ease-in-out infinite;
    animation-delay: 0.6s, 0.6s;
}

.social-icon:nth-child(5) {
    animation: waveHover 1.6s ease-in-out infinite, waveHoverTiktok 1.6s ease-in-out infinite;
    animation-delay: 0.8s, 0.8s;
}

.social-icon:nth-child(6) {
    animation: waveHover 1.6s ease-in-out infinite, waveHoverYoutube 1.6s ease-in-out infinite;
    animation-delay: 1s, 1s;
}

.social-icon:nth-child(7) {
    animation: waveHover 1.6s ease-in-out infinite;
    animation-delay: 1.2s;
}

.social-icon:nth-child(8) {
    animation: waveHover 1.6s ease-in-out infinite;
    animation-delay: 1.4s;
}

.social-icon.instagram:hover {
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: 0 10px 25px rgba(225, 48, 108, 0.5);
}

.social-icon.facebook:hover {
    background: #1877F2;
    box-shadow: 0 10px 25px rgba(24, 119, 242, 0.5);
}

.social-icon.twitter:hover {
    background: #1DA1F2;
    box-shadow: 0 10px 25px rgba(29, 161, 242, 0.5);
}

.social-icon.linkedin:hover {
    background: #0077B5;
    box-shadow: 0 10px 25px rgba(0, 119, 181, 0.5);
}

.social-icon.tiktok:hover {
    background: linear-gradient(135deg, #ff0050, #000);
    box-shadow: 0 10px 25px rgba(255, 0, 80, 0.5);
}

.social-icon.youtube:hover {
    background: #FF0000;
    box-shadow: 0 10px 25px rgba(255, 0, 0, 0.5);
}

/* Container de enlaces */
.links-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Enlaces */
.link-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out;
}

.link-item:nth-child(1) { animation-delay: 0.1s; }
.link-item:nth-child(2) { animation-delay: 0.2s; }
.link-item:nth-child(3) { animation-delay: 0.3s; }
.link-item:nth-child(4) { animation-delay: 0.4s; }
.link-item:nth-child(5) { animation-delay: 0.5s; }
.link-item:nth-child(6) { animation-delay: 0.6s; }
.link-item:nth-child(7) { animation-delay: 0.7s; }

.link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.link-item:hover::before {
    left: 100%;
}

.link-item:hover {
    transform: translateY(-3px) scale(1.02);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 15px 35px rgba(255, 255, 255, 0.1),
        0 0 30px rgba(74, 144, 194, 0.3);
}

.link-icon {
    font-size: 1.6rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.link-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.link-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.link-subtitle {
    font-size: 0.95rem;
    opacity: 0.7;
    color: #ccc;
}

.link-arrow {
    font-size: 1.3rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.link-item:hover .link-arrow {
    transform: translateX(5px);
    opacity: 1;
}

/* Enlaces especiales */
.link-item.primary-link {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(255, 82, 82, 0.2));
    border: 2px solid rgba(255, 107, 107, 0.5);
    animation: primaryPulse 3s ease-in-out infinite;
}

.link-item.primary-link:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.5), rgba(255, 82, 82, 0.4));
    box-shadow: 
        0 15px 35px rgba(255, 107, 107, 0.4),
        0 0 30px rgba(255, 107, 107, 0.6);
}

.link-item.whatsapp-link:hover {
    background: rgba(37, 211, 102, 0.3);
    box-shadow: 
        0 15px 35px rgba(37, 211, 102, 0.3),
        0 0 30px rgba(37, 211, 102, 0.5);
}

/* Estilos específicos para el icono de WhatsApp */
.whatsapp-link .link-icon svg {
    color: #25D366;
    transition: all 0.3s ease;
}

.whatsapp-link:hover .link-icon svg {
    color: #128C7E;
    transform: scale(1.1);
}

.link-item.neurodesarrollo-link:hover {
    background: rgba(147, 51, 234, 0.3);
    box-shadow: 
        0 15px 35px rgba(147, 51, 234, 0.3),
        0 0 30px rgba(147, 51, 234, 0.5);
}

.link-item.opinion-link:hover {
    background: rgba(251, 191, 36, 0.3);
    box-shadow: 
        0 15px 35px rgba(251, 191, 36, 0.3),
        0 0 30px rgba(251, 191, 36, 0.5);
}

/* Footer */
.footer-text {
    text-align: center;
    opacity: 0.6;
    font-size: 0.8rem;
    line-height: 1.4;
    animation: fadeIn 1s ease-out 1s both;
}

/* Animaciones */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes primaryPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 107, 107, 0.6);
    }
}

@keyframes waveHover {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.1);
    }
    25% {
        transform: translateY(-3px) scale(1.1);
        box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
        background: rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: translateY(-3px) scale(1.1);
        box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
        background: rgba(255, 255, 255, 0.2);
    }
    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Animaciones específicas para cada red social en el efecto de ola */
@keyframes waveHoverInstagram {
    0% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
    25% {
        background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
        box-shadow: 0 10px 25px rgba(225, 48, 108, 0.5);
    }
    50% {
        background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
        box-shadow: 0 10px 25px rgba(225, 48, 108, 0.5);
    }
    100% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
}

@keyframes waveHoverFacebook {
    0% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
    25% {
        background: #1877F2;
        box-shadow: 0 10px 25px rgba(24, 119, 242, 0.5);
    }
    50% {
        background: #1877F2;
        box-shadow: 0 10px 25px rgba(24, 119, 242, 0.5);
    }
    100% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
}

@keyframes waveHoverTwitter {
    0% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
    25% {
        background: #1DA1F2;
        box-shadow: 0 10px 25px rgba(29, 161, 242, 0.5);
    }
    50% {
        background: #1DA1F2;
        box-shadow: 0 10px 25px rgba(29, 161, 242, 0.5);
    }
    100% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
}

@keyframes waveHoverLinkedin {
    0% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
    25% {
        background: #0077B5;
        box-shadow: 0 10px 25px rgba(0, 119, 181, 0.5);
    }
    50% {
        background: #0077B5;
        box-shadow: 0 10px 25px rgba(0, 119, 181, 0.5);
    }
    100% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
}

@keyframes waveHoverTiktok {
    0% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
    25% {
        background: linear-gradient(135deg, #ff0050, #000);
        box-shadow: 0 10px 25px rgba(255, 0, 80, 0.5);
    }
    50% {
        background: linear-gradient(135deg, #ff0050, #000);
        box-shadow: 0 10px 25px rgba(255, 0, 80, 0.5);
    }
    100% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
}

@keyframes waveHoverYoutube {
    0% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
    25% {
        background: #FF0000;
        box-shadow: 0 10px 25px rgba(255, 0, 0, 0.5);
    }
    50% {
        background: #FF0000;
        box-shadow: 0 10px 25px rgba(255, 0, 0, 0.5);
    }
    100% {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem 0.75rem;
        /* Mejorar el scroll en móviles */
        padding-bottom: 3rem;
    }

    .profile-name {
        font-size: 1.4rem;
    }

    .doctor-photo {
        width: 108px;
        height: 108px;
        object-fit: cover;
        object-position: center 30%;
    }

    .social-icons {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .social-icon {
        width: 32px;
        height: 32px;
    }

    .social-icon svg {
        width: 16px;
        height: 16px;
    }

    .link-item {
        padding: 0.75rem 1rem;
    }

    .link-icon {
        width: 34px;
        height: 34px;
        font-size: 1.3rem;
        margin-right: 0.75rem;
    }

    .link-title {
        font-size: 1rem;
    }

    .link-subtitle {
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 1rem 0.5rem;
    }

    .profile-name {
        font-size: 1.6rem;
    }

    .doctor-photo {
        width: 120px;
        height: 120px;
        object-fit: cover;
        object-position: center 30%;
    }

    .social-icons {
        gap: 0.75rem;
    }

    .social-icon {
        width: 35px;
        height: 35px;
    }

    .social-icon svg {
        width: 18px;
        height: 18px;
    }

    .link-item {
        padding: 0.875rem 1.25rem;
    }

    .link-icon {
        width: 37px;
        height: 37px;
        font-size: 1.4rem;
    }

    .link-title {
        font-size: 1.05rem;
    }

    .link-subtitle {
        font-size: 0.9rem;
    }
}

/* Botón de compartir */
.share-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.share-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Modal de compartir */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.share-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.share-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease;
}

.share-modal-header {
    background: linear-gradient(135deg, #2c5aa0 0%, #4a90c2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.share-modal-body {
    padding: 1.5rem;
}

.share-url-section {
    margin-bottom: 1.5rem;
}

.share-url-input {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem;
    gap: 0.75rem;
    transition: border-color 0.3s ease;
}

.share-url-input:hover {
    border-color: #4a90c2;
}

.share-url-icon {
    font-size: 1.2rem;
    color: #6c757d;
}

.share-url-text {
    flex: 1;
    font-size: 0.9rem;
    color: #495057;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.share-copy-btn {
    background: #4a90c2;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.share-copy-btn:hover {
    background: #2c5aa0;
    transform: translateY(-1px);
}

.share-copy-btn.copied {
    background: #28a745;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    cursor: pointer;
}

.share-option:hover {
    background: white;
    border-color: #4a90c2;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 194, 0.2);
}

.share-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.share-option-icon.whatsapp {
    background: #25d366;
    color: white;
}

.share-option-icon.facebook {
    background: #1877f2;
    color: white;
}

.share-option-icon.twitter {
    background: #000000;
    color: white;
}

.share-option-icon.email {
    background: #ea4335;
    color: white;
}

.share-option span {
    flex: 1;
    font-weight: 500;
}

.share-option svg {
    width: 16px;
    height: 16px;
    fill: #6c757d;
    transition: transform 0.3s ease;
}

.share-option:hover svg {
    transform: translateX(3px);
}

/* Responsive para la modal */
@media (max-width: 480px) {
    .share-button {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .share-button svg {
        width: 18px;
        height: 18px;
    }
    
    .share-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .share-modal-header {
        padding: 1.25rem;
    }
    
    .share-modal-body {
        padding: 1.25rem;
    }
    
    .share-url-text {
        font-size: 0.8rem;
    }
    
    .share-copy-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Estilos adicionales para prevenir el bounce en móviles */
html {
    /* Prevenir el bounce en iOS */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Estilos específicos para iOS */
@supports (-webkit-touch-callout: none) {
    body {
        /* Configuración específica para iOS */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: none;
    }
}