/* Base Styles */
.gift-card-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 15px;
}

.gift-card-container-text {
    font-weight: 400;
    font-size: 32px;
    line-height: 1;
    text-align: center;
    color: #000;
    margin: 60px 0 40px;
}

.mygift__card__main {
    width: 100%;
    padding: 16px;
    max-width: 1440px;
    margin: 40px auto;
    border: 1px solid #f0f0f0;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}

.mygift__card__wrpr {
    display: flex;
    column-gap: 60px;
}

.mygift__card__main .mygift__card__title {
    font-size: 32px;
    font-weight: 400;
    line-height: 2;
    text-align: center;
}

.custom__title {
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.mygift__card__left {
    width: 100%;
    max-width: 516px;
}

.giftCard__tab__wrpr {
    display: flex;
    margin-bottom: 24px;
    column-gap: 5%;
}

.giftCard__tab__child {
    padding: 16px;
    border: 1px solid #333;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    flex: 1 1 30%;
}

.giftCard__tab__child.active {
    background-color: #333;
    color: #fff;
}

.make_it_hidden {
    display: none;
}

.card__template__wrpr {
    display: flex;
    flex-wrap: wrap;
    column-gap: 18px;
}

.card__background__wrpr,
.card__element__wrpr,
.card__text__wrpr {
    max-height: 485px;
    height: 100%;
    overflow-y: scroll;
    scrollbar-width: auto;
    flex-wrap: wrap;
    gap: 4%;
    padding: 4px;
    display: none;
}

.ql-bubble .ql-picker.ql-expanded .ql-picker-options::-webkit-scrollbar,
.card__background__wrpr::-webkit-scrollbar,
.card__element__wrpr::-webkit-scrollbar,
.card__text__wrpr::-webkit-scrollbar {
    display: block;
}

.template__card,
.element__card,
.text__card {
    width: 100%;
    flex: 0 0 48%;
    margin-bottom: 18px;
    background: #ffffff;
    border: 8px solid #f6f6f6;
    outline: 2px solid transparent;
    display: flex;
    justify-content: center;
    cursor: pointer;
}

.template__card img {
    width: 100%;
    margin: 0 auto;
}

.text__card {
    background-color: #E4E4E4;
    min-height: 130px;
}

.text__card img {
    filter: drop-shadow(0 0 10px #999);
}

.template__card.active,
.element__card.active,
.text__card.active {
    outline-color: #333333;
}

.card__template__wrpr.active,
.card__background__wrpr.active,
.card__element__wrpr.active,
.card__text__wrpr.active,
.add__text__wrpr.active,
.icon__tools__wrpr.active {
    display: flex;
}

.add__text__wrpr {
    display: none;
    width: 100%;
    background: #f8f8f8;
    margin-bottom: 18px;
    padding: 14px 38px;
    column-gap: 8px;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    border: 1px solid #33333342;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.mygift__card__right {
    background-color: #fafafa;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

.mygift__card__right:has(.select__bg.active) {
    align-self: start;
}

.select__bg {
    position: relative;
    overflow: hidden;
    background-color: #fff;
    max-width: 734px;
    width: 100%;
    aspect-ratio: 1.65;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    z-index: 1;
}

.select__bg.active {
    max-height: unset;
    min-height: unset;
    height: unset;
}

.gift__card__btn {
    margin: 24px 0;
    display: flex;
    justify-content: flex-end;
    column-gap: 12px;
}

.gift__card__btn button {
    max-width: 298px;
    width: 100%;
    aspect-ratio: 5;
    border: 1px solid #333;
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    background-color: #fff;
    cursor: pointer;
}

.gift__card__btn button.active {
    background-color: #333;
    color: #fff;
}

/* Icon & Tools */
.icon__tools__wrpr {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    min-width: 450px;
    width: max-content;
    padding: 10px 16px;
    text-align: center;
    align-items: center;
    justify-content: center;
    color: #333333;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    background-color: #fff;
    box-shadow: 0 0 9px 0 #0000000A;
    display: none;
}

.icon__tools__wrpr img {
    width: 25px;
    aspect-ratio: 1;
}

.blend-mode,
.flip-mode,
.opacity-mode {
    display: flex;
    column-gap: 8px;
    align-items: center;
    padding: 0 16px;
    cursor: pointer;
}

#opacityControl {
    background: #f4f4f4;
    border: 1px solid #f4f4f4;
    padding: 8px;
    box-shadow: inset 0 0 2px #00000040;
    border-radius: 4px;
}

.bg-image {
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    user-drag: none;
    user-select: none;
}

#blendMode {
    margin-left: 10px;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
}

.icon-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.icon:hover {
    transform: scale(1.2);
}

/* Draggable Elements */
.drag__Wrpr {
    position: relative;
}

.draggable-image,
.draggable-image2 {
    width: 100px;
    height: auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    cursor: pointer;
    padding: 0px;
    z-index: 9;
    position: absolute;
}

.draggable-image2 {
    z-index: 10;
}

/* Quill Editor Overrides */
.ql-align .ql-picker-label::before,
.ql-align .ql-picker-item::before {
    font-family: "FontAwesome";
    display: inline-block;
    width: 20px;
    text-align: center;
}

#ql-picker-options-3::-webkit-scrollbar {
    display: none;
}

.ql-editor {
    padding: 0px !important;
    line-height: 1 !important;
    font-size: 16px;
}

.ql-editor::placeholder {
    font-style: normal;
}

.ql-align-center {
    text-align: center !important;
}

.ql-align-right {
    text-align: right !important;
}

.ql-align-left {
    text-align: left !important;
}

.ql-align-justify {
    text-align: justify !important;
}

.ql-bubble .ql-picker.ql-color .ql-picker-item {
    color: transparent !important;
    position: relative;
}

.ql-bubble .ql-picker.ql-font .ql-picker-item::before,
.ql-bubble .ql-picker.ql-size .ql-picker-item::before {
    content: "" !important;
}

.ql-bubble .ql-picker-label {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg {
    position: unset !important;
    margin-top: 0px !important;
}

.ql-bubble .ql-picker.ql-expanded .ql-picker-options {
    scrollbar-width: auto;
    max-height: 150px;
    overflow: hidden scroll;
    text-align: start;
}

.ql-bubble .ql-picker.ql-font .ql-picker-label::before,
.ql-bubble .ql-picker.ql-size .ql-picker-label::before {
    content: attr(data-value, 'Normal') !important;
    text-transform: capitalize;
    margin-right: 2px;
}

.ql-bubble .ql-picker.ql-font,
.ql-bubble .ql-picker.ql-size {
    width: max-content !important;
}

.select__bg:has(.ql-tooltip:not(.ql-hidden)),
.mygift__card__right:has(.ql-tooltip:not(.ql-hidden)) {
    overflow: unset;
}

.editable-text-wrapper {
    position: absolute;
    z-index: 11;
}

/* Editable Text */
.editable-text {
    padding: 5px 10px;
    font-size: 23px;
    outline: none;
    line-height: 1;
    position: absolute;
    color: #333;
    background-color: transparent;
    border-radius: 5px;
    border: none;
    max-width: 760px;
    word-wrap: break-word;
}

/* left: 50%;
        top: 100%;
        width: max-content;
        transform: translateX(-50%); */
.editable-text p {
    pointer-events: none;
}

/* Quill Toolbar & Editor Container */
#quill-toolbar {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 12;
    background: #fff;
    padding: 10px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
    z-index: 9999;
    max-height: 200px;
    overflow-y: scroll;
}

#quill-editor {
    border: 1px solid #ccc;
    min-height: 100px;
    padding: 10px;
    background: #fff;
}

.main__editor {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    max-width: 534px;
    width: 100%;
    background-color: #fff;
}

.ql-toolbar.ql-snow {
    padding: 5px 0 !important;
}

/* Action Icons */
.action-icons {
    display: flex;
    justify-content: center;
    z-index: 13 !important;
    gap: 10px;
    position: absolute;
}

.delete-btn,
.duplicate-btn {
    cursor: pointer;
    width: 30px;
    aspect-ratio: 1;
    background: #fff;
    border: 1px solid #333;
    border-radius: 50%;
    padding: 4px;
    margin-top: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Prevent Drag & Select on Right Panel */
.mygift__card__right * {
    user-drag: none;
    user-select: none;
}

.editable-text-wrapper .editable-text .ql-editor p {
    line-height: 1.7;
}

/* Quill Picker Override Label */
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
    content: 'Font Size';
}

/* -------------------------------------------------------------------------- */
/*                            Media Queries                                 */
/* -------------------------------------------------------------------------- */
/* For screens up to 1440px */
@media (max-width: 1440px) {
    .mygift__card__main {
        width: 96%;
        padding: 12px;
    }

    .giftCard__tab__child {
        font-size: 16px;
        padding: 12px 16px;
    }

    .duplicate-btn,
    .delete-btn {
        width: 24px;
    }

    .gift__card__btn button {
        max-width: 216px;
        font-size: 13px;
    }

    .mygift__card__wrpr {
        column-gap: 20px;
    }

    .editable-text {
        max-width: 500px;
    }
}

