/**
 * GTH ID CARD PRO - TITAN ELITE v22.0 (FINAL SOURCE)
 * Optimized for: PC, Mobile, & Print Compatibility.
 * Logic: Minimalist Typography + Micro-interactions + Glassmorphism.
 */

@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Color Palette */
    --titan-navy: #0d2d5e;
    --titan-navy-dark: #071a36;
    --titan-gold: #c5a059;
    --titan-gold-light: #dfc18c;
    --titan-white: #ffffff;
    --titan-bg-gray: #f4f7f6;
    --titan-text-dark: #2d3436;
    --titan-text-gray: #636e72;
    
    /* Dimensions */
    --card-width: 380px;
    --card-height: 580px;
    --border-radius: 22px;
}

/* 1. LAYOUT & VIEWPORT LOGIC */
.gth-titan-scope {
    font-family: 'Montserrat', sans-serif;
    background: var(--titan-bg-gray);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 15px;
    box-sizing: border-box;
    width: 100%;
}

#gthIdCard {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    transform-origin: top center;
    transition: transform 0.4s ease;
}

/* 2. CARD MAIN ARCHITECTURE */
.id-card-main {
    width: var(--card-width);
    height: var(--card-height);
    background: var(--titan-white);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 20px 45px rgba(0,0,0,0.12);
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
}

/* 3. FRONT HEADER DESIGN */
.v20-header-shape {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, var(--titan-navy) 0%, var(--titan-navy-dark) 100%);
    clip-path: polygon(0 0, 100% 0, 100% 75%, 0% 100%);
    z-index: 1;
}

.v20-dot-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: radial-gradient(rgba(197, 160, 89, 0.12) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0.5;
    z-index: 2;
    pointer-events: none;
}

.id-header-v20 {
    position: relative;
    z-index: 10;
    padding: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.v20-logo-wrap img, .v20-logo-wrap svg {
    max-width: 95px;
    max-height: 45px;
    object-fit: contain;
}

.v20-badge-tag {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: right;
}

.v20-badge-tag small {
    display: block;
    color: var(--titan-gold-light);
    font-size: 7.5px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.v20-badge-tag strong {
    color: var(--titan-white);
    font-size: 12px;
    font-family: monospace;
}

/* 4. IDENTITY & PROFILE (FINAL STRETCH FIX) */
.id-body-v20 {
    position: relative;
    z-index: 5;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 20px;
    text-align: center;
}

/* Photo Outer Circle - Forced Aspect Ratio */
.v20-photo-wrap {
    width: 145px !important;
    height: 145px !important;
    min-width: 145px !important; /* Prevents shrinking on mobile/print */
    min-height: 145px !important;
    aspect-ratio: 1 / 1 !important; 
    
    background: var(--titan-white);
    padding: 6px;
    border-radius: 50% !important; 
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    margin-bottom: 15px;

    display: flex;
    align-items: center;
    justify-content: center;
    
    box-sizing: border-box; 
    flex-shrink: 0; /* Important: Flex container jeno image-ke chapa na dey */
    transition: 0.3s ease;
}

.v20-photo-wrap:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 35px rgba(0,0,0,0.15);
}

/* Inner Border Ring */
.v20-photo-inner {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    overflow: hidden;
    border: 4px solid var(--titan-navy);
    box-sizing: border-box; 
    display: block;
    position: relative; /* Stability baray */
}

/* Avatar Image - The Ultimate Fix for Stretching */
.v20-avatar {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover !important; /* Cross-browser stretch protection */
    object-position: center center;
    display: block;
    border-radius: 50%; /* Image-keo round kora safety-r jonno */
}
/* Identity Section */
.v20-identity {
    text-align: center;
    padding: 0 30px;   /* Balanced spacing */
    margin-bottom: 15px;
    width: 100%;
}


/* Minimalist Bold Name Style */
.v20-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 23px;
    color: var(--titan-navy);
    margin: 0 0 4px;
    letter-spacing: -0.5px;
    text-transform: capitalize;
}

.v20-role-pill {
    background: var(--titan-gold);
    color: var(--titan-white);
    font-size: 9px;
    font-weight: 800;
    padding: 3px 18px;
    border-radius: 50px;
    text-transform: uppercase;
    display: inline-block;
}

.v20-bio {
    font-size: 10.5px;
    color: var(--titan-text-gray);
    line-height: 1.5;
    margin: 8px 0;
    max-width: 85%;
}

/* 5. DATA SECTION (COMPACT) */
.v20-data-list {
    width: 82%;
    background: #fcfdfe;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    margin-bottom: 15px;
}

.v20-data-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10.5px;
    color: var(--titan-text-dark);
    margin-bottom: 6px;
    font-weight: 600;
}

.v20-data-item i { color: var(--titan-navy); width: 14px; font-size: 11px; }

