/**
 * Premium Styling for CTEG Member Card - Visual-mockup Layout
 * Features: Dark background image, golden avatar ring, labeled image grid, nested accordions with left icons, and edge-to-edge content.
 */

.cteg-bio-card-wrapper {
    box-sizing: border-box;
    width: 100%;
    max-width: 410px;
    margin: 0 auto;
    font-family: var(--cteg-font-family), 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--cteg-bottom-text, #111111);
    background-color: var(--cteg-bottom-bg, #0a1c33);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.cteg-bio-card-wrapper * {
    box-sizing: border-box;
    font-family: inherit;
}

/* Inner Frame */
.cteg-card-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   TOP SECTION - CONFIGURED TRANSLUCENCY OVERLAY
   ========================================== */
.cteg-card-top-section {
    position: relative;
    padding: 20px 14px 4px 14px;
    /* Soft translucent gradient to let the background image shine through clearly, using backend values */
    background: linear-gradient(
        var(--cteg-grad-angle, 135deg), 
        rgba(var(--cteg-grad-start-rgb, 10, 28, 51), var(--cteg-top-opacity, 0.7)) var(--cteg-grad-start-loc, 0%), 
        rgba(var(--cteg-grad-end-rgb, 2, 13, 28), var(--cteg-top-opacity, 0.85)) var(--cteg-grad-end-loc, 100%)
    );
    color: var(--cteg-top-text, #ffffff);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    width: 100%;
}

/* Header Bar */
.cteg-card-header-bar {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    z-index: 5;
}

.cteg-header-left {
    display: flex;
    width: 100%;
    justify-content: var(--cteg-logo-align, flex-start);
    padding-right: 32px;
    min-height: 24px;
}

.cteg-header-logo img {
    max-height: var(--cteg-logo-height, 32px);
    height: var(--cteg-logo-height, 32px);
    width: auto;
    display: block;
    object-fit: contain;
}

/* Options / Share trigger */
.cteg-header-right {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    padding: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    z-index: 10;
}

.cteg-header-right svg {
    width: 14px;
    height: 14px;
}

.cteg-header-right:hover {
    color: var(--cteg-accent, #d4af37);
    background: rgba(255, 255, 255, 0.15);
}

/* Share dropdown */
.cteg-share-dropdown {
    display: none;
    position: absolute;
    top: 28px;
    right: 0;
    background: #0d1e36;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    width: 140px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    z-index: 100;
    overflow: hidden;
}

.cteg-share-dropdown a {
    display: block;
    padding: 8px 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 500;
    transition: background 0.2s;
    text-align: left;
}

.cteg-share-dropdown a:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--cteg-accent, #d4af37);
}

.cteg-header-right.active .cteg-share-dropdown {
    display: block;
}

/* Avatar Ring & Verified Badge */
.cteg-avatar-outer-container {
    position: relative;
    margin-top: 0px;
    margin-bottom: 8px;
    z-index: 5;
}

.cteg-avatar-ring {
    position: relative;
    width: var(--cteg-avatar-size, 124px);
    height: var(--cteg-avatar-size, 124px);
    border-radius: 50%;
    border: 2px solid var(--cteg-accent, #d4af37);
    padding: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cteg-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    border: none;
}

.cteg-verified-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cteg-accent, #d4af37);
    border: 2px solid rgba(var(--cteg-grad-start-rgb, 10, 28, 51), 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.cteg-verified-badge svg {
    width: 9px;
    height: 9px;
}

/* Name & Titles */
.cteg-profile-names {
    text-align: center;
    margin-bottom: 6px;
    z-index: 5;
}

.cteg-member-fullname {
    font-weight: 700;
    font-size: 22px;
    color: var(--cteg-accent, #d4af37);
    margin: 0 0 4px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cteg-member-role-title {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: var(--cteg-top-text, #ffffff);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.cteg-member-company-name {
    font-size: var(--cteg-company-size, 10px);
    font-weight: var(--cteg-company-weight, 500);
    letter-spacing: 0.3px;
    color: var(--cteg-company-color, rgba(255, 255, 255, 0.85));
    text-transform: uppercase;
}

/* ==========================================
   3 HORIZONTAL GRID IMAGES WITH LABELS
   ========================================== */
.cteg-horizontal-grid-images {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
    margin-bottom: 8px;
    justify-content: center;
    z-index: 5;
}

.cteg-grid-img-item {
    position: relative;
    flex: 1;
    height: 85px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.cteg-grid-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cteg-grid-img-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 64, 128, 0.85);
    padding: 3px 2px;
    text-align: center;
    z-index: 2;
}

.cteg-grid-img-label span {
    font-size: 7px;
    font-weight: 700;
    color: #ffffff;
    display: block;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

/* Quote Section */
.cteg-quote-container {
    position: relative;
    padding: 0 16px;
    text-align: center;
    margin-bottom: 6px;
    z-index: 5;
    max-width: 330px;
}

.cteg-quote-symbol {
    font-family: serif;
    font-size: 22px;
    color: var(--cteg-accent, #d4af37);
    position: absolute;
    line-height: 1;
    user-select: none;
    opacity: 0.35;
}

.cteg-quote-symbol.open-quote {
    top: -4px;
    left: 2px;
}

.cteg-quote-symbol.close-quote {
    bottom: -15px;
    right: 2px;
}

.cteg-quote-text {
    font-size: 10px;
    font-style: italic;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
}

/* Stats Row Card */
.cteg-stats-grid-container {
    display: flex;
    width: 100%;
    background: rgba(var(--cteg-grad-start-rgb, 10, 28, 51), 0.65);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 8px 2px;
    margin-top: 6px;
    margin-bottom: 4px;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cteg-stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0 1px;
}

.cteg-stat-item:last-child {
    border-right: none;
}

.cteg-stat-icon {
    color: var(--cteg-accent, #d4af37);
    display: inline-flex;
    margin-bottom: 2px;
}

.cteg-stat-icon svg {
    width: 13px;
    height: 13px;
}

.cteg-stat-value {
    font-weight: 700;
    font-size: var(--cteg-stat-val-size, 12px); /* Customizable from backend */
    color: var(--cteg-top-text, #ffffff);
    margin-bottom: 0px;
}

.cteg-stat-label {
    font-size: var(--cteg-stat-lbl-size, 7.5px); /* Customizable from backend */
    color: var(--cteg-stat-lbl-color, rgba(255, 255, 255, 0.6));
    font-weight: 500;
    line-height: 1.1;
}

/* ==========================================
   BOTTOM SECTION - FULL-WIDTH CONTAINER
   ========================================== */
.cteg-card-bottom-section {
    background-color: transparent;
    padding: 0;
    width: 100%;
}

.cteg-bottom-white-container {
    background: rgba(255, 255, 255, var(--cteg-bottom-opacity, 0.95));
    border-radius: 0 0 24px 24px;
    padding: 18px 16px;
    margin: 0;
    width: 100%;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

/* ==========================================
   NESTED ACCORDIONS SYSTEM (PREMIUM & SMALLER)
   ========================================== */
.cteg-accordion-item {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: none;
    background: transparent;
    box-shadow: none;
}

/* Accordion button headers (Premium height 38px, smaller paddings) */
.cteg-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    background-color: var(--cteg-btn-bg, #004080);
    color: var(--cteg-btn-text, #ffffff);
    border: 1px solid rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.4px;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.cteg-accordion-header:hover {
    filter: brightness(1.12);
    transform: translateY(-0.5px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.cteg-header-left-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cteg-header-icon {
    display: inline-flex;
    align-items: center;
}

.cteg-header-icon svg {
    width: 15px;
    height: 15px;
}

.cteg-accordion-arrow {
    display: inline-flex;
    color: inherit;
}

.cteg-accordion-arrow svg {
    width: 12px;
    height: 12px;
    transition: transform 0.25s ease;
}

.cteg-accordion-item.active .cteg-accordion-arrow svg {
    transform: rotate(90deg);
}

.cteg-accordion-content {
    display: none;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
    margin-top: -3px;
    border: 1px solid #eeeeee;
    border-top: none;
}

.cteg-accordion-item.active .cteg-accordion-content {
    display: block;
}

.cteg-accordion-body {
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.45;
    color: #333333;
    text-align: justify;
}

.cteg-accordion-body p {
    margin-top: 0;
    margin-bottom: 8px;
}

.cteg-accordion-body p:last-child {
    margin-bottom: 0;
}

.cteg-accordion-body ul, .cteg-accordion-body ol {
    margin-top: 0;
    margin-bottom: 8px;
    padding-left: 20px;
}

/* White style for Lưu Danh Bạ button - customizable color from backend */
.cteg-btn-white-style {
    background-color: var(--cteg-vcard-bg, #ffffff) !important;
    color: var(--cteg-vcard-text, #004080) !important;
    border: 1px solid var(--cteg-vcard-border, #004080) !important;
    text-decoration: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.cteg-btn-white-style:hover {
    filter: brightness(0.96) !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08) !important;
}

/* ==========================================
   SOCIALS CONTAINER INSIDE ACCORDION
   ========================================== */
.cteg-social-icons-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 12px 4px;
    background: #ffffff;
    border-radius: 0 0 8px 8px;
}

.cteg-social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    flex: 0 1 calc(20% - 8px);
    text-align: center;
}

.cteg-social-circle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--cteg-icon-bg, #004080);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.25s ease;
    border: none;
}

.cteg-social-circle-btn svg {
    width: 24px;
    height: 24px;
}

.cteg-social-circle-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.cteg-social-circle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.12);
    filter: brightness(1.1);
}

.cteg-social-label {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 500;
    color: #555555;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.1;
}

/* ==========================================
   COMMUNITY CONNECTION SECTION
   ========================================== */
.cteg-community-logos-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    background: #ffffff;
    border-radius: 0 0 8px 8px;
}

.cteg-community-logo-item {
    width: calc(20% - 8px); /* 5 in a row */
    min-width: 45px;
    max-width: 60px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cteg-community-logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==========================================
   SHARE OVERLAY MODAL (QR CODE)
   ========================================== */
.cteg-share-overlay-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 21, 38, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: cteg-fade-in 0.3s ease;
}

.cteg-modal-content {
    background: #0d1e36;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    width: 100%;
    max-width: 270px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    position: relative;
}

.cteg-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-weight: bold;
    transition: color 0.2s;
}

.cteg-modal-close:hover {
    color: var(--cteg-accent, #d4af37);
}

.cteg-modal-content h3 {
    font-size: 14px;
    color: var(--cteg-accent, #d4af37);
    margin-top: 0;
    margin-bottom: 12px;
}

.cteg-qr-code-placeholder {
    background: #ffffff;
    padding: 10px;
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.cteg-qr-code-placeholder img {
    display: block;
    max-width: 100%;
    height: auto;
}

.cteg-qr-instruction {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.4;
}

/* Animations */
@keyframes cteg-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes cteg-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
