/* Studio Layout Wrapper */
.studio-container {
    width: 100%;
    background-color: #262626;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

@media (max-width: 800px) {
    .studio-container {
    grid-template-columns: 1fr;
    }
}

/* --- Left Side: Live Preview Area --- */
.preview-pane {
    background-color: #212121;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 700px;
}

.brand-heading {
    align-self: flex-start;
    color: rgba(255, 255, 255, 0.4);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 0.9;
}

.case-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

/* --- REALISTIC CASE CHASSIS DRAWING MATRIX --- */
.case-outer-armor {
    width: 240px;
    height: 480px;
    background-color: #ffffff;
    border: 4px solid #cccccc;
    border-radius: 44px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6), inset 0 0 10px rgba(255,255,255,0.8);
    padding: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Inner shock protection line ring */
.case-inner-rim {
    width: 100%;
    height: 100%;
    border: 2px solid #b3b3b3;
    border-radius: 38px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #e6e6e6; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- DYNAMIC CAMERA WINDOW CUTOUTS --- */
.camera-cutout-window {
    background-color: #212121; 
    border: 3px solid #b3b3b3;
    margin: 12px;
    z-index: 4;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.iphone-pro-style .camera-cutout-window { height: 110px; border-radius: 24px; }
.iphone-standard-style .camera-cutout-window { height: 95px; width: 55px; border-radius: 20px; margin-left: 12px; }
.samsung-ultra-style { border-radius: 18px; }
.samsung-ultra-style .case-inner-rim { border-radius: 12px; }
.samsung-ultra-style .camera-cutout-window { height: 145px; width: 48px; border-radius: 10px; margin-left: 12px; }
.samsung-plus-style .camera-cutout-window { height: 115px; width: 38px; border-radius: 12px; margin-left: 14px; }

/* Printable Canvas Space */
.printable-canvas-surface {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0px!important;
    transition: background-image 0.2s ease, background-color 0.2s ease;
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.75),
            rgba(235,235,235,.55)
        );

    backdrop-filter:blur(0.2px);

    box-shadow:

        inset 0 0 16px rgba(255,255,255,.3),

        inset 0 0 25px rgba(0,0,0,.04);
    
}

/* Dynamic overlay text design rules */
.case-print-text {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    word-break: break-word;
    z-index: 5;
    letter-spacing: 1px;
    text-transform: uppercase;
    user-select: none;
    max-width: 90%;
    margin-top: auto;
    margin-bottom: 30px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* --- MAGSAFE CSS OVERLAY RING --- */
.magsafe-ring-overlay {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 4px dashed rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    z-index: 3;
    display: none;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.2), 0 0 0 2px rgba(0,0,0,0.2);
}
.magsafe-ring-overlay::after {
    content: "";
    position: absolute;
    top: 96px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.75);
    box-shadow: -1px 0 0 rgba(0,0,0,0.2), 1px 0 0 rgba(0,0,0,0.2);
}

.device-sub-tag {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 15px;
}

/* --- Right Side: User Controls Area --- */
.controls-pane {
    background-color: #121212;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 1px solid #222;
}

.pane-header {
    background-color: #ffffff;
    color: #000000;
    padding: 25px;
}

.pane-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.price-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-top: 2px;
}

.control-list {
    padding: 10px 0;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 520px;
}

.control-row {
    display: flex;
    flex-direction: column;
    padding: 15px 25px;
    border-bottom: 1px solid #1e1e1e;
    gap: 8px;
}

.row-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.meta-icon {
    color: #ffffff;
    font-size: 1.3rem;
}

