/* =========================================
   QR STUDIO PRO - SCOPED (NO FOOTER)
   ========================================= */

/* 1. Module Wrapper (Scoped) */
.qr-wrapper {
    background: #020617;
    min-height: 100vh;
    padding: 40px 0;
    font-family: 'Inter', sans-serif;
    position: relative;
    isolation: isolate;
}

/* Background Animation */
.qr-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(255, 51, 102, 0.1) 60deg, transparent 120deg, rgba(0, 173, 239, 0.08) 240deg, transparent 360deg);
    animation: spinBg 25s linear infinite;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.8;
    pointer-events: none;
}

@keyframes spinBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 2. Desktop Layout */
.qr-wrapper .studio-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-areas: "sidebar preview";
    gap: 30px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    align-items: start;
}

.qr-wrapper .section-title {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin: 0;
}

.qr-wrapper .highlight-text {
    color: #ff3366;
}

.qr-wrapper .section-subtitle {
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
    margin-bottom: 40px;
}

/* 3. Sidebar */
.qr-wrapper .studio-sidebar {
    grid-area: sidebar;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
    backdrop-filter: blur(10px);
}

.qr-wrapper .studio-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 25px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.qr-wrapper .studio-tabs::-webkit-scrollbar {
    display: none;
}

.qr-wrapper .tab-btn {
    background: none;
    border: none;
    color: #64748b;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 10px 0;
    white-space: nowrap;
    flex-shrink: 0;
    transition: 0.3s;
}

.qr-wrapper .tab-btn.active {
    color: #ff3366;
    border-bottom: 2px solid #ff3366;
}

.qr-wrapper .tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.qr-wrapper .tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qr-wrapper .studio-group {
    margin-bottom: 15px;
}

.qr-wrapper .studio-group label {
    display: block;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.qr-wrapper .studio-input,
.qr-wrapper .studio-select {
    width: 100%;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    color: #fff;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
}

.qr-wrapper .studio-input:focus {
    border-color: #00ADEF;
}

.qr-wrapper .color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.qr-wrapper .studio-color {
    width: 100%;
    height: 40px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

/* 4. Preview Area */
.qr-wrapper .studio-preview {
    grid-area: preview;
    position: sticky;
    top: 100px;
    height: fit-content;
    text-align: center;
}

.qr-wrapper #frame-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
    max-width: 100%;
    width: fit-content;
    transition: 0.3s;
}

.qr-wrapper #qr-canvas {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-wrapper #qr-canvas svg {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
}

/* Frames */
.qr-wrapper .frame-simple {
    border: 10px solid #00ADEF;
}

.qr-wrapper .frame-label-bottom {
    padding-bottom: 50px !important;
    position: relative;
    overflow: hidden;
}

.qr-wrapper .frame-label-bottom .frame-text-element {
    display: block !important;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #00ADEF;
    color: white;
    padding: 12px;
    font-weight: 900;
    border-radius: 0 0 10px 10px;
}

.qr-wrapper .frame-text-element {
    display: none;
    text-transform: uppercase;
    font-size: 14px;
}

/* Buttons */
.qr-wrapper .studio-btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.2s;
}

.qr-wrapper .outline-blue {
    background: transparent;
    border: 1px solid #00ADEF;
    color: #00ADEF;
}

.qr-wrapper .outline-blue:hover {
    background: rgba(0, 173, 239, 0.1);
}

.qr-wrapper .dl-qr-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 800;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.2s;
}

.qr-wrapper .dl-qr-btn.pink {
    border-color: #ff3366;
    color: #ff3366;
}

.qr-wrapper .dl-qr-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.qr-wrapper .danger-btn {
    background: none;
    border: 1px solid #ff3366;
    color: #ff3366;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    font-size: 10px;
    margin-top: 10px;
}

.qr-wrapper .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}


/* =========================================
   📱 MOBILE CONFIGURATION (340px & Centered)
   ========================================= */
@media (max-width: 900px) {
    .qr-wrapper .studio-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
        grid-template-areas: none;
        grid-template-columns: 1fr;
    }

    /* 1. Sticky Preview (Top) */
    .qr-wrapper .studio-preview {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: rgba(2, 6, 23, 0.95);
        backdrop-filter: blur(15px);
        width: calc(100% + 30px);
        margin: 0 -15px;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
        display: flex;
        justify-content: center;
        align-items: flex-start;
    }

    /* 2. FORCE 340PX FRAME & CENTER IT */
    .qr-wrapper #frame-container {
        width: 340px !important;
        padding: 15px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .qr-wrapper #qr-canvas svg {
        display: block;
        margin: 0 auto;
        width: 100% !important;
        height: auto !important;
    }

    .qr-wrapper .download-stack {
        display: none;
    }

    .qr-wrapper .studio-sidebar {
        margin-top: 0;
        padding: 20px 15px;
    }
}