:root {
    --background-color: #faf8e8;
    --primary-color: #d9d9d9;
    --secondary-color: #433d3d;
}
*{
    margin: 0;
            padding: 0;
            box-sizing: border-box;
    font-family: 'Jeju Myeongjo', serif;

}
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-left: -25px;
    margin-top: -10px;
}

.logo {
    width: 75px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin-left: 50px;
}

.shop-name {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 1.5px;
    margin-left: -8px;
}

.top-bar {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 5px;
    padding: 0 5px;
}

.back-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-button img {
    width: 32px;
    height: 32px;
}

.top-bar .shop-name {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin: 0;
}

.initial-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 1;
    padding-bottom: 0;
}

.second-screen {
    display: block;
    height: 60vh;
    width: 100%;
    position: fixed;
    bottom: -60vh;
    left: 0;
    right: 0;
    background-color: var(--background-color);
    transition: transform 0.3s ease-in-out;
    z-index: 1;
    padding: 20px;
    border-radius: 25px 25px 0 0;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
}

.second-screen.active {
    transform: translateY(-100%);
}

.categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 5px 10px;
    justify-content: center;
}

.category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 60px;
}

.category-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(24%) sepia(0%) saturate(1646%) hue-rotate(169deg) brightness(94%) contrast(89%);
}

.btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--secondary-color);
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1),
        2px 2px 5px #b8b8b8,
        -2px -2px 5px #fafafa;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: none;
}

.category-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.category-label:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.items-grid{
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 5px;
    background: var(--primary-color);
    border-radius: 15px;

    flex-grow: 1;
    /* Allows it to take up available space */
    max-height: calc(60vh - 220px);
    /* Adjust based on header & padding */
    overflow-y: auto;
    /* Enables scrolling */
    padding-bottom: 20px;
    /* Extra padding to ensure last image is visible */
}


.items-grid::-webkit-scrollbar {
    width: 8px;
}

.items-grid::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}



.item-card {
    height: 100%;
    background: var(--background-color);
    border-radius: 5px;
    width: 100%;
    overflow: hidden;
}


.item-screen {
    position: fixed;
    width: 100%;
    height: 100%;
    background: var(--background-color);
    display: flex;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    left: 50%;
    transform: translateX(-50%);
}

#closeItemScreen {
    position: absolute;
    top: 10px;
    left: 10px;
}

.hidden {
    display: none;
}

#displayImage {
    background: var(--primary-color);
}

#product {
    border: 3px solid var(--secondary-color);
    border-radius: 5px;
    padding: 5px;
}

.back-button-product {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: transparent;
    border: none;
}
.cart-button-product {
    position: absolute;
    top: 20px;
    right: 14px;
    width: 50px;
    height: 50px;
    background-color: transparent;
    border: none;
}

.back-button-product img {
    box-sizing: content-box;
    width: 50px;
    height: 50px;
    padding-left: 5px;
    padding-top: 10px;
}
.cart-button-product img{
    width: 50px;
    height: 50px;
    box-sizing: content-box;
    padding: 3px;
}

/**......................................**/

h3{
    color: var(--secondary-color)
}



body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    position: relative;
    background: var(--background-color);
}

/* Remove or modify this if it exists, as it might interfere */
body::before {
    display: none;
}

/* Ensure content remains readable */
#colorArea,
#palette,
#drop-zone,
#images {
    padding: 15px;
    border-radius: 8px;
}



#colorArea{
    display: none !important;
}

h1{
    margin-top: 20px;
}

.heading{
    color: var(--font-color);
    font-family: "Tangerine";
    font-size:60px;
}
.main-heading {
    color: var(--font-color) !important;
    font-family: 'Orbitron', sans-serif;
    font-size: 50px;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
    opacity: 0; /* Start fully transparent */
    animation: fadeInTitle 1s ease-out 2s forwards, tubelight 2s ease-out 2s forwards; /* Adjusted duration for tubelight */
}
/* Styling for color displays */
#mostFrequentColor,
#contrastColors {
    height: 100px;
    width: 80%;
    border: solid 2px var(--border-color);
    border-radius: 8px;
    margin: 0 auto;
}