.custom-input {
    width: 100%;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    padding: 10px 12px;
    font-size: 0.9rem;
    outline: none;
}
.custom-input:focus { border-color: #ffffff; }

/* Custom Radio Option Buttons */
.radio-toggle-group {
    display: flex;
    gap: 10px;
}
.toggle-option {
    flex: 1;
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: #aaa;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.toggle-option.selected {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #000;
}

/* Swatch Configurations */
.swatch-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.swatch-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.1s;
    background-size: cover;
    background-position: center;
}
.swatch-btn.selected { border-color: #ffffff; }

/* Media Uploader File Trigger Wrapper */
.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}
.file-upload-trigger {
    border: 2px dashed #444;
    color: #aaa;
    background-color: #1a1a1a;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.file-upload-trigger:hover { border-color: #ffffff; color: #fff; }
.file-hidden-input { position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.action-submit-btn {
    background-color: #ffffff;
    color: #000;
    border: none;
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s;
}
.action-submit-btn:hover { background-color: #494949; color: #fff; }

/* ==========================================================
    iPhone 16 Series
========================================================== */

.iphone16-promax-style{
    width:245px;
    height:492px;
    border-radius:46px;
}

.iphone16-promax-style .case-inner-rim{
    border-radius:40px;
}

.iphone16-promax-style .camera-cutout-window{
    width:116px;
    height:116px;
    border-radius:28px;
}

.iphone16-pro-style{
    width:238px;
    height:478px;
    border-radius:44px;
}

.iphone16-pro-style .case-inner-rim{
    border-radius:38px;
}

.iphone16-pro-style .camera-cutout-window{
    width:112px;
    height:112px;
    border-radius:26px;
}

.iphone16-style,
.iphone16-plus-style{
    border-radius:42px;
}

.iphone16-style .camera-cutout-window,
.iphone16-plus-style .camera-cutout-window{
    width:60px;
    height:102px;
    border-radius:22px;
}

/* ==========================================================
    iPhone 15 Series
========================================================== */

.iphone15-promax-style{
    width:243px;
    height:488px;
    border-radius:45px;
}

.iphone15-promax-style .camera-cutout-window{
    width:112px;
    height:112px;
    border-radius:26px;
}

.iphone15-pro-style{
    width:238px;
    height:476px;
    border-radius:44px;
}

.iphone15-pro-style .camera-cutout-window{
    width:108px;
    height:108px;
    border-radius:24px;
}

.iphone15-style,
.iphone15-plus-style{
    border-radius:42px;
}

.iphone15-style .camera-cutout-window,
.iphone15-plus-style .camera-cutout-window{
    width:58px;
    height:98px;
    border-radius:20px;
}

/* ==========================================================
    iPhone 14 Series
========================================================== */

.iphone14-promax-style .camera-cutout-window{
    width:108px;
    height:108px;
    border-radius:24px;
}

.iphone14-pro-style .camera-cutout-window{
    width:105px;
    height:105px;
    border-radius:24px;
}

.iphone14-style,
.iphone14-plus-style{
    border-radius:42px;
}

.iphone14-style .camera-cutout-window,
.iphone14-plus-style .camera-cutout-window{
    width:56px;
    height:96px;
    border-radius:20px;
}

/* ==========================================================
    iPhone 13 Series
========================================================== */

.iphone13-promax-style .camera-cutout-window{
    width:102px;
    height:102px;
    border-radius:22px;
}

.iphone13-pro-style .camera-cutout-window{
    width:100px;
    height:100px;
    border-radius:22px;
}

.iphone13-style .camera-cutout-window{
    width:54px;
    height:92px;
    border-radius:18px;
}

.iphone13-mini-style{
    width:215px;
    height:430px;
}

.iphone13-mini-style .case-inner-rim{
    border-radius:34px;
}

.iphone13-mini-style .camera-cutout-window{
    width:52px;
    height:88px;
    border-radius:18px;
}

/* ==========================================================
    iPhone 12 Series
========================================================== */

.iphone12-promax-style .camera-cutout-window{
    width:98px;
    height:98px;
    border-radius:20px;
}

.iphone12-pro-style .camera-cutout-window{
    width:96px;
    height:96px;
    border-radius:20px;
}

.iphone12-style .camera-cutout-window{
    width:52px;
    height:88px;
    border-radius:18px;
}

.iphone12-mini-style{
    width:210px;
    height:418px;
}

.iphone12-mini-style .case-inner-rim{
    border-radius:32px;
}

.iphone12-mini-style .camera-cutout-window{
    width:48px;
    height:82px;
    border-radius:16px;
}

/* ==========================================================
    Samsung Galaxy S25 Series
========================================================== */

.s25-ultra-style{
    width:242px;
    height:492px;
    border-radius:18px;
}

.s25-ultra-style .case-inner-rim{
    border-radius:14px;
}

.s25-ultra-style .camera-cutout-window{
    width:52px;
    height:150px;
    border-radius:14px;
    margin-left:12px;
}

.s25-plus-style,
.s25-style{
    width:238px;
    height:485px;
    border-radius:28px;
}

.s25-plus-style .case-inner-rim,
.s25-style .case-inner-rim{
    border-radius:22px;
}

.s25-plus-style .camera-cutout-window,
.s25-style .camera-cutout-window{
    width:42px;
    height:120px;
    border-radius:14px;
    margin-left:14px;
}

/* ==========================================================
    Samsung Galaxy S24 Series
========================================================== */

.s24-ultra-style{
    width:242px;
    height:490px;
    border-radius:18px;
}

.s24-ultra-style .case-inner-rim{
    border-radius:14px;
}

.s24-ultra-style .camera-cutout-window{
    width:50px;
    height:146px;
    border-radius:14px;
    margin-left:12px;
}

.s24-plus-style,
.s24-style{
    width:238px;
    height:483px;
    border-radius:28px;
}

.s24-plus-style .camera-cutout-window,
.s24-style .camera-cutout-window{
    width:40px;
    height:118px;
    border-radius:14px;
    margin-left:14px;
}

/* ==========================================================
    Samsung Galaxy S23 Series
========================================================== */

.s23-ultra-style{
    width:242px;
    height:488px;
    border-radius:18px;
}

.s23-ultra-style .case-inner-rim{
    border-radius:14px;
}

.s23-ultra-style .camera-cutout-window{
    width:48px;
    height:144px;
    border-radius:14px;
    margin-left:12px;
}

.s23-plus-style,
.s23-style{
    width:236px;
    height:480px;
    border-radius:28px;
}

.s23-plus-style .camera-cutout-window,
.s23-style .camera-cutout-window{
    width:38px;
    height:116px;
    border-radius:14px;
    margin-left:14px;
}

/* ==========================================================
    Samsung Galaxy A Series
========================================================== */

.a55-style,
.a35-style,
.a25-style{
    width:236px;
    height:480px;
    border-radius:30px;
}

.a55-style .case-inner-rim,
.a35-style .case-inner-rim,
.a25-style .case-inner-rim{
    border-radius:24px;
}

.a55-style .camera-cutout-window,
.a35-style .camera-cutout-window,
.a25-style .camera-cutout-window{
    width:36px;
    height:112px;
    border-radius:12px;
    margin-left:14px;
}

.bottom-cutouts{
    position:absolute;
    bottom:-2px;
    left:50%;
    transform:translateX(-50%);
    display:flex;
    align-items:center;
    gap:18px;
    z-index:15;
}

.speaker{
    display:flex;
    gap:3px;
}

.speaker span{
    width:4px;
    height:4px;
    background:#555;
    border-radius:50%;
    box-shadow:inset 1px 1px 1px rgba(255,255,255,.5);
}

.usb-port{
    width:34px;
    height:8px;
    background:#444;
    border-radius:6px;
    box-shadow:
        inset 0 2px 2px rgba(255,255,255,.25),
        inset 0 -2px 2px rgba(0,0,0,.4);
}

.quick-action-icon {
    color: #fff;
    cursor: pointer;
    font-size: 1.8rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.quick-action-row {
    display: flex;
    gap: 25px;
    align-items: center;
}

.preview-footer-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
}

.color-picker-wrapper {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid transparent;
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    cursor: pointer;
}

/* Studio Layout Wrapper */
.studio-container {
    width: 100%;
    height: 100%;
    /* max-width: 1100px; */
    max-height: 850px;
    background-color: #262626;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

/* --- Left Side: Live Preview Area --- */
.preview-pane {
    background-color: #212121;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    overflow: hidden;
}

.brand-heading {
    align-self: flex-start;
    color: rgba(255, 255, 255, 0.4);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 0.9;
}

.case-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    transition: transform 0.3s ease;
    max-height: calc(100% - 120px);
}

/* Zoom Scaling State Modifier */
.case-wrapper.zoomed-in {
    transform: scale(1.1);
}

/* --- Right Side: User Controls Area --- */
.controls-pane {
    background-color: #121212;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 1px solid #222;
    height: 100%;
    overflow: hidden;
}

.pane-header {
    background-color: #ffffff;
    color: #000000;
    padding: 20px 25px;
}

.control-list {
    padding: 10px 0;
    flex-grow: 1;
    overflow-y: auto;
}

/* --- MOBILE RESPONSIVE AND ZERO SCROLL ENGINE --- */
@media (max-width: 800px) {

    .studio-container {
    grid-template-columns: 1fr;
    /* grid-template-rows: 1.1fr 1fr; 
    height: 100dvh; */
    max-height: 100dvh;
    border-radius: 0;
    height: 95vh!important;
    }

    .preview-pane {
    padding: 0px!important;
    min-height: auto;
    height: 100%;
    justify-content: center!important;
    }

    .brand-heading {
    font-size: 1.5rem;
    }

    /* Dynamically scale the phone case size down on tiny mobile viewports */
    .case-wrapper {
    transform: scale(0.68);
    margin: -18px 0;
    }
    .case-wrapper.zoomed-in {
    transform: scale(0.78);
    }

    .preview-footer-controls {
    margin-top: 0;
    }
    .device-sub-tag {
    font-size: 1.1rem;
    }

    /* Controls Panel Stack */
    .controls-pane {
        margin-bottom

: 10px;
    border-left: none;
    border-top: 1px solid #222;
    height: 100%;
    }

    .pane-header {
    padding: 10px 15px;
    }
    .pane-header h2 {
    font-size: 1.1rem;
    }
    .price-label {
    font-size: 0.95rem;
    }

    /* HORIZONTAL SCROLL DECK */
    .control-list {
    display: flex;
    flex-direction: row;
    /* overflow-x: auto; */
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 0;
    /* height: calc(100% - 100px); */
    align-items: stretch;
    }

    /* Subtle scrollbar track indicator */
    .control-list::-webkit-scrollbar {
    height: 4px;
    }
    .control-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 2px;
    }

    .control-row {
    flex: 0 0 85%; /* Sized to reveal next item is peeking out */
    scroll-snap-align: center;
    border-bottom: none;
    border-right: 1px solid #1e1e1e;
    padding: 12px 20px;
    justify-content: center;
    height: 100%;
    }

    .swatch-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
    width: 100%;
    }

    .action-submit-btn {
    padding: 14px;
    font-size: 1rem;
    }
}

.mobile-section{
    width: 100%;
}
@media (max-width:768px){

.mobile-section{
    display:none;
    margin-top:15px;
}

.mobile-section.active{
    display:block;
}

.summary-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:15px;
    border-radius:12px;
    background:#1e1e1e;
    color:#fff;
    margin-bottom:10px;
    cursor:pointer;
}

.summary-item .material-icons:first-child{
    color:#4da3ff;
    margin-right:12px;
}

.summary-item .arrow{
    color:#888;
}
}


