:root {
    --primary-color: #D4AF37;
    /* Gold */
    --primary-dark: #B5952F;
    --secondary-color: #2C3E50;
    /* Navy */
    --text-dark: #1A1A1A;
    --text-light: #666666;
    --bg-light: #F9F9F9;
    --bg-white: #FFFFFF;
    --accent-pink: #FFF0F5;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --font-devanagari: 'Noto Sans Devanagari', sans-serif;
    --font-gujarati: 'Noto Sans Gujarati', sans-serif;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 30px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Language-specific fonts */
html[lang="hi"],
html[lang="mr"] {
    font-family: var(--font-devanagari);
}

html[lang="gu"] {
    font-family: var(--font-gujarati);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.glass-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 120px;
    width: auto;
    object-fit: contain;
}

.logo .dot {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-dark);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.language-selector select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    background-color: white;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23D4AF37' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2.5rem;
}

.language-selector select:hover {
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.language-selector select:focus {
    outline: none;
    border-color: var(--primary-dark);
}

/* Language Dropdown (for header pages) */
.language-dropdown {
    padding: 0.6rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    background-color: white;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23D4AF37' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    font-family: var(--font-body);
}

.language-dropdown:hover {
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.language-dropdown:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

/* Buttons */
.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    color: var(--secondary-color);
    background: transparent;
}

.btn-secondary:hover {
    color: var(--primary-color);
}

.btn-outline {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: white;
}

.btn-lg {
    padding: 1rem 2.2rem;
    font-size: 1.1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    padding-top: 140px;
    padding-bottom: 80px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.hero-text .highlight {
    color: var(--primary-color);
    font-style: italic;
    position: relative;
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.trust-badges {
    display: flex;
    gap: 1.5rem;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
}

.trust-badges i {
    color: var(--primary-color);
    margin-right: 0.4rem;
}

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 500px;
    border-radius: var(--radius-lg);
    background: url('assets/hero-image.png') center/cover no-repeat;
    box-shadow: var(--shadow-lg);
}

.floating-card {
    position: absolute;
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: float 6s ease-in-out infinite;
}

.c1 {
    top: 10%;
    left: -30px;
    animation-delay: 0s;
}

.c2 {
    bottom: 15%;
    right: -20px;
    animation-delay: 2s;
}

.floating-card .icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-pink);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-card .text {
    font-weight: 600;
    color: var(--secondary-color);
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Features Section */
.features-section {
    padding: 100px 0;
    background: white;
}

.text-center {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header .overline {
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.feature-card {
    background: var(--bg-light);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.feature-card:hover {
    background: white;
    box-shadow: var(--shadow-md);
    border-color: rgba(212, 175, 55, 0.2);
    transform: translateY(-5px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.feature-card p {
    color: var(--text-light);
}

/* Design Elements */
.hero-bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
}

.b1 {
    width: 400px;
    height: 400px;
    background: #FFE4B5;
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.b2 {
    width: 300px;
    height: 300px;
    background: #E6E6FA;
    bottom: -50px;
    left: -50px;
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text p {
        margin: 0 auto 2.5rem;
    }

    .hero-cta {
        justify-content: center;
    }

    .trust-badges {
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .nav-links {
        display: none;
    }

    .header-actions {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .header-actions .language-dropdown {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        padding-right: 1.8rem;
        background-position: right 0.4rem center;
    }

    .header-actions .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero-text h1 {
        font-size: 2.8rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .templates-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Templates Section */
.templates-section {
    padding: 100px 0;
    background: var(--accent-pink);
    position: relative;
    overflow: hidden;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.template-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
    cursor: pointer;
}

.template-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.template-preview {
    background-color: #fff0f5;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4/5;
}

.template-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
    object-fit: contain;
}

.template-card:hover .template-image {
    transform: scale(1.05);
}

.template-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: top center;
    transition: transform 0.5s ease;
    display: none;
}

.template-card:hover .template-preview::before {
    transform: scale(1.05);
}

/* Placeholder gradients for templates */
.tp-1::before {
    background: linear-gradient(135deg, #fffcf4 0%, #fff 100%);
    /* In a real project, use actual template screenshots */
    border: 1px solid #eee;
}

.tp-1::after {
    content: 'Classic\A Layout';
    white-space: pre;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-family: var(--font-heading);
    color: #ccc;
    font-size: 1.5rem;
    display: none;
}

.tp-2::before {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.tp-2::after {
    content: 'Modern\A Clean';
    white-space: pre;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-family: var(--font-heading);
    color: white;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: none;
}

.tp-3::before {
    background: linear-gradient(135deg, #FFEFBA 0%, #FFFFFF 100%);
}

.tp-3::after {
    content: 'Royal\A Luxury';
    white-space: pre;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-family: var(--font-heading);
    color: var(--primary-dark);
    display: none;
    font-size: 1.5rem;
}

.template-info {
    padding: 1.5rem;
}

.template-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.template-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.template-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-text {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-text:hover {
    color: var(--primary-dark);
}

.btn-text i {
    transition: transform 0.3s ease;
}

.btn-text:hover i {
    transform: translateX(4px);
}

/* Call to Action Section */
.cta-section {
    padding: 100px 0;
    text-align: center;
    background: white;
}

.cta-card {
    background: var(--secondary-color);
    color: white;
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.cta-card h2 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.cta-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.cta-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.cta-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.cc1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
}

.cc2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
}

.cta-content {
    position: relative;
    z-index: 1;
}

/* Footer */
footer {
    background: #1a1a1a;
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1rem;
    max-width: 300px;
}

.footer-brand .logo {
    color: white;
}

.footer-links h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-family: var(--font-body);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.footer-links ul li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .cta-card h2 {
        font-size: 2rem;
    }

    .builder-container {
        flex-direction: column;
    }

    .builder-wizard,
    .builder-preview {
        width: 100%;
        margin-bottom: 2rem;
    }

    .preview-sticky-wrapper {
        position: static;
        top: auto;
    }
}

/* How It Works Section */
.how-it-works-section {
    padding: 100px 0;
    background: white;
    position: relative;
}

.steps-timeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-step {
    text-align: center;
    position: relative;
    padding: 1rem 0.5rem;
    transition: all 0.3s ease;
}

.timeline-step:hover {
    transform: translateY(-5px);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    font-family: var(--font-heading);
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    background: var(--accent-pink);
    border-radius: var(--radius-md);
    margin: 0.6rem auto;
    font-size: 1.6rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.timeline-step:hover .step-icon {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.timeline-step h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin: 0.6rem 0;
    color: var(--text-dark);
}

.timeline-step p {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Responsive Timeline */
@media (max-width: 1024px) {
    .steps-timeline {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.8rem;
    }

    .timeline-step {
        padding: 0.8rem 0.3rem;
    }

    .step-icon {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }

    .timeline-step h3 {
        font-size: 0.95rem;
    }

    .timeline-step p {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .steps-timeline {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }

    .timeline-step {
        padding: 0.6rem 0.2rem;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }

    .step-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin: 0.3rem auto;
    }

    .timeline-step h3 {
        font-size: 0.85rem;
    }

    .timeline-step p {
        font-size: 0.7rem;
        display: none;
    }
}

/* Builder Section */
.builder-section {
    padding: 20px 0 30px;
    background: #f4f6f9;
}

.builder-section .section-header {
    margin-bottom: 15px;
}

.builder-section .section-header h2 {
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}

.builder-section .section-header p {
    font-size: 0.9rem;
}

.builder-container {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    /* Use viewport height minus header, section header, and some padding */
    height: calc(100vh - 180px);
    min-height: 500px;
    max-height: 700px;
}

/* Wizard Form (Left) */
.builder-wizard {
    width: 55%;
    background: white;
    border-radius: var(--radius-md);
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

#biodataForm {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wizard-header {
    margin-bottom: 1.2rem;
}

.progress-container {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-bottom: 0.8rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.4s ease;
}

.steps-indicator {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.step.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Mobile steps indicator */
@media (max-width: 768px) {
    .steps-indicator {
        font-size: 0.55rem;
        gap: 0.2rem;
    }

    .step {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 0.15rem;
    }
}

.wizard-step {
    display: none;
    animation: fadeIn 0.4s ease;
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.wizard-step.active {
    display: flex;
    flex-direction: column;
}

.wizard-step h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--secondary-color);
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.4rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.form-group {
    margin-bottom: 0.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

.form-group-photo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.photo-upload-box {
    width: 100px;
    height: 100px;
    border: 2px dashed #ddd;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
    background: #f9f9f9;
    font-size: 0.7rem;
    text-align: center;
    padding: 0.5rem;
}

.photo-upload-box:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fff;
}

.photo-upload-box i {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
}

/* Custom Fields */
.custom-field-item {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    position: relative;
    border: 1px solid #eee;
}

.remove-field-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Live Preview (Right) - main styles defined later */

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

.icon-btn {
    background: white;
    border: 1px solid #ddd;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-dark);
}

/* Biodata Paper base styles - scale defined in PREVIEW SCALING section */
.biodata-paper {
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: 2px;
    padding: 1.2rem;
    font-size: 9px;
    /* Smaller font for miniature view */
    position: relative;
    transition: transform 0.3s ease;
    cursor: pointer;
    width: 100%;
    height: auto;
    min-height: 600px;
    margin-bottom: 50px;
}

.biodata-paper:hover {
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.3);
}

/* Click hint - hidden */
.preview-click-hint {
    display: none;
}

/* Wrapper to contain the scaled preview - handled in flex layout */

/* Full Preview Overlay */
.preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
}

.preview-overlay.active {
    display: flex;
}

.overlay-content {
    background: white;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-md);
    position: relative;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.overlay-header h3 {
    margin: 0;
    color: var(--primary-dark);
}

.overlay-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.close-overlay-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
}

.close-overlay-btn:hover {
    color: var(--text-dark);
}

.overlay-body {
    padding: 1.5rem;
}

.overlay-body .biodata-paper {
    transform: none;
    font-size: 12px;
    padding: 1.5rem;
    cursor: default;
    box-shadow: none;
    /* Reset preview-specific constraints */
    margin: 0;
    width: 100% !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible;
}

/* Mobile overlay optimization */
@media (max-width: 768px) {
    .preview-overlay {
        padding: 0.5rem;
    }

    .overlay-content {
        max-width: 100vw;
        max-height: 80vh;
        padding: 0;
        transform: scale(0.56);
        transform-origin: top center;
    }

    .overlay-header {
        padding: 0.5rem 0.75rem;
    }

    .overlay-header h3 {
        font-size: 1rem;
    }

    .overlay-body {
        padding: 0.75rem;
    }

    .overlay-body .biodata-paper {
        transform: scale(0.8);
        transform-origin: top center;
        font-size: 10px;
        padding: 1rem;
        width: auto !important;
        height: auto;
    }

    .overlay-actions {
        gap: 0.5rem;
    }

    .close-overlay-btn {
        font-size: 1.25rem;
    }
}

/* Template-specific styles are now in individual template CSS files */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .builder-container {
        flex-direction: column;
        height: auto;
        min-height: auto;
        max-height: none;
    }

    .builder-wizard {
        width: 100%;
        height: auto;
    }

    #biodataForm {
        overflow-y: auto;
        max-height: none;
    }

    .builder-preview {
        width: 100%;
        margin-top: 2rem;
    }

    .preview-sticky-wrapper {
        position: static;
        height: auto;
        max-height: 40vh;
        overflow: hidden;
        width: 100%;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 0;
        margin: 0;
    }

    .preview-scale-wrapper {
        flex: initial;
        overflow: hidden;
        width: 100%;
        max-height: 40vh;
    }

    .biodata-paper {
        transform-origin: top center;
        transform: scale(0.8) !important;
        width: auto !important;
        height: auto;
        margin: 0;
        max-width: 100%;
        min-height: auto;
    }

    .wizard-step {
        flex: initial;
        max-height: none;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .form-group {
        margin-bottom: 0.6rem;
    }

    .form-control {
        font-size: 16px; /* Prevents zoom on mobile input focus */
    }

    .wizard-actions {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 1rem 0 0;
        gap: 0.8rem;
    }

    .wizard-actions button {
        flex: 1;
    }

    /* Template Switcher on mobile */
    .template-switcher {
        height: auto;
        margin-top: 1rem;
    }

    .template-thumbnail {
        min-width: 80px;
    }

    .template-thumbnail span {
        font-size: 0.7rem;
    }
}

/* Print/PDF Optimization */
@media print {
    body * {
        visibility: hidden;
    }

    #biodataPreview,
    #biodataPreview * {
        visibility: visible !important;
    }

    #biodataPreview {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 1.2rem;
        box-shadow: none;
        border: none;
        background: white;
        transform: none !important;
        page-break-after: always;
    }
}

/* PDF Container Styles */
#pdf-generation-container * {
    visibility: visible !important;
}

.biodata-paper {
    page-break-inside: auto;
}

/* Add this to styles.css */
.paper-section {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    display: block; /* Ensures break-inside is respected */
}


/* Template Switcher Styles */
.builder-preview {
    display: flex;
    flex-direction: column;
    /* Match the wizard height via flex */
    width: 100%;
    height: 100%;
}

.preview-sticky-wrapper {
    /* Allow preview to take remaining space */
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    /* overflow: hidden; */
    /* Reset sticky because we are flex now */
    position: relative;
    top: auto;
    margin-bottom: 0;
    background: #e9ecef;
    /* slightly darker background to distinguish frame */
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    min-height: 0;
}

/* Adjust the scale wrapper to center content in the available space */
.preview-scale-wrapper {
    /* flex: 1; */
    display: block;
    width: 100%;
    padding: 0;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.template-switcher {
    height: 140px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    position: relative;
    z-index: 10;
    margin-top: auto;
    flex-shrink: 0;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f0f0f0;
}

.template-switcher::-webkit-scrollbar {
    height: 6px;
}

.template-switcher::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.template-switcher::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.template-thumbnail {
    min-width: 80px;
    height: 100px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.7;
}

.template-thumbnail:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.template-thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

.thumb-preview {
    width: 100%;
    flex: 1;
    background-color: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    position: relative;
}

/* Simple visual representation for thumb */
.thumb-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 70%;
    background: #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


.template-thumbnail span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: capitalize;
}



/* --- TEMPLATE SWITCHER & LAYOUT FIXES --- */

.builder-preview {
    display: flex;
    /* Turn into flex container */
    flex-direction: column;
    /* Height inherited from parent flex container */
    justify-content: space-between;
}

.preview-sticky-wrapper {
    flex: 1;
    /* Take all available space minus switcher */
    width: 100%;
    min-height: 0;
    /* Important for flex children to shrink */
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    top: auto;
    background: #e9ecef;
    border-radius: var(--radius-md);
    margin-bottom: 0.8rem;

    /* Center the paper */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.preview-header {
    margin-bottom: 0.5rem;
}


.preview-sticky-wrapper::-webkit-scrollbar {
    width: 8px;
}
.preview-sticky-wrapper::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}
.preview-sticky-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* Template Switcher Strip */
.template-switcher {
    height: 100px;
    /* Fixed height */
    flex-shrink: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    overflow-x: auto;

    /* Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f0f0f0;
}

.template-switcher::-webkit-scrollbar {
    height: 6px;
}

.template-switcher::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.template-switcher::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.template-thumbnail {
    min-width: 60px;
    height: 80px;
    flex-shrink: 0;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.6;
    transition: all 0.2s;
}

.template-thumbnail:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.template-thumbnail.active {
    opacity: 1;
    border-color: var(--primary-color);
}

.thumb-preview {
    flex: 1;
    width: 100%;
    background: #eee;
    margin-bottom: 3px;
    border-radius: 4px;
}

.template-thumbnail span {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: capitalize;
}


/* --- PREVIEW SCALING --- */
/* 
   Available height for preview is dynamic based on viewport.
   Scale calculated to fill available space better.
   A4 dimensions: 595px x 842px
   At 0.52 scale: 309px x 438px (approximate scaled dimensions)
*/

@media (min-width: 1024px) {
    .biodata-paper {
        transform-origin: top center;
        transform: scale(0.6);
        width: 595px !important;
        min-height: 842px !important;
    }
}

@media (max-width: 768px) {
    max-height: auto;
    /* Clip content for preview if needed */
    overflow: visible;

    box-shadow: var(--shadow-md);

    /* Negative margins to reduce grey space caused by scaling */
    /* Original size: 595x842, Scaled: 309x438 */
    /* Difference to compensate: (595-309)/2 = 143, (842-438)/2 = 202 */

    
}


.template-modern {
    background: white;
    width: 595px !important;
    height: 842px !important;
}

/* Ensure PDF generation ignores these preview constraints */
.biodata-paper.generating-pdf {
    transform: none !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* --- ADD THIS AT THE VERY BOTTOM OF styles.css --- */

/* Only apply this "Scrollable Frame" logic to Desktop screens */
@media (min-width: 1024px) { 
    .builder-preview {
        width: 45%;
    }

    .preview-sticky-wrapper {
        /* 1. Enable Sticky Position */
        position: sticky !important; 
        top: 2rem !important; /* Distance from top of browser */
        
        /* 2. Create the "Window" Size */
        height: 70vh !important; /* Occupy 70% of the screen height */
        max-height: 700px;
        
        /* 3. Enable Internal Scrolling */
        overflow-y: auto !important;  /* Scroll vertical */
        overflow-x: hidden !important; /* Hide horizontal */
        
        /* 4. Layout Fixes */
        display: block !important; /* Ensures the scrollbar works correctly */
        padding-right: 10px; /* Space for the scrollbar */
        margin-bottom: 0 !important;
    }
}

/* Update or Add this to the bottom of styles.css */
.biodata-paper.generating-pdf {
    position: absolute !important; 
    top: 0 !important;
    left: 0 !important;
    width: 595px !important;    /* Force A4 Width */
    min-height: 842px !important;
    height: auto !important;     /* Allow growing */
    max-height: none !important; /* Remove constraints */
    overflow: visible !important;
    transform: none !important;  /* Remove the preview scaling */
    margin: 0 !important;
    z-index: -100;               /* Hide behind other content */
}

/* Ensure the layout inside flows naturally */
.generating-pdf .royal-layout, 
.generating-pdf .template-royal {
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
}

/* Footer Social Icons & Branding */
.social-links {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    color: white;
}

.made-in-india {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}