#palette {
    display: none !important;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 80%;
    margin: 0 auto;
}

.paletteColor {
    height: 80px;
    flex: 0 1 20%;
    border: solid 2px var(--border-color);
    border-radius: 8px;
    margin: 5px;
}

/* Drag-and-drop styling */
#drop-zone {
    width: 80%;
    max-width: 400px;
    height: 230px;
    min-height: 120px;
    border: 2px dashed var(--accent-color);
    color: var(--font-color);
    margin: 20px auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    overflow: hidden;
}

#drop-zone.dragover {
    border-color: var(--background-color);
}

#drop-zone img {
    max-width: 100%;
    max-height: 190px;
    object-fit: contain;
    display: block;
    margin-top: 10px;
    border-radius: 8px;
}



/* Image display grid styling for responsive view */
#images {
    margin: 5px auto;
    grid-template-columns: repeat(2, minmax(80px, 1fr));
    gap: 10px;
    padding: 15px;
}

#images img {
    /* Fixed height for uniformity */
    border-radius: 8px;
    object-fit: cover;
    /* This ensures images maintain aspect ratio */
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
}

#images img:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}





.camera-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: auto;
    padding-bottom: 25px;
    flex-shrink: 0;
    width: 100%;
    position: relative;
    z-index: 2;
}



.button-label{
    font-size: 1.75rem;
    color: var(--secondary-color);
}

#mostFrequentColor,
#contrastColors,
.paletteColor {
    transition: transform 0.3s ease;
}


.button{
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1),
        6px 6px 12px #b8b8b8,
        -6px -6px 12px #fafafa;
    transition: all 0.15s ease;
    position: relative;
    top: 0;
}
.buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: auto;
    padding-bottom: 25px;
    flex-shrink: 0;
    width: 100%;
    position: relative;
    z-index: 2;
}

.button-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}



/* Add subtle animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

#colorArea,
#palette,
#drop-zone {
    animation: fadeIn 0.5s ease-out;
}

/* Add this to your existing style section */
#change-palette {
    display: none;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    width: auto;
    max-width: 200px;
    margin: 10px auto;
    transition: all 0.3s ease;
    font-weight: bold;
}

#change-palette:hover {
    background-color: var(--background-color) !important;
    border-color: var(--background-color) !important;
    color: var(--light-color);
    transform: translateY(-2px);
}

#camera-preview {
    border-radius: 8px;
    object-fit: cover;
    width: 100%;
    max-height: 190px;
}

#drop-zone {
    display: flex;
    flex-direction: column;

    background-color: var(--primary-color);
    margin: auto;
    border-radius: 25px;
    background: #d9d9d9;
    box-shadow: inset 8px 8px 16px #7c7c7c,
        inset -8px -8px 16px #ffffff;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 15px;
}


