/* --- vcard.css --- */

/* 1. CSS Variables */
:root {
    --primary-bg: #f4f4f4;
    --secondary-bg: #ffffff;
    --text-color: #333333;
    --label-color: #555555;
    --input-bg: #fcfcfc;
    --input-border: #d4d4d4;
    --input-text: #333333;
    --input-readonly-bg: #e9e9e9;
    --input-readonly-text: #666666;
    --input-focus-border: #007bff;
    --input-focus-shadow: rgba(0, 123, 255, 0.25);
    --button-bg: #007bff;
    --button-hover-bg: #0056b3;
    --button-active-bg: #004085;
    --border-color: #eeeeee;
    --form-separator-border: #dddddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --highlight-color: #0066cc;
    --link-color: #0073e6;
}

/* 2. Global Styling */
html, body {
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden;
}

body {
    font-family: 'Heebo', Arial, sans-serif;
    background-color: var(--primary-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: var(--text-color);
}

/* 3. Main Container - FIXED SCROLLING ISSUE HERE */
.container {
    display: flex;
    flex-wrap: wrap;
    width: 90%;
    max-width: 1200px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--secondary-bg);
    box-shadow: 0 4px 15px var(--shadow-color);
    margin: 50px auto;
    
    /* CHANGED: overflow: visible allows the content to expand and body to scroll */
    overflow: visible; 
    height: auto; 
}

/* Stats Header */
.badge-stats-section {
    width: 100%;
    padding: 20px 30px;
    border-bottom: 1px solid var(--form-separator-border);
    text-align: center;
    background-color: #fcfcfc;
}
.badge-stats-section strong { color: var(--highlight-color); }
.custom-button {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 15px;
    background-color: var(--button-bg);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}
.custom-button:hover { background-color: var(--button-hover-bg); }

/* Layout Columns */
.form-container, .qr-container {
    padding: 30px;
    flex: 1 1 50%;
    box-sizing: border-box;
}
.form-container {
    border-right: 1px solid var(--form-separator-border);
    min-width: 320px;
}
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 500px;
}

/* 4. Form Elements */
label {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
    color: var(--label-color);
    font-size: 14px;
}
label::after { content: ' *'; color: red; }
label[for="linkedin"]::after, label[for="photo"]::after { content: ''; }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"],
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-size: 16px;
    color: var(--input-text);
    background-color: var(--input-bg);
    box-sizing: border-box;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    border-color: var(--input-focus-border);
    outline: none;
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background-color: var(--input-bg);
    cursor: pointer;
}

/* Submit Button */
button[type="submit"] {
    width: 100%;
    padding: 14px;
    background-color: var(--button-bg);
    color: white;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 20px; /* Added margin to ensure it's not flush with bottom */
}
button[type="submit"]:hover { background-color: var(--button-hover-bg); }
button[type="submit"]:disabled { background-color: #ccc; cursor: not-allowed; }

/* 5. Live Preview Area */
#badge-display {
    width: 100%;
    display: flex;
    justify-content: center;
}

.badge {
    text-align: center;
    width: 300px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    background-color: var(--secondary-bg);
    box-shadow: 0 4px 12px var(--shadow-color);
    position: relative;
    transition: background-color 0.3s, color 0.3s, border-top 0.3s;
}

.badge-logo-corner {
    width: 80px;
    height: auto;
    position: absolute;
    top: 15px;
    right: 15px;
}

.profile-image {
    width: 150px;
    height: 150px;
    margin: 10px auto;
    display: block;
    border-radius: 0; 
    object-fit: cover;
}

.qr-code {
    width: 200px !important;
    height: auto !important;
    display: block;
    margin: 10px auto;
}

.name {
    font-size: 22px;
    font-weight: bold;
    color: var(--highlight-color);
    margin: 15px 0 5px 0;
}
.title {
    font-size: 16px;
    color: var(--label-color);
    margin-bottom: 10px;
}

.badge-info-details {
    margin-top: 20px;
    text-align: left;
    width: 100%;
    max-width: 300px;
    font-size: 0.95em;
    color: var(--label-color);
}
.badge-info-details p { margin: 8px 0; word-break: break-all; }
.badge-info-details b { color: var(--text-color); }
.badge-info-details a { color: var(--link-color); text-decoration: none; }

@media (max-width: 900px) {
    .container { flex-direction: column; }
    .form-container { border-right: none; border-bottom: 1px solid var(--form-separator-border); }
}

/* --- intl-tel-input Overrides --- */
.iti {
    width: 100%;
    margin-bottom: 20px; /* Match your existing input margin */
}

/* Fix padding so text doesn't overlap the flag */
.iti__flag-container {
    border-radius: 4px 0 0 4px;
}

/* Ensure the input inside the container looks like your other inputs */
.iti input {
    margin-bottom: 0 !important; /* The container handles the margin now */
    border-radius: 4px;
}

/* Styling for the dynamically loaded footer content */
#footer-placeholder {
    /* 1. Force Full Width (Break out of body padding) */
    width: calc(100% + 40px); /* 100% width + the 20px left/right body padding */
    margin-left: -20px;       /* Pull left to edge */
    margin-right: -20px;      /* Pull right to edge */
    
    /* 2. Perfect Centering */
    display: flex;
    flex-direction: column;   /* Stack text lines vertically */
    justify-content: center;  /* Center vertically */
    align-items: center;      /* Center horizontally */
    text-align: center;       /* Ensure text text is centered */
    
    /* 3. Sticky Bottom Behavior */
    margin-top: auto;         /* Pushes footer to the bottom of the flex container */
    
    /* 4. Visual Styling */
    padding: 20px;
    background-color: var(--secondary-bg);
    color: var(--label-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* Ensure content inside doesn't align left by accident */
#footer-placeholder > * {
    max-width: 1200px;        /* Keep text readable on huge screens */
    width: 100%;
    margin: 0 auto;
}