html, body {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: none;
    /* Prevent zooming */
    touch-action: pan-x pan-y;
}

body, * {
    touch-action: pan-x pan-y !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    pointer-events: auto;
    /* Prevent zooming on double-tap and pinch */
    touch-action: pan-x pan-y !important;
}



p, h1, h2, h3, h4, h5, h6, label, span, div, button, input, select {
    color: #000;
}

/* Draggable items from library */
#select_drag div {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#select_drag div:active {
    cursor: grabbing;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Dropped items within the drop zone */
.dropped-item {
    touch-action: none;
    cursor: move;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.dropped-item:active {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    z-index: 1000 !important;
}

/* Visual feedback for drop zone */
#main_drag_div.drag-over {
    background-color: rgba(180, 210, 235, 0.3) !important;
    border: 2px dashed #4a90e2;
    transition: background-color 0.2s ease, border 0.2s ease;
}

/* Smooth animations */
.drag-clone {
    pointer-events: none;
    z-index: 9999;
    opacity: 0.8;
    transform: scale(0.85);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
}

@media only screen and (max-width: 1600px) and (orientation : portrait) {

    #select_drag div[id^="img_"] {
        transform: scale(1.2);
        transition: transform 0.3s ease-in-out;
    }
}

@font-face {
    font-family: "Urbanist"; 
    src: url("https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700;800&display=swap"); 
}

body{  
    padding: 0;
    margin: 0;
    height: 100vh;
    background-size: cover;
}

button{
    cursor: pointer;
    background-color: rgba(199, 179, 153, 0.712);
}

#main{
    margin: 2vw 2vw;
    padding: 0;
    margin-top: 5vh;
    display: flex;
    justify-content: center;
}

#take_name div label img{
    align-items: center;
}

#selection{
    background-color: rgba(77, 77, 77, 0.507);
    backdrop-filter: blur(3px);
    border-radius: 20px;
    width: 80vw;
}

#type_of_plate{
    display:grid;
    grid-auto-flow: row;
}

#type_of_plate button img{
    width: 30vh;
}

#type_of_plate button{
    margin: 5px;
    border-radius: 20px;
    display: block;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

#type_of_plate button p{
    font-size: 3vh;
    margin: 0;
}

#line_plate , #select_inch, #take_name ,#main_drag{
    display: none;
}

#select_inch button{
    margin: 1vw;
    border-radius: 20px;
}

#line_plate button{
    margin: 1vw;
    padding: 0;
    border-radius: 20px;
    font-size: 2vw;
}

#line_plate button img{
    width: 15vw;
}

#line_plate button p{
    margin: 0;
}

#select_inch button img{
    width: 25vw;
}

#select_inch button p{
    margin: 0;
    font-size: 2vw;
}

#take_name p, #take_name form {
    text-align: center;
}

#take_name label img{
    width: 80%;
}

#take_name input[type="radio"] {display: none;}
.labeltoselectcolor {
    width: 10vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
}
.labeltoselectcolor p{
    margin: 5px 15px;
    font-size: 3vw;
}
.labeltoselectcolor:before {
    content: " ";
    display: block;
    border-radius: 50%;
    position: absolute;
    top: -5px;
    left: -5px;
    width: 3.5vw;
    height: 3.5vw;
    text-align: center;
    line-height: 3.5vw;
    transition-duration: 0.4s;
    transform: scale(0);
}
.labeltoselectcolor img {
    width: 10vw;
    height: 10vw;
    transition-duration: 0.2s;
    transform-origin: 50% 50%;
    border-radius: 1vw;
}
:checked + .labeltoselectcolor:before {
    content: "✓";
    font-size: 3vw;
    background-color: rgb(150, 225, 255);
    transform: scale(1);
}
:checked + .labeltoselectcolor img {
    transform: scale(0.9);
    box-shadow: 0 0 5px rgb(150, 225, 255);
    z-index: -1;
}

#main_drag div{
    display: flex;
}

#drag_container{
    width: 1002px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#drag_select_container{
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 3vw;
}

#select_container_ldf{
    padding: 1vw;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

#select_container_ldf div svg{
    width: 2vw;
    margin: 1vw;
}

#select_container_ldf select, #select_container_ldf button, #select_container_ldf div{
    text-align: center;
    font-size: 2vw;
    height: 4vw;
    margin: 1vw 2vw 0 2vw;
}

@media (max-width: 600px) {
    #select_container_ldf div,
    #select_container_ldf select,
    #select_container_ldf button {
        text-align: center;
        font-size: 4vw;
        height: 6vw;
        margin: 1vw 2vw 0 2vw;
    }
    #select_container_ldf select {
        font-weight: bold;
    }
}

#select_container_ldf div p {
    display: none;
}

#select_container_ldf div{
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
}

#select_drag{
    display: flex;
    flex-direction: column;
}

#select_drag div div{
    margin: 10px;
}

.displayfwrapcc{
    width: 85vw;
    height: 40vh;
    padding: 1vw;
    margin-bottom: 2vw;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.329);
    overflow: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: rgba(199, 179, 153, 0.712) rgba(77, 77, 77, 0.507);
}

.select_drag_div_div{
    display: block;
    cursor: pointer;
    background-size:cover;
    background-repeat: no-repeat;
    touch-action:manipulation;
}

#main_drag_div{
    position: absolute;
}

.displayfwrapcc{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.plate_bg_img{
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -10;
}

@media only screen and (max-width: 428px) {

    #select_container_ldf div p {
        display: block;
    }

    #drag_container{
        width: 280px;
    }

    #drag_select_container{
        flex-direction: column;
    }

    #select_container_ldf{
        flex-direction: row;
    }

    #select_container_ldf div svg{
        width: 15px;
    }

    #select_container_ldf select, #select_container_ldf div{
        text-align: center;
        font-size: 2vw;
        margin-right: 1vw;
        margin-bottom: 1vw;
        margin-left: 1vw;
    }

    #select_container_ldf div p {
        margin: 0;
    }

    #select_container_ldf div{
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: white;
    }
}

@media only screen and (max-width: 600px) and (min-width: 428px) {

    #select_container_ldf div p {
        display: block;
    }

    #drag_container{
        width: 360px;
    }

    #drag_select_container{
        flex-direction: column;
    }

    #select_container_ldf{
        flex-direction: row;
    }

    #select_container_ldf div svg{
        width: 15px;
    }

    #select_container_ldf select, #select_container_ldf div{
        text-align: center;
        font-size: 2vw;
        margin-right: 1vw;
        margin-bottom: 1vw;
        margin-left: 1vw;
    }

    #select_container_ldf div p {
        margin: 0;
    }

    #select_container_ldf div{
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: white;
    }

}




@media only screen and (max-width: 1100px) and (min-width: 600px) {

    #drag_container{
        width: 550px;
    } 

}






@media (orientation : portrait) {
    #take_name form input{
        width: 100%;
        margin-left: 10px;
    }
    #line_plate button p, #select_inch button{
        font-size: 5vw;
    }
    #line_plate button, #select_inch button{
        padding-top: 5vw;
        padding-bottom: 5vw;
    }
    #line_plate button img, #select_inch button img{
        width: 40vw;
    }
}






@keyframes app_dis {
    0% {
        opacity: 1;
    }
    50%{
        opacity: 0.5;
    }
    100%{
        opacity: 0;
    }
}

@keyframes dis_app {
    0% {
        opacity: 0;
    }
    50%{
        opacity: 0.5;
    }
    100%{
        opacity: 1;
    }
}

/* tutorial sidebar styles */
.tutorial-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(199, 179, 153, 0.9);
    border: 2px solid #c7b399;
    color: #333;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tutorial-toggle-btn:hover {
    background-color: rgba(199, 179, 153, 1);
    transform: scale(1.1);
}

.tutorial-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: rgba(77, 77, 77, 0.95);
    backdrop-filter: blur(10px);
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

.tutorial-sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header h3 {
    color: white;
    margin: 0;
    font-family: 'Urbanist', sans-serif;
    font-size: 24px;
    font-weight: 600;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.sidebar-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-content {
    padding: 20px;
}

.tutorial-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 15px;
    background-color: rgba(199, 179, 153, 0.8);
    border: none;
    border-radius: 10px;
    color: #333;
    font-family: 'Urbanist', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-btn:hover {
    background-color: rgba(199, 179, 153, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gif-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.gif-popup.show {
    display: flex;
}

.gif-container {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.gif-container img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* Desktop styles */
@media (min-width: 768px) {
    .tutorial-sidebar {
        width: 400px;
        right: -400px;
    }
    
    .tutorial-toggle-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .sidebar-header h3 {
        font-size: 28px;
    }
    
    .tutorial-btn {
        font-size: 18px;
        padding: 18px 25px;
    }
    
    .gif-container {
        max-width: 70%;
        max-height: 80%;
    }
}

@media (max-width: 767px) {
    .sidebar-close-btn {
        display: flex;
    }
    
    .tutorial-toggle-btn {
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 768px) {
    .thisisadraggingshadow {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}