/* ===================================================================
   DIGITAL VCARD - CLEANED & OPTIMIZED STYLES
   Last Optimized: 2026-01-23
   =================================================================== */

/* =================================================================== 
   BASE & RESET
   =================================================================== */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    position: relative !important;
}

html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Base & Reset Key Definitions */
/* Old mobile fixes removed to prevent conflict with new refined block at bottom */

.digital-vcard-tool *,
.digital-vcard-tool *::before,
.digital-vcard-tool *::after {
    box-sizing: border-box !important;
}

/* =================================================================== 
   MAIN LAYOUT
   =================================================================== */
.vcard-app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    overflow-x: hidden !important;
}

.app-section {
    margin-bottom: 60px;
    overflow-x: hidden !important;
    max-width: 100% !important;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.section-divider {
    margin: 50px 0;
    border: none;
    border-top: 2px solid #e0e0e0;
}

/* =================================================================== 
   SPLIT LAYOUT (PREVIEW + FORM)
   =================================================================== */
.wizard-split-layout {
    display: flex;
    flex-direction: row-reverse;
    gap: 40px;
    align-items: flex-start;
}

/* Mobile: Remove all padding and gaps */
@media (max-width: 768px) {
    .vcard-app-container {
        padding: 0 !important;
    }

    .wizard-split-layout {
        gap: 20px !important;
        padding: 0 !important;
    }

    .app-section {
        padding: 0 10px !important;
    }
}

.wizard-form-column {
    flex: 1;
    min-width: 0;
}

.wizard-preview-column {
    flex: 0 0 320px;
    position: sticky;
    top: 20px;
}

/* =================================================================== 
   DEVICE MOCKUP
   =================================================================== */
.device-mockup {
    position: relative;
    width: 280px;
    height: 560px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-frame {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 10;
    pointer-events: none;
}

.device-screen {
    position: absolute;
    width: 96%;
    left: 2%;
    height: 97.5%;
    top: 1.25%;
    border-radius: 40px;
    background: white;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

/* =================================================================== 
   TEMPLATE 1 DESIGN
   =================================================================== */
.mockup-t1.card {
    background: white;
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: 100%;
    border-radius: 40px 40px 0 0;
    overflow: hidden;
    box-shadow: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
}

/* Header Section */
.mockup-t1 .mockup-header.header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    padding: 5px 0px 60px;
    text-align: center;
    position: relative;
    width: 100%;
    border-radius: 40px 40px 0 0;
    margin: 0;
}

/* Avatar */
.mockup-t1 .mockup-avatar.profile-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.mockup-t1 .mockup-avatar.profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Name & Title */
.mockup-t1 .mockup-name.name {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.mockup-t1 .mockup-title.position {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin-bottom: 20px;
}

/* Action Buttons */
.mockup-t1 .mockup-actions.buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    padding: 0 5px;
    width: 100%;
}

.mockup-t1 .mockup-actions .btn {
    background: rgba(255, 255, 255, 0.95);
    color: #2563eb;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 6px 4px;
    font-size: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    white-space: nowrap;
}

.mockup-t1 .mockup-actions .btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mockup-t1 .mockup-actions .btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mockup-t1 .mockup-actions .btn[style*="display: none"],
.mockup-t1 .mockup-actions .btn[style*="display:none"] {
    display: none !important;
}

/* Body Section */
.mockup-t1 .mockup-body.content {
    padding: 5px 5px;
    background: white;
}

.mockup-t1 .mockup-bio-section {
    margin-bottom: 20px;
}

.mockup-t1 .mockup-bio {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

/* Contact List */
.mockup-t1 .contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mockup-t1 .contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mockup-t1 .contact-icon {
    font-size: 20px;
    min-width: 24px;
    text-align: center;
}

.mockup-t1 .contact-info-text {
    flex: 1;
}

.mockup-t1 .contact-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 2px;
}

.mockup-t1 .contact-value {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

/* Social Media Row */
.mockup-t1 .mockup-social-rows {
    margin-top: 20px;
    justify-content: center;
}

/* Save Button */
#btn-save-contact-mockup {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
    width: 40px;
    height: 40px;
    padding: 0;
    gap: 0;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

#btn-save-contact-mockup:hover {
    opacity: 1;
    transform: translateX(-50%);
    width: auto;
    padding: 8px 16px;
    gap: 8px;
}

#btn-save-contact-mockup span {
    margin: 0;
    padding: 0;
}

#btn-save-contact-mockup span:first-child {
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#btn-save-contact-mockup span:last-child {
    opacity: 0;
    max-width: 0;
    transition: all 0.3s ease;
}

#btn-save-contact-mockup:hover span:first-child {
    margin-left: 0;
}

#btn-save-contact-mockup:hover span:last-child {
    opacity: 1;
    max-width: 200px;
    margin-right: 8px;
}

#btn-save-contact-mockup[style*="display: none"],
#btn-save-contact-mockup[style*="display:none"] {
    display: none !important;
}

#btn-save-contact-mockup[style*="display: flex"],
#btn-save-contact-mockup[style*="display:flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* =================================================================== 
   FORM INPUTS
   =================================================================== */
.vcard-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    transition: border-color 0.3s;
}

.vcard-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    right: 15px;
    color: #999;
}

/* Photo Upload */
.modern-upload-box {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
    position: relative;
}

.modern-upload-box:hover {
    border-color: #3b82f6;
    background: #f0f7ff;
}

.modern-upload-box input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 48px;
    color: #3b82f6;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 14px;
    color: #666;
}

/* Social Media Selector */
.social-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    justify-content: flex-start;
    align-items: center;
}

.social-selector .btn {
    flex: 0 0 auto;
    margin: 0;
}

/* =================================================================== 
   QR CODE SECTION
   =================================================================== */
#qr-canvas-placeholder {
    width: 100%;
    max-width: 100%;
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

#qr-canvas-placeholder canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.color-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.color-option.active {
    border-color: #3b82f6;
    transform: scale(1.1);
}

.qr-shape-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
}

.qr-shape-btn.active {
    border-color: #3b82f6;
    background: #f0f7ff;
}

/* =================================================================== 
   MOBILE RESPONSIVENESS
   =================================================================== */
@media screen and (max-width: 768px) {
    .wizard-split-layout {
        flex-direction: column;
    }

    .wizard-form-column,
    .wizard-preview-column {
        width: 100%;
        flex: none;
        position: static;
    }

    .wizard-preview-column {
        order: 2;
        margin-top: 30px;
    }

    .device-mockup {
        width: 250px;
        height: 500px;
    }
}

/* =================================================================== 
   MISSING UTILITY CLASSES (USED IN HTML)
   =================================================================== */

/* Bootstrap Grid Classes Used */
/* Bootstrap Grid Fixes & Mobile Overrides */
/* Ensuring proper grid behavior if Bootstrap is missing or partial */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
}

.col-12,
.col-md-6 {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* MOBILE FIX - FINAL REFINED (AUTHENTIC SPACING & SCALING) */
@media (max-width: 768px) {

    /* Main Wrapper Reset */
    .digital-vcard-tool-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }

    body,
    html {
        overflow-x: hidden !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Restore Authentic Bootstrap Spacing */
    .col-12,
    [class*="col-"] {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .row {
        margin-left: -6px !important;
        margin-right: -6px !important;
        width: auto !important;
    }

    /* Child Containers */
    .vcard-app-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* QR Section - TRANSFORM FIX */
    .qr-section-container {
        padding: 1rem 0 !important;
        margin: 0 !important;
        width: 100% !important;
        overflow: visible !important;
    }

    #qr-canvas-placeholder {
        margin: 0 auto !important;
        padding: 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        overflow: visible !important;
    }

    /* Use Transform Scale for Perfect Fit */
    #qr-canvas-placeholder canvas,
    #qr-canvas-placeholder svg,
    #qr-canvas-placeholder img {
        max-width: 95% !important;
        width: auto !important;
        height: auto !important;
        transform: scale(0.95);
        transform-origin: center center;
        box-shadow: none !important;
    }
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Text Utilities */
.text-center {
    text-align: center !important;
}

.text-md-end {
    text-align: left;
}

@media (min-width: 768px) {
    .text-md-end {
        text-align: right;
    }
}

.text-md-start {
    text-align: right;
}

@media (min-width: 768px) {
    .text-md-start {
        text-align: left;
    }
}

.text-muted {
    color: #6c757d !important;
}

.text-dark {
    color: #212529 !important;
}

/* Sizing Utilities */
.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 0.75rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

/* Flex Utilities */
.d-flex {
    display: flex !important;
}

.d-block {
    display: block !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.vstack {
    display: flex;
    flex-direction: column;
}

/* Form Utilities */
.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-control-lg {
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
}

/* Button Base */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-outline-light {
    background: white;
    border-color: #dee2e6;
}

.btn-outline-light:hover {
    background: #f8f9fa;
}

.btn-outline-dark {
    color: #212529;
    border-color: #212529;
}

.btn-outline-dark:hover {
    background: #212529;
    color: white;
}

/* Shadow Utilities */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.border {
    border: 1px solid #dee2e6 !important;
}

/* Typography */
.small {
    font-size: 0.875rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
}

.display-5 {
    font-size: calc(1.425rem + 2.1vw);
    font-weight: 300;
    line-height: 1.2;
}

.fw-bold {
    font-weight: 700 !important;
}

/* Container */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Social Add Button Specific */
.social-add-btn {
    flex-shrink: 0;
}

/* Preview Card */
.preview-card-mockup {
    position: relative;
}

/* Device Mockup Small Scale Class */
.device-mockup.small-scale {
    width: 280px;
    height: 560px;
}

.device-mockup.small-scale .device-screen {
    border-radius: 40px;
}