/* For screens between 768px and 1024px */
@media screen and (max-width: 1024px) {
    .editable-text {
        max-width: 320px;
    }

    .gift__card__btn {
        padding: 0 20px;
    }

    .gift__card__btn button {
        max-width: 170px;
    }

    .main__editor .ql-snow .ql-picker.ql-size {
        max-width: 70px;
    }

    .main__editor .ql-snow .ql-picker.ql-font {
        width: 120px !important;
    }

    .main__editor .ql-toolbar.ql-snow .ql-formats {
        margin-right: 0;
    }
}

/* For screens up to 767px */
@media (max-width: 767px) {
    .icon__tools__wrpr {
        position: unset;
        transform: unset;
        min-width: unset;
        padding: 10px 5px;
        align-items: center;
        justify-content: space-between;
        margin: 16px auto 4px;
        max-width: calc(100% - 16px);
        font-size: 14px;
        white-space: nowrap;
        overflow: scroll hidden;
    }

    .icon__tools__wrpr img {
        width: 20px;
    }

    .blend-mode,
    .flip-mode,
    .opacity-mode {
        padding: 0px 12px;
        column-gap: 6px;
        flex: 0 0 auto;
    }

    .template__card,
    .element__card,
    .text__card {
        border: 6px solid #f6f6f6;
    }

    .main__editor .ql-snow .ql-picker.ql-size {
        width: 70px;
    }

    .gift__card__btn button.active {
        z-index: 1;
    }

    .main__editor .ql-snow .ql-picker-label {
        padding-left: 0;
    }

    .main__editor .ql-snow .ql-picker {
        font-size: 11px;
    }

    .main__editor .ql-toolbar.ql-snow {
        padding: 2px 8px !important;
        display: flex;
    }

    .main__editor .ql-snow .ql-picker.ql-font {
        width: 128px !important;
    }

    .card__text__wrpr .text__card {
        min-height: 100px;
    }

    .resize-handle {
        position: absolute;
        width: 10px;
        height: 10px;
        background-color: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
    }

    .resize-handle.top {
        top: -5px;
        left: 50%;
        transform: translateX(-50%);
    }

    .resize-handle.bottom {
        bottom: -5px;
        left: 50%;
        transform: translateX(-50%);
    }

    .resize-handle.left {
        top: 50%;
        left: -5px;
        transform: translateY(-50%);
    }

    .resize-handle.right {
        top: 50%;
        right: -5px;
        transform: translateY(-50%);
    }

    .draggable-image,
    .draggable-image2 {
        touch-action: none;
    }

    .add__text__wrpr {
        font-size: 14px;
        max-width: calc(100% - 16px);
        margin: 0 auto 12px;
        padding: 14px 24px;
    }

    .discard-customization {
        font-size: 16px;
    }

    /* Additional adjustments for mobile layout */
    .mygift__card__main {
        flex-direction: column;
        padding: 0;
        margin-top: 20px;
    }

    .giftCard__tab__wrpr {
        gap: 10px;
        justify-content: center;
        max-width: calc(100% - 16px);
        margin: 20px auto 24px;
    }

    .mygift__card__right {
        order: 1;
        max-width: 100%;
        width: 100%;
        padding: 12px;
        flex-direction: column-reverse;
        align-items: center;
    }

    .mygift__card__left {
        order: 2;
        margin: 0 auto;
    }

    .gift__card__btn {
        order: 3;
        margin-top: auto;
        padding: 10px 0;
        text-align: center;
        justify-content: center;
    }

    .gift__card__btn button {
        max-width: 340px;
        width: 100%;
        aspect-ratio: 1 / 0.13529;
        font-size: 14px;
        font-weight: 500;
    }

    .mygift__card__wrpr {
        flex-direction: column;
    }

    /* Hide elements not needed in mobile */
    .gift-card-container-text,
    .custom__title,
    .cancle__btn,
    .cancle-btn {
        display: none;
    }
}

@media (max-width: 359px) {
    .giftCard__tab__child {
        font-size: 12px;
    }

    .card__background__wrpr {
        column-gap: 2px;
    }

    .ql-bubble .ql-tooltip {
        max-width: 280px;
    }

    .ql-bubble .ql-toolbar .ql-formats:first-child {
        margin-left: 0px;
    }

    .ql-bubble .ql-toolbar .ql-formats {
        margin: 6px 6px 6px 0;
    }
}