/* Simpler fade in animation without movement */
@keyframes fadeInTitle {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


input[type="range"] {
    -webkit-appearance: none; /* Override default CSS styles */
    appearance: none; /* Standard property for compatibility */
    width: 100%; /* Full-width */
    height: 8px; /* Height of the slider */
    background: var(--primary-color); /* Track color */
    border-radius: 5px; /* Rounded corners */
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; /* Override default CSS styles */
    appearance: none; /* Override default CSS styles */
    width: 20px; /* Width of the thumb */
    height: 20px; /* Height of the thumb */
    background: var(--secondary-color); /* Thumb color */
    border: 2px solid var(--secondary-color);
    border-radius: 50%; /* Rounded thumb */
    cursor: pointer; /* Pointer cursor on hover */
}

input[type="range"]::-moz-range-thumb {
    width: 20px; /* Width of the thumb */
    height: 20px; /* Height of the thumb */
    background: var(--accent-color); /* Thumb color */
    border: 2px solid black;
    border-radius: 50%; /* Rounded thumb */
    cursor: pointer; /* Pointer cursor on hover */
}

/* Add this keyframes animation for tubelight effect */
@keyframes tubelight {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    10% {
        opacity: 1; /* Fully visible */
    }
    20% {
        opacity: 0; /* Flash out */
    }
    30% {
        opacity: 1; /* Flash in */
    }
    40% {
        opacity: 0; /* Flash out */
    }
    50% {
        opacity: 1; /* Flash in */
    }
    60% {
        opacity: 0; /* Flash out */
    }
    70% {
        opacity: 1; /* Flash in */
    }
    80% {
        opacity: 0; /* Flash out */
    }
    100% {
        opacity: 1; /* Fully visible */
        transform: scale(1); /* Final scale */
    }
}



/* Full-Page Loading Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--background-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

#cartItems {
    flex: 1 1 auto;
    overflow-y: auto;
    margin-top: 0;
    margin-bottom: 0;
    padding: 15px;
    max-height: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 110px; /* Height of paymentCard + some gap */
}
#paymentModal {
    display: flex;
    justify-content: center;
    align-items: center;
    
    border-radius: 16px;
    background: white;
    box-shadow: 0 4px 32px rgba(0,0,0,0.15);
}
#paymentCard {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    background: var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    max-width: 400px;
    margin: 0 auto;
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100vw;
    z-index: 1001;
}
@media (max-width: 500px) {
    #paymentCard {
        max-width: 98vw;
        padding: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
}
#paymentCard > div {
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
}
#paymentCard > div:last-child {
    margin-bottom: 0;
}
#paymentCard .cart-action-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    justify-content: space-between;
}
#cancelCart, #payCart {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 0;
    font-size: 1rem;
    border-radius: 10px;
    background-color: var(--background-color);
    color: var(--secondary-color);
    border: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    font-weight: 500;
}
@media (max-width: 500px) {
    #paymentCard {
        max-width: 98vw;
        padding: 10px;
    }
    #cancelCart, #payCart {
        font-size: 0.95rem;
        padding: 8px 0;
    }
    #paymentCard .cart-action-row {
        gap: 6px;
    }
}
.hidden {
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.animation-text{
    display: block;
    color: var(--accent-color);
    font-weight: bolder;
    font-size: 25px;
}
#admin-btn-div {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000; /* Ensure it sits above other elements */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#admin-btn{
    border: none;
    background: transparent;
    background-color: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    width:50px;
    height:50px;
}

@media (max-width: 480px) {
    #admin-btn-div {
        top:30px;
        right:15px;
        width: 30px; /* Reduced width */
        height: 30px; /* Reduced height */
    }
}
.second-screen #filter-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
}
.second-screen #cart-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
}
#cart-btn{
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--background-color);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.15s ease;
}

#filter-btn{
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--background-color);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.15s ease;
}

#filter-btn:hover ,#cart-btn:hover{
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

#filter-btn:active , #cart-btn:active{
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#filter-btn img,#cart-btn img {
    width: 24px;
    height: 24px;
}

#filter-options {
    background-color: var(--background-color);
    position: fixed; /* Ensure it is positioned relative to the viewport */
    top: 60%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Adjust for element's own dimensions */
    z-index: 10000; /* Set a high z-index to be above other elements */
}
.card-body{
    border-radius: 11px;
    border: 2px solid var(--secondary-color);
    background: #faf8e8;
    box-shadow:  7px 7px 14px #dcdacc,
                 -7px -7px 14px #ffffff;
                }

.size-btn{
    display: flex;
    border-radius: 50%;
    background-color: var(--primary-color);
    width:30px;
    height:30px;
    justify-content: center;
    align-items: center;
}