.mobile-toolbar{
    display:none;
}


.mobile-toolbar{
    display:flex;
    justify-content:space-around;
    align-items:center;
    /* background:#1f1f1f; */
    border-radius:14px;
    padding:8px;
    margin:15px 0;
    margin-bottom: 0px!important;
}

.tool-btn{
    width:52px;
    height:52px;
    border:none;
    border-radius:12px;
    background:transparent;
    color:#999;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:.2s;
}

.tool-btn .material-icons{
    font-size:28px;
}

.tool-btn.active{
    background:#2b2b2b;
    color:#4da3ff;
}

.tool-btn:active{
    transform:scale(.95);
}


@media (max-width:768px){

    .mobile-toolbar{
        display:flex;
        justify-content:space-evenly;
        align-items:center;
        /* background:#1f1f1f; */
        border-radius:14px;
        padding:8px;
        margin:15px 0;
    }

    .tool-btn{
        width:52px;
        height:52px;
        border:0;
        background:transparent;
        color:#999;
        border-radius:12px;
        display:flex;
        align-items:center;
        justify-content:center;
    }

    .tool-btn.active{
        background:#2c2c2c;
        color:#4da3ff;
    }

    .tool-btn .material-icons{
        font-size:28px;
    }

    /* Hide all sections by default */
    .mobile-section{
        display:none;
    }

    /* Show selected section */
    .mobile-section.active{
        display:block;
    }

    /* Hide the normal desktop rows */
    .control-list > .control-row{
        display:none;
    }

}

