@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

:root {
    --bg-main: #34435b;
    --card-bg: #f8f9fc;
    --panel-bg: #ffffff;
    --primary: #006bb7;
    --primary-dark: #005691;
    --border-color: #e2e8f0;
    --text-main: #334155;
    --text-muted: #64748b;
}

body {
    background-color: var(--bg-main);
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Base resets */
* { box-sizing: border-box; }
p, h1, h2, h3, h4 { margin: 0; }

/* Header with logo */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color); /* Fixed invalid --line variable */
    padding: 0;
    display: flex;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}
.logo-container {
    display: flex; 
    align-items: center;
    position: relative;
    margin: 0 !important;
}
.logo-spin {
    height: 56px;
    width: 56px;
    position: absolute;
    left: 49%;
    top: 50%;
    margin-left: -32px; /* Perfectly centered between DEKO and LOTUS */
    margin-top: -33px; 
    animation: rotate-rtl 8s infinite linear;
    perspective: 1000px;
    z-index: 10;
}
.logo-text {
    height: 36px;
    display: block;
    position: relative;
    z-index: 5;
}
@keyframes rotate-rtl {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(-360deg); }
}

/* Main Container */
.qr-container-outer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}
.qr-container-inner {
    background: var(--card-bg);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
}

/* Tabs Top */
.top-tabs {
    background: #475569;
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0;
    overflow-x: auto;
}
.top-tab {
    padding: 0.8rem 1.5rem;
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    user-select: none;
    white-space: nowrap;
}
.top-tab:hover {
    color: white;
}
.top-tab.active {
    background: var(--card-bg);
    color: var(--text-main);
}
.top-tab i {
    font-size: 1.2rem;
}

@media (max-width: 600px) {
    .top-tabs {
        padding: 0.5rem 0.4rem 0;
        gap: 2px;
        overflow: hidden; /* Prevent scroll */
    }
    .top-tab {
        padding: 0.6rem 0.3rem;
        font-size: 0.75rem;
        flex: 1;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        border-radius: 8px 8px 0 0;
        min-width: 0;
    }
    .top-tab i {
        font-size: 1rem;
    }
    .tab-extra {
        display: none;
    }
    .top-tab span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

/* 2-Column Layout */
.qr-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem;
}
@media (max-width: 992px) {
    .qr-body { grid-template-columns: 1fr; }
}

/* Accordions/Panels */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.panel-header {
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}
.panel-content {
    padding: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1.05rem;
    transition: all 0.2s;
    outline: none;
    background: #fff;
    color: var(--text-main);
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 107, 183, 0.1);
}
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    width: 100%;
}
.full-width {
    grid-column: 1 / -1;
}
.vcard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

/* Frame Selector */
.frame-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.frame-option {
    width: 64px;
    height: 74px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 5px;
    transition: all 0.2s;
    background: white;
}
.frame-option:hover {
    border-color: rgba(0, 107, 183, 0.5);
    background: #f8fbff;
}
.frame-option.selected {
    border-color: var(--primary);
    border-width: 2px;
    background: #f0f7ff;
}
.frame-option-box {
    width: 24px; height: 24px; border: 2px solid var(--text-main); border-radius: 3px;
    transition: all 0.2s;
}
.frame-option.selected .frame-option-box { border-color: var(--primary); }
.frame-option-text {
    font-size: 7px; font-weight: 700; background: var(--text-main); color: white; width: 28px; text-align: center; margin-top: 4px; border-radius: 2px;
    transition: all 0.2s;
}
.frame-option.selected .frame-option-text { background: var(--primary); }

/* Customization Tabs */
.custom-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}
.custom-tab {
    flex: 1;
    text-align: center;
    padding: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.custom-tab:hover { color: var(--primary); }
.custom-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Preview Area */
.preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 2rem;
}
.dynamic-badge {
    background: #ffc2d1;
    color: #8a0c32;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.framed-qr-container {
    padding: 5px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--qr-bg, #ffffff);
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

/* Apply chosen frame dynamically with styling variables */
.framed-qr-container.frame-style-1 {
    background: var(--qr-fg, #000);
    padding: 15px;
    border-radius: 20px;
    padding-bottom: 60px;
    position: relative;
}
.framed-qr-container.frame-style-1 .scan-text {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    color: var(--qr-bg, #fff);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 1px;
}

.framed-qr-container.frame-style-2 {
    background: var(--qr-fg, #000);
    padding: 15px;
    border-radius: 20px;
    padding-top: 60px;
    position: relative;
}
.framed-qr-container.frame-style-2 .scan-text {
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    color: var(--qr-bg, #fff);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 1px;
}

.framed-qr-container.frame-style-3 {
    background: var(--qr-bg, #fff);
    padding: 15px;
    border-radius: 20px;
    border: 4px solid var(--qr-fg, #000);
    position: relative;
    padding-bottom: 60px;
}
.framed-qr-container.frame-style-3 .scan-text {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    color: var(--qr-fg, #000);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 1px;
}

.qr-svg-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-svg-wrapper svg {
    display: block;
    width: 250px;
    height: 250px;
    border-radius: 10px;
}
/* For frame-styles */
.frame-style-1 .qr-svg-wrapper,
.frame-style-2 .qr-svg-wrapper {
    background: var(--qr-bg, #fff);
    padding: 10px;
    border-radius: 12px;
}
.frame-style-3 .qr-svg-wrapper {
    background: transparent;
    padding: 0;
}

/* Stats placeholder */
.stats-placeholder {
    width: 100%;
    max-width: 280px;
    margin-bottom: 2rem;
}
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}
.stat-value {
    background: #e2e8f0;
    border-radius: 10px;
    width: 40px;
    height: 16px;
}

/* Download button */
.btn-download {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 14px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 107, 183, 0.3);
    transition: all 0.2s;
    width: 100%;
    max-width: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 107, 183, 0.4);
    background: var(--primary-dark);
}

.download-format-row {
    display: flex;
    width: 100%;
    max-width: 320px;
    gap: 10px;
    margin-top: 15px;
}
.btn-format {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-main);
    flex: 1;
    border-radius: 30px;
    padding: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-format:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f7ff;
}

.custom-color-input {
    padding: 0;
    width: 100%;
    height: 50px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.custom-color-input::-webkit-color-swatch-wrapper {
	padding: 0;
}
.custom-color-input::-webkit-color-swatch {
	border: none;
}

/* PREMIUM SPLIT BUTTON OVERRIDES */
.premium-split-button {
    border-radius: 50px !important;
    overflow: hidden !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2) !important;
    transition: all 0.3s ease !important;
}

.premium-split-button:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3) !important;
    transform: translateY(-1px);
}

.premium-split-button .rz-splitbutton-left {
    border-top-left-radius: 50px !important;
    border-bottom-left-radius: 50px !important;
    padding-left: 20px !important;
    border: none !important;
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%) !important;
}

.premium-split-button .rz-splitbutton-right {
    border-top-right-radius: 50px !important;
    border-bottom-right-radius: 50px !important;
    padding-right: 15px !important;
    border: none !important;
    background: #2563eb !important;
    border-left: 1px solid rgba(255,255,255,0.2) !important;
}

.premium-split-button .rz-button-text {
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    color: white !important;
    text-transform: uppercase !important;
}

.premium-split-button .rz-button-icon-left {
    color: white !important;
}
