/* ==========================================================================
   Mario Eduardo Martínez Juárez (MEMJ) - Tarjeta de Presentación Oficial (Smart vCard)
   Executive Digital Smart Business Card
   ========================================================================== */

:root {
    --primary-navy: #0a192f;
    --secondary-blue: #112240;
    --exec-blue: #0f172a;
    --card-surface: rgba(17, 34, 64, 0.88);
    --accent-gold: #FFD700;
    --accent-gold-soft: rgba(255, 215, 0, 0.16);
    --accent-gold-glow: rgba(255, 215, 0, 0.35);
    --accent-gold-hover: #ffdf33;
    --accent-slate: #cfd8e6;
    --slate-muted: #94a3b8;
    --pure-white: #ffffff;
    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--exec-blue);
    color: var(--accent-slate);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    min-height: 100%;
}

body {
    background: radial-gradient(circle at 50% 10%, rgba(255, 215, 0, 0.08) 0%, transparent 45%),
                radial-gradient(circle at 10% 80%, rgba(2, 132, 199, 0.08) 0%, transparent 40%),
                var(--exec-blue);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 16px 40px;
    position: relative;
    overflow-x: hidden;
}

/* Subtle Geometric Ambient Grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Top App Bar */
.top-bar {
    width: 100%;
    max-width: 460px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    z-index: 10;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-slate);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    transition: var(--transition);
}

.btn-back-home:hover {
    color: var(--pure-white);
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-gold);
    transform: translateX(-2px);
}

.btn-share-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pure-white);
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.35);
    padding: 8px 14px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-share-top:hover {
    background: var(--accent-gold);
    color: #0a192f;
    box-shadow: 0 0 15px var(--accent-gold-glow);
    transform: translateY(-1px);
}

/* Main Smart Card Canvas */
.card-wrapper {
    width: 100%;
    max-width: 460px;
    background: var(--card-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 24px;
    padding: 28px 24px 32px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 
                0 0 45px rgba(255, 215, 0, 0.08);
    position: relative;
    z-index: 5;
    animation: cardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Metallic Gold Top Accent Strip */
.card-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    border-radius: 0 0 4px 4px;
}

/* Card Header & MEMJ Emblem */
.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.memj-emblem-wrap {
    width: 130px;
    margin-bottom: 20px;
    opacity: 0.95;
    transition: var(--transition);
}

.memj-emblem-wrap:hover {
    opacity: 1;
    transform: scale(1.03);
}

.memj-emblem-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Profile Photo Container */
.avatar-container {
    position: relative;
    width: 124px;
    height: 124px;
    margin: 0 auto 18px;
}

.avatar-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 3.5px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, rgba(255, 215, 0, 0.2) 50%, var(--accent-gold) 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.2);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    border-radius: 50%;
    background: #0f172a;
    display: block;
}

/* Online Status Indicator */
.status-indicator {
    position: absolute;
    bottom: 4px;
    right: 6px;
    background: #10b981;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #112240;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
    }
    50% {
        box-shadow: 0 0 14px rgba(16, 185, 129, 1);
    }
}

/* Names & Executive Titles */
.profile-name {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--pure-white);
    letter-spacing: -0.3px;
    margin-bottom: 6px;
    line-height: 1.2;
}

.name-accent {
    color: var(--accent-gold);
}

.profile-role-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.09);
    border: 1px solid rgba(255, 215, 0, 0.25);
    color: var(--accent-gold);
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.profile-tagline {
    font-size: 0.88rem;
    color: var(--accent-slate);
    line-height: 1.45;
    max-width: 360px;
    margin: 0 auto 12px;
}

.profile-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--slate-muted);
    margin-bottom: 22px;
}

/* Primary Action CTA: Guardar Contacto (.vcf) */
.btn-save-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #FFD700 0%, #ffc800 100%);
    color: #0a192f;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    text-decoration: none;
    margin-bottom: 22px;
}

.btn-save-contact:hover {
    background: linear-gradient(135deg, #ffe033 0%, #ffd000 100%);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(255, 215, 0, 0.45);
}

.btn-save-contact:active {
    transform: translateY(1px);
}

/* Quick Action Grid (1-Tap Buttons) */
.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: var(--accent-slate);
    text-decoration: none;
    transition: var(--transition);
}

.action-tile:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.4);
    color: var(--pure-white);
    transform: translateY(-3px);
}

.action-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent-gold);
    transition: var(--transition);
}

.action-tile:hover .action-tile-icon {
    background: var(--accent-gold);
    color: #0a192f;
    box-shadow: 0 0 14px var(--accent-gold-glow);
}

/* Specific Accent for WhatsApp */
.action-tile.tile-whatsapp:hover .action-tile-icon {
    background: #25d366;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(37, 211, 102, 0.5);
}

.action-tile-label {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}

/* Section Dividers */
.section-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 22px 0 16px;
    color: var(--slate-muted);
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-divider:not(:empty)::before {
    margin-right: 12px;
}

.section-divider:not(:empty)::after {
    margin-left: 12px;
}

/* Social Media Circular Buttons */
.social-buttons-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.social-circle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.05);
    color: var(--pure-white);
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.social-circle-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.12);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.25);
}

/* QR Code Interactive Box */
.qr-interactive-box {
    background: rgba(10, 25, 47, 0.75);
    border: 1px solid rgba(255, 215, 0, 0.22);
    border-radius: 16px;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 22px;
}

.qr-interactive-box:hover {
    border-color: var(--accent-gold);
    background: rgba(10, 25, 47, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.qr-preview-card {
    background: #ffffff;
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.qr-preview-card svg {
    width: 68px;
    height: 68px;
    display: block;
}

.qr-text-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.qr-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--pure-white);
    display: flex;
    align-items: center;
    gap: 6px;
}

.qr-subtitle {
    font-size: 0.78rem;
    color: var(--slate-muted);
    line-height: 1.35;
}

.qr-badge-click {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-top: 4px;
}

/* Full Portfolio Link Button */
.btn-portfolio-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--pure-white);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition);
}

.btn-portfolio-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: translateY(-2px);
}

/* Footer Copyright */
.card-footer-text {
    margin-top: 24px;
    text-align: center;
    font-size: 0.76rem;
    color: var(--slate-muted);
    z-index: 5;
}

.card-footer-text a {
    color: var(--accent-gold);
    text-decoration: none;
}

.card-footer-text a:hover {
    text-decoration: underline;
}

/* QR Modal Lightbox */
.qr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 25, 47, 0.92);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.qr-modal-overlay.active {
    display: flex;
    animation: modalFade 0.25s ease-out forwards;
}

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

.qr-modal-content {
    background: #112240;
    border: 2px solid var(--accent-gold);
    border-radius: 24px;
    padding: 30px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 50px rgba(255, 215, 0, 0.2);
}

.qr-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qr-modal-close:hover {
    background: var(--accent-gold);
    color: #0a192f;
}

.qr-modal-image-wrap {
    background: #ffffff;
    padding: 16px;
    border-radius: 16px;
    display: inline-block;
    margin: 16px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.qr-modal-image-wrap svg {
    width: 200px;
    height: 200px;
    display: block;
}

.qr-modal-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--pure-white);
    margin-bottom: 6px;
}

.qr-modal-desc {
    font-size: 0.82rem;
    color: var(--slate-muted);
}

/* Toast Message */
.toast-notice {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #112240;
    color: var(--pure-white);
    border: 1px solid var(--accent-gold);
    padding: 12px 22px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.25);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Tweaks */
@media (max-width: 440px) {
    body {
        padding: 14px 10px 30px;
    }
    
    .card-wrapper {
        padding: 24px 16px 28px;
        border-radius: 20px;
    }

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

    .action-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .action-tile {
        padding: 12px 8px;
    }

    .social-circle-btn {
        width: 42px;
        height: 42px;
    }
}