.text-style-modal{
    display:none;
}

@media (max-width:768px){

.text-style-btn{
    width:100%;
    margin-top:12px;
    height:44px;
    border:none;
    border-radius:10px;
    background:#2b2b2b;
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
}

.text-style-modal{
    display:flex;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    z-index:9999;

    opacity:0;
    visibility:hidden;
    transition:.25s;
}

.text-style-modal.show{
    opacity:1;
    visibility:visible;
}

.text-style-sheet{
    margin-top:auto;
    width:100%;
    background:#1d1d1d;
    border-radius:20px 20px 0 0;
    padding:24px;
    transform:translateY(100%);
    transition:.25s;
}

.text-style-modal.show .text-style-sheet{
    transform:translateY(0);
}

.sheet-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.sheet-header h3{
    color:#fff;
    margin:0;
}

.sheet-header button{
    border:none;
    background:none;
    color:#fff;
}

.text-style-sheet label{
    display:block;
    color:#fff;
    margin:16px 0 8px;
}

.text-style-sheet input[type=color]{
    width:100%;
    height:45px;
    border:none;
    background:none;
}

}

.quick-action-row-mobile{
    display:none;
}


@media (max-width:768px){

.quick-action-row-mobile{
    display:flex;
    justify-content:center;
    gap:18px;
    margin:12px 0;
}


.quick-action-btn-mobile{

    width:75px;
    height:48px;

    border:none;
    border-radius:50%;

    background:#1f1f1f;
    color:#fff;

    display:flex;
    align-items:center;
    justify-content:center;

    box-shadow:0 3px 10px rgba(0,0,0,.35);

}


.quick-action-btn-mobile .material-icons{
    font-size:24px;
}


.quick-action-btn-mobile:active{
    transform:scale(.92);
}


.quick-action-btn-mobile:hover{
    color:#4da3ff;
}

}