.v20-contact-row { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.v20-pill { background: var(--titan-navy); color: #fff; font-size: 8px; padding: 3px 10px; border-radius: 5px; font-weight: 600; }

.v20-social-bar { display: flex; gap: 12px; margin-top: 10px; }
.v20-soc-pill { display: flex; align-items: center; gap: 5px; font-size: 8.5px; font-weight: 700; color: var(--titan-navy); }

/* 6. BACK SIDE CONTENT */
.side-back-v20 .v20-watermark {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    opacity: 0.04;
    z-index: 1;
    pointer-events: none;
}

.v20-back-content {
    position: relative;
    z-index: 10;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.v20-terms h5 {
    font-size: 11px;
    color: var(--titan-navy);
    letter-spacing: 2px;
    font-weight: 900;
    margin-bottom: 6px;
}

.v20-divider { width: 50px; height: 3px; background: var(--titan-gold); margin: 0 auto 12px; }
.v20-terms p { font-size: 9.5px; color: var(--titan-text-gray); line-height: 1.6; padding: 0 10px; margin-bottom: 15px; }

/* QR AREA */
.v20-qr-zone { margin: 15px 0; }
.v20-qr-holder { 
    background: #fff; 
    padding: 8px; 
    border-radius: 12px; 
    display: inline-block; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
    border: 1px solid #f0f0f0;
}

.qr-label {
    display: block;
    font-size: 7.5px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-top: 8px;
    color: var(--titan-navy);
}

.v20-official-info-row {
    font-size: 9px;
    color: var(--titan-navy);
    font-weight: 700;
    margin: 12px 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* 7. SIGNATURE SECTION (CALLIGRAPHY) */
.v85-signature-block {
    margin-top: auto;
    padding-bottom: 15px;
}

.v85-sig-render-area { height: 55px; display: flex; align-items: center; justify-content: center; }

/* Calligraphy Font */
.v85-sig-name {
    font-family: 'Great Vibes', cursive;
    font-size: 34px;
    color: var(--titan-navy);
    line-height: 1;
}

.v85-sig-img { max-height: 48px; width: auto; }

.v85-sig-line { width: 140px; height: 1px; background: var(--titan-navy); margin: 5px auto; opacity: 0.2; }
.v85-sig-meta strong { font-size: 10.5px; color: var(--titan-navy); text-transform: uppercase; }
.v85-sig-meta p { font-size: 8px; color: var(--titan-text-gray); font-weight: 700; margin: 0; }

/* 8. FOOTERS */
.v20-footer-bar { background: var(--titan-navy); padding: 10px 15px; }
.v20-footer-content { color: var(--titan-white); font-size: 9px; font-weight: 600; text-transform: uppercase; }

.v20-footer-bar.secondary {
    background: var(--titan-navy-dark);
    height: 28px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v20-copy-text { font-size: 8px; color: rgba(255,255,255,0.8); font-weight: 500; }

/* 9. BUTTONS UI */
.id-export-v20 { margin-top: 30px; display: flex; gap: 15px; }

.titan-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    color: #fff;
    transition: 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.png-btn { background: var(--titan-navy); }
.pdf-btn { background: #d63031; }
.titan-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); opacity: 0.9; }

/* 10. MOBILE AUTO-SCALING ENGINE */
@media screen and (max-width: 480px) {
    #gthIdCard {
        transform: scale(0.85); /* Fits mobile screens */
        margin-top: -30px;
        margin-bottom: -70px;
    }
    
    .id-export-v20 {
        flex-direction: column;
        width: 100%;
        padding: 0 40px;
    }
    
    .titan-btn { width: 100%; justify-content: center; }
}

/* 11. PRINT CONSTRAINTS */
@media print {
    body { background: white !important; }
    .gth-titan-scope { padding: 0; }
    .id-export-v20 { display: none !important; }
    #gthIdCard { transform: scale(1) !important; gap: 0; padding: 0; margin: 0; }
    .id-card-main { box-shadow: none !important; border: 1px solid #ddd !important; page-break-inside: avoid; }
}
/* --- LOGO OPTIMIZATION (SVG & IMG) --- */ .v20-logo-wrap { display: flex; align-items: center; justify-content: flex-start; max-width: 110px; height: 45px; overflow: hidden; } /* Ei filter ta SVG ba PNG ke pura shada (White) kore dibe */ .v20-logo-wrap img, .v20-logo-wrap svg { height: 100%; width: auto; max-height: 45px; object-fit: contain; /* Brightness ebong Invert diye SVG ke shada kora hoyeche */ filter: brightness(0) invert(1); display: block; }

/* Jodi logo-te shada text thake (PHP fallback) */
.v20-logo-text {
    color: #ffffff;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Badge area thik rakhar jonno extra padding */
.id-header-v20 {
    position: relative;
    z-index: 10;
    padding: 22px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}
/* QR Zone ektu compact kora hoyeche */
.v20-qr-zone { 
    margin: 10px 0; /* Margin komano hoyeche */
}

.v20-qr-holder { 
    background: #fff; 
    padding: 6px; /* Padding komano hoyeche */
    border-radius: 10px; 
    display: inline-block; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    border: 1px solid #f0f0f0;
    line-height: 0; /* Extra space remove korbe */
}

/* QR image size control */
.gth-qr-render img {
    width: 80px !important; /* Ekane size control kora hoyeche */
    height: 80px !important;
}