/* ========================================
   VARIABLES Y RESET
   ======================================== */
:root {
    --primary-dark: #0a2540;
    --primary-accent: #0055ff;
    --primary-light: #eef2ff;
    --gray-bg: #f9fafb;
    --gray-border: #e5e7eb;
    --text-dark: #111827;
    --text-muted: #4b5563;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --gradient-primary: linear-gradient(135deg, #0a2540 0%, #0055ff 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(120deg, #ffffff 0%, var(--primary-light) 100%);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* ========================================
   CONTENEDOR PRINCIPAL (estilo Linktree)
   ======================================== */
.linktree-container {
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

/* Perfil */
.profile {
    margin-bottom: 32px;
}

.avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--card-shadow);
    margin-bottom: 16px;
}

.profile h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.bio {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Lista de Enlaces (Botones) */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 32px 0;
}

/* ========================================
   COMPATIBILIDAD ENTRE NAVEGADORES
   ========================================
   Algunos navegadores antiguos o con configuraciones específicas pueden mostrar
   los elementos juntos debido a diferencias en la implementación de Flexbox.
   Estas reglas aseguran consistencia entre navegadores.
   ======================================== */
.link-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    background: white;
    padding: 18px 20px 18px 20px;
    padding-right: 72px;
    border-radius: 28px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-border);
    box-shadow: var(--card-shadow);
    min-height: 72px;
    /* Mejor compatibilidad flexbox */
    -webkit-box-align: center;
    -ms-flex-align: center;
    /* Evita que los elementos se salgan del contenedor */
    overflow: hidden;
    /* Fallback para navegadores muy antiguos */
    display: -webkit-flex;
    display: -ms-flexbox;
}

.link-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-accent);
    box-shadow: 0 20px 25px -12px rgba(0, 0, 0, 0.1);
}

.link-main {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0; /* Permite que el texto se rompa en contenedores flex */
}

.link-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: contain;
    background: #f8fafc;
}

.link-title {
    flex: 1;
    min-width: 0; /* Permite que el texto se rompa */
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: left;
    line-height: 1.4;
    /* Mejor compatibilidad para texto largo */
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
}

.link-card span {
    color: inherit;
}

.link-card:hover .link-title {
    color: var(--primary-accent);
}

.share-panel {
    display: none;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translate(110%, -50%);
    width: 240px;
    background: white;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
    padding: 16px;
    z-index: 20;
}

.share-panel.visible {
    display: block;
}

.share-panel h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
}

.share-panel p {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.share-options {
    display: grid;
    gap: 10px;
}

.share-options a,
.share-options button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: var(--primary-accent);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.share-options a:hover,
.share-options button:hover {
    background: var(--primary-dark);
}

@media (max-width: 640px) {
    .share-panel {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 20px;
        left: 20px;
        transform: none;
        width: auto;
        max-width: none;
    }

    .share-btn {
        right: 14px;
    }
}



/* Footer */
.footer {
    margin-top: 48px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--gray-border);
    padding-top: 24px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 480px) {
    body {
        padding: 20px 16px;
    }
    
    .link-card {
        padding: 14px 16px;
        font-size: 0.9rem;
        /* Asegura que el layout se mantenga en móviles */
        flex-wrap: nowrap;
        min-height: 64px;
    }
    
    .avatar {
        width: 80px;
        height: 80px;
    }
    
    .link-main {
        gap: 10px;
    }
    
    .link-icon {
        width: 28px;
        height: 28px;
    }
}