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

:root {
    /* Base Colors - Aurora Dark Theme */
    --primary: #020617;
    --primary-light: #0f172a;
    --secondary: #8b5cf6;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --text-dark: #f8fafc;
    --text-light: #94a3b8;
    --white: #1e293b;
    --bg-light: #020617;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-width: 85.6mm;
    --card-height: 54mm;
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s ease;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--bg-light);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    height: 100vh;
    flex: 0 0 auto;
    overflow: hidden;
}

/* ============================================ */
/* SIDEBAR                                      */
/* ============================================ */
.sidebar {
    width: 340px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary) var(--bg-light);
    border-right: 1px solid var(--border-color);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: var(--bg-light); }
.sidebar::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 10px; }

/* Logo */
.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo p {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 0.15rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ============================================ */
/* CONTROLS                                     */
/* ============================================ */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
}

.btn-outline {
    display: block;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.8rem;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-input-wrapper:hover .btn-outline {
    border-color: var(--secondary);
    color: var(--secondary);
    background-color: rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dark);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: var(--transition);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%2264748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.65rem auto;
}

select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.info-box {
    padding: 0.75rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--secondary);
}

.info-box svg { flex-shrink: 0; }

.info-box p {
    font-size: 0.78rem;
    line-height: 1.4;
    font-weight: 500;
}

/* ============================================ */
/* BUTTONS                                      */
/* ============================================ */
.btn-primary {
    padding: 0.875rem 1.75rem;
    background-color: var(--secondary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* ============================================ */
/* PREVIEW                                      */
/* ============================================ */
.preview-container {
    flex-grow: 1;
    overflow: auto;
    padding: 2rem;
    display: flex;
    justify-content: center;
    background-color: var(--bg-light);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 var(--bg-light);
}

.preview-container::-webkit-scrollbar { width: 8px; height: 8px; }
.preview-container::-webkit-scrollbar-track { background: var(--bg-light); }
.preview-container::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }

.a4-page {
    width: 210mm;
    height: 297mm;
    background-color: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    position: relative;
    transform-origin: top center;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
}

.card-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 70mm;
}

/* Card Slots */
.card-slot {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background-color: #f8fbff;
    transition: var(--transition);
    cursor: pointer;
}

.card-slot:hover {
    border-color: var(--secondary);
    background-color: #eff6ff;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.15);
    transform: translateY(-3px);
}

.card-layout.horizontal .card-slot {
    width: var(--card-width);
    height: var(--card-height);
}

.card-layout.vertical .card-slot {
    width: var(--card-height);
    height: var(--card-width);
}

.card-slot img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    position: relative;
    z-index: 2;
    -webkit-print-color-adjust: exact;
    image-rendering: high-quality;
    filter: contrast(1.15) brightness(1.02);
}

.card-slot .placeholder-text {
    position: absolute;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    z-index: 1;
    pointer-events: none;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================ */
/* MODAL STYLES                                 */
/* ============================================ */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.show { display: flex; }

.modal-content {
    background-color: var(--white);
    margin: 0 auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    height: 85vh;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: none;
    letter-spacing: normal;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-close:hover {
    color: var(--danger);
    background: #fee2e2;
}

.modal-body {
    padding: 0;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-light);
    min-height: 0;
    min-width: 0;
}

.img-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 0;
    min-width: 0;
}

#cropCanvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

.corner-handle {
    transition: r 0.15s ease;
}

.corner-handle:hover, .corner-handle:active {
    r: 18;
    fill: var(--secondary);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    background: var(--white);
    border-radius: 0 0 12px 12px;
}

/* ============================================ */
/* PRINT                                        */
/* ============================================ */
@media print {
    body {
        background-color: white;
        height: auto;
        overflow: visible;
    }

    /* Hide UI Elements */
    .sidebar,
    .contact-section,
    .floating-whatsapp,
    .floating-scroll-top,
    .modal {
        display: none !important;
    }

    /* Reset Containers */
    .app-container,
    .preview-container {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow: visible !important;
    }

    /* Page Formatting */
    .a4-page {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        position: static !important;
        transform: none !important;
        /* Width and height are set via JS inline styles for dynamic page sizing */
    }

    .card-slot {
        border: none !important;
        background-color: transparent !important;
    }

    .placeholder-text { display: none !important; }
}

/* ============================================ */
/* CONTACT SECTION                              */
/* ============================================ */
.contact-section {
    background: linear-gradient(135deg, #1f143a 0%, #3e1b3c 40%, #a42036 100%);
    padding: 5rem 2rem;
    position: relative;
    font-family: var(--font-body);
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

.contact-left {
    flex: 1;
    color: white;
}

.pill-badge {
    background-color: #d12e3e;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.contact-heading {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.contact-text {
    font-size: 1rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-info-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.info-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #a42036;
    flex-shrink: 0;
}

.info-details h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: white;
}

.info-details p {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin: 0;
}

.follow-us h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.social-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #a42036;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

.contact-actions {
    display: flex;
    gap: 1rem;
}

.btn-whatsapp-action {
    background: #10b981;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.btn-whatsapp-action:hover { transform: scale(1.05); color: white; }

.btn-call-action {
    background: #d12e3e;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.btn-call-action:hover { transform: scale(1.05); color: white; }

.contact-right {
    flex: 1;
    max-width: 500px;
}

.form-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.form-title {
    color: #1e1b4b;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: #64748b;
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.inquiry-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inquiry-form input,
.inquiry-form select,
.inquiry-form textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.3s ease;
    background: #ffffff;
    color: var(--text-dark);
}

.inquiry-form input:focus,
.inquiry-form select:focus,
.inquiry-form textarea:focus {
    border-color: #a42036;
    box-shadow: 0 0 0 3px rgba(164, 32, 54, 0.15);
}

.inquiry-form select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%2264748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

.inquiry-form textarea {
    resize: vertical;
}

.btn-submit-form {
    background: #d92d5c;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.btn-submit-form:hover {
    background: #be1846;
}

.floating-whatsapp {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.floating-whatsapp:hover { transform: scale(1.1); color: white; }

.floating-scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e1b4b;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 1000;
    transition: background 0.3s ease;
}

.floating-scroll-top:hover { background: #3e1b3c; }

@media (max-width: 900px) {
    body {
        overflow-y: auto;
    }
    .app-container {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
        overflow: visible !important;
    }
    .sidebar {
        width: 100% !important;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        position: relative;
    }
    .preview-container {
        width: 100%;
        height: auto;
        min-height: 50vh;
        padding: 1rem 0;
        align-items: flex-start;
        overflow: hidden;
    }
    .a4-page {
        transform: scale(0.45) !important;
        transform-origin: top center !important;
        margin-bottom: -400px; /* Adjust height collapse due to scale */
    }
    .contact-container {
        flex-direction: column;
    }
    .contact-right {
        max-width: 100%;
        width: 100%;
    }
}