/**
 * AIF Frontend Profile - Public profile styles
 */

.aif-profile-main {
    padding: 30px 20px 60px;
    background: #f7f9fc;
    min-height: 60vh;
}

.aif-profile-container {
    max-width: 1100px;
    margin: 0 auto;
}

.aif-profile {
    background: transparent;
    color: #2c3e50;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.aif-profile-shortcode {
    margin: 30px 0;
}

/* ====== HERO ====== */
.aif-profile-hero {
    background: linear-gradient(135deg, #1a2a4a 0%, #2d5a8e 100%);
    color: #fff;
    border-radius: 16px;
    padding: 40px 40px;
    margin-bottom: 24px;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}
.aif-profile-hero::before {
    content: "";
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
}
.aif-profile-hero-inner {
    display: flex;
    gap: 32px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.aif-profile-logo-wrap {
    flex-shrink: 0;
    width: 160px;
    height: 160px;
    background: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: none;
    padding: 10px;
}
.aif-profile-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}
.aif-profile-logo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f4fb 0%, #d6e4f4 100%);
    color: #2d5a8e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2em;
    font-weight: 700;
    border-radius: 8px;
}
.aif-profile-logo-pdf,
.aif-profile-logo-pdf-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #2d5a8e;
    text-align: center;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    transition: background 0.15s;
    position: relative;
}
.aif-profile-logo-pdf:hover,
.aif-profile-logo-pdf-link:hover {
    background: #f0f4fb;
}
.aif-profile-logo-pdf-icon {
    font-size: 3em;
    line-height: 1;
    margin-bottom: 6px;
}
.aif-profile-logo-pdf-text {
    font-size: 0.78em;
    font-weight: 600;
    padding: 0 8px;
}
.aif-profile-logo-pdf-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

.aif-profile-headline {
    flex: 1;
    min-width: 0;
}
.aif-profile-name {
    margin: 0 0 8px;
    font-size: 2.2em;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    word-wrap: break-word;
}
.aif-profile-city {
    margin: 0 0 14px;
    font-size: 1.05em;
    opacity: 0.9;
}
.aif-profile-role-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.aif-role-main      { background: rgba(220, 53, 69, 0.85); }
.aif-role-network   { background: rgba(25, 135, 84, 0.85); }
.aif-role-vescom    { background: rgba(243, 156, 18, 0.85); }
.aif-role-thematic  { background: rgba(142, 68, 173, 0.85); }
.aif-role-studio    { background: rgba(13, 110, 253, 0.85); }

/* ====== SECTIONS ====== */
.aif-profile-section {
    background: #fff;
    border-radius: 12px;
    padding: 26px 32px;
    margin-bottom: 18px;
    box-shadow: none;
    border: 1px solid #e3e9f1;
}
.aif-profile-section-title {
    margin: 0 0 18px;
    color: #1a2a4a;
    font-size: 1.15em;
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 2px solid #eef2f7;
}

/* ====== CONTACT ====== */
.aif-profile-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}
.aif-profile-contact-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.aif-profile-contact-icon {
    font-size: 1.5em;
    flex-shrink: 0;
    line-height: 1;
}
.aif-profile-contact-label {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 3px;
}
.aif-profile-contact-item a {
    color: #2d5a8e;
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}
.aif-profile-contact-item a:hover {
    text-decoration: underline;
}

/* ====== ABOUT ====== */
.aif-profile-bio {
    font-size: 1em;
    line-height: 1.7;
    color: #34495e;
}
.aif-profile-bio p {
    margin: 0 0 14px;
}
.aif-profile-bio p:last-child {
    margin-bottom: 0;
}

/* ====== REPRESENTATIVES ====== */
.aif-profile-reps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}
.aif-profile-rep {
    background: #f7f9fc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e3e9f1;
    transition: transform 0.15s ease;
}
.aif-profile-rep:hover {
    transform: translateY(-3px);
    box-shadow: none;
}
.aif-profile-rep-photo {
    width: 120px;
    height: 120px;
    margin: 0 auto 14px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
    border: 3px solid #fff;
}
.aif-profile-rep-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.aif-profile-rep-photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2d5a8e 0%, #1a2a4a 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: 700;
}
.aif-profile-rep-name {
    margin: 0 0 4px;
    font-size: 1.1em;
    color: #1a2a4a;
    font-weight: 700;
}
.aif-profile-rep-job {
    margin: 0;
    color: #6a7589;
    font-size: 0.9em;
    font-style: italic;
}

/* ====== SOCIAL LINKS ====== */
.aif-profile-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.aif-profile-social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f7f9fc;
    color: #2d5a8e;
    padding: 9px 16px;
    border-radius: 22px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88em;
    border: 1px solid #d6deeb;
    transition: all 0.15s ease;
}
.aif-profile-social-link:hover {
    background: #2d5a8e;
    color: #fff;
    border-color: #2d5a8e;
    text-decoration: none;
    transform: translateY(-1px);
}
.aif-profile-social-icon {
    font-size: 1.05em;
    line-height: 1;
}

/* ====== ERROR ====== */
.aif-profile-error {
    background: #fff5f5;
    border: 2px solid #f5c2c7;
    color: #b32d2e;
    padding: 18px 22px;
    border-radius: 8px;
    text-align: center;
    margin: 20px auto;
    max-width: 600px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 700px) {
    .aif-profile-hero {
        padding: 24px 22px;
    }
    .aif-profile-hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .aif-profile-logo-wrap {
        width: 120px;
        height: 120px;
    }
    .aif-profile-name {
        font-size: 1.6em;
    }
    .aif-profile-section {
        padding: 20px 22px;
    }
    .aif-profile-contact-grid,
    .aif-profile-reps-grid {
        grid-template-columns: 1fr;
    }
    .aif-profile-rep-photo {
        width: 100px;
        height: 100px;
    }
}

/* v2.3.5: pulsante "Visita il sito" sotto la bio */
.aif-profile-website-btn-wrap {
    text-align: center;
    margin-top: 20px;
}
.aif-profile-website-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #2d5a8e 0%, #1a4173 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1em;
    box-shadow: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.aif-profile-website-btn:hover,
.aif-profile-website-btn:focus {
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: none;
}

/* ======================================================================== */
/* v2.3.6 — PDF.js logo renderer                                              */
/* ======================================================================== */

/* Container che riceverà il canvas PDF renderizzato */
.aif-profile-logo-pdfjs {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 160px;
    background: #f7f9fc;
    border: 1px solid #e3e9f1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.15s;
}
.aif-profile-logo-pdfjs:hover {
    box-shadow: none;
}
/* Placeholder durante il caricamento */
.aif-profile-logo-pdfjs-loading {
    font-size: 2.4em;
    font-weight: 700;
    color: #b0bccf;
    letter-spacing: 2px;
    animation: aif-pulse 1.4s ease-in-out infinite;
}
@keyframes aif-pulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1;    }
}
/* Canvas renderizzato */
.aif-profile-logo-pdfjs-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    background: #fff;
}
/* Quando il rendering è completo, rimuovi il background di caricamento */
.aif-profile-logo-pdfjs.is-rendered {
    background: #fff;
}
/* Se PDF.js fallisce, il fallback resta con placeholder standard */
.aif-profile-logo-pdfjs.is-fallback {
    background: #f0f2f7;
}
.aif-profile-logo-pdfjs-fallback {
    width: 100%;
    height: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    color: #6a7589;
    font-weight: 700;
    font-size: 2em;
    border-radius: 0;
}
