  /* ===== Panel Override ===== */

.panel {
    width: 100%;
}

/* ===== Div Styles ===== */

.drop-container {
    min-height: 100px;
    flex: 1;
    border: 1px solid #a8d7fb;
    border-radius: 5px;
    padding: 20px;
    background-color: #d7eafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Center h4 when it's the only child */
.drop-container:has(h4:only-child) {
    justify-content: center;
}



/* ===== Input Drag Handle Styles ===== */

.input-drag-handle {
    display: block;
    padding: 0.35em 0.65em;
    font-size: 13px;
    font-weight: 700;
    color: #446E9B;
    background-color: white;
    border-radius: 5px;
    border: 1px solid #456e9b;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    cursor: move;
    text-align: left;
    margin-bottom: 5px;
    width: max-content !important;
    min-width: 100% !important;
}

.drag-helper-cleanup {
    background-color: #456e9b;
    color: white;
    border-radius: 5px;
    line-height: 1;
    padding: 0.35em 0.65em;
    font-size: 13px;
    min-width: auto !important;
    width: auto !important;
}

.input-drag-handle:hover {
    background-color: #456e9b;
    color: white;
}


/* ===== Drop Placeholder ===== */

.drop-placeholder {
    border: 2px dashed #ccc;
    height: 100px;
    /* Customize height as needed */
    background-color: rgba(200, 200, 200, 0.1);
    text-align: center;
    line-height: 100px;
    /* Adjust to match height */
    color: #aaa;
    font-size: 14px;
    margin-bottom: 10px;
    width: 100%;
}

.dragging {
    opacity: 0.7;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/*
.panel-heading {
    cursor: move;
}
*/


/* ===== Modal START ===== */

.white-popup {
    position: relative;
    background: #fff;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    margin: 20px auto;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.white-popup h2 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
}

.white-popup p {
    margin-bottom: 30px;
    color: #666;
}

.white-popup .btn {
    margin: 0 5px;
    padding: 8px 20px;
    font-size: 16px;
}

/* Magnific Popup background (dark overlay) */
.mfp-bg {
    background: rgba(0, 0, 0, 0.7);
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Zoom-in for the modal content */
.mfp-zoom-in .white-popup {
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* When modal is ready, zoom it to normal size */
.mfp-zoom-in.mfp-ready .white-popup {
    transform: scale(1);
    opacity: 1;
}

/* When modal is being removed, zoom it out */
.mfp-zoom-in.mfp-removing .white-popup {
    transform: scale(0.8);
    opacity: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .white-popup {
        width: 80%; /* Reduce width to 80% on smaller screens */
        padding: 20px; /* Adjust padding for better fit */
    }

    .white-popup h2 {
        font-size: 20px; /* Smaller heading for mobile */
        margin-bottom: 15px;
    }

    .white-popup p {
        font-size: 14px; /* Smaller text for mobile */
        margin-bottom: 20px;
    }

    .white-popup .btn {
        padding: 6px 15px; /* Adjust button padding */
        font-size: 14px; /* Smaller button text */
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .white-popup {
        width: 90%; /* Further reduce width for very small screens */
        padding: 15px; /* Reduce padding */
    }

    .white-popup h2 {
        font-size: 18px; /* Even smaller heading */
        margin-bottom: 10px;
    }

    .white-popup p {
        font-size: 12px; /* Even smaller text */
        margin-bottom: 15px;
    }

    .white-popup .btn {
        padding: 5px 12px; /* Even smaller button padding */
        font-size: 12px; /* Even smaller button text */
    }
}


/* ===== Modal END ===== */



/* Desktop view: Hide move up/down buttons */
@media (min-width: 768px) {
    .btn-group:has(.panel-move-up),
    .btn-group:has(.panel-move-down) {
        display: none !important;
    }

    .add-panel-button {
        display: none;
    }

    .main-button {
        display: none !important;
    }

    .main-container {
        display: flex; 
        align-items: flex-start; 
        justify-content: space-between; 
        gap: 20px;
    }


    .option-container .option-header {
        display: none;
    }
    
}

/* Mobile view: Ensure buttons are visible (optional, as default is visible) */
@media (max-width: 767.98px) {
    .btn-group:has(.panel-move-up),
    .btn-group:has(.panel-move-down) {
        display: block !important;
    }




    /* ===== Option Container ===== */


    .option-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 90%;
        background: #fff;
        padding: 16px;
        padding-top: 0;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
        z-index: 9999;

        overflow-y: auto;

        /* Initially hidden */
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;

        /* border: 1px solid red; */
    }

    /* When visible */
    .option-container.show {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .option-header {
        position: sticky;
        top: 0;
        background: #fff;
        height: 40px;
        margin: 5px 0;
        padding: 5px;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .drop-panel-position {
        display: none; /* Hidden by default */
        align-items: center;
        gap: 8px;
    }
    
    .close-option-container {
        display: flex;
        justify-content: flex-end; /* Keeps the button on the right */
        align-items: center;
        margin-left: auto; /* Ensure it stays at the far right */
    }


    .option-container .option-content {
        /* background-color: red; */
        display: flex;
        flex-direction: column;
        gap: 10px;
    }


    /* ===== Span ===== */


    .input-drag-handle {
        display: flex;
        align-items: center;
        gap: 8px; /* Space between icon and text */
        padding: 10px 14px;
        border: 1px solid #ccc;
        border-radius: 8px;
        background-color: #f8f9fa;
        margin-bottom: -5px !important;
        cursor: grab;
        width: 100%;
        font-size: 14px;
        font-weight: 500;
        color: #333;
        transition: box-shadow 0.2s ease, background-color 0.2s ease;
    }

    .input-drag-handle i {
        width: 16px; /* Force consistent icon width */
        text-align: center;
    }



    .input-drag-handle i {
        margin-right: 8px; /* Adds space between the icon and the text */
        font-size: 16px;
    }
}