/*!
 * BBP External Image Button (BBP EIB) - CSS
 *
 * Description:
 * Styles for the custom "Insert Image" button modal in bbPress editors.
 */


/* ========================== */
/* BBP EIB Modal Overlay */
/* ========================== */
#bbp-eib-modal {
    z-index: 9999;
}

#bbp-eib-modal.bbp-eib-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal Content Box */
#bbp-eib-modal .bbp-eib-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 750px;
    max-width: 90%;
    position: relative;
    min-height: 55vh;
    display: flex;
    flex-direction: column;
}

/* Close Button */
#bbp-eib-modal .bbp-eib-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
}

/* Modal Actions & Tabs */
#bbp-eib-modal .bbp-eib-actions {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

#bbp-eib-modal .bbp-eib-tabs {
    position: relative;
    display: block;
    padding: 0;
    border-bottom: 1px solid #e0e0e0;
}

#bbp-eib-modal .bbp-eib-tabs > button {
    display: inline-block;
    text-decoration: none;
    line-height: 1;
    padding: 15px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #424f5a;
    border: none;
    background: transparent;
    text-align: center;
    cursor: pointer;
}

#bbp-eib-modal .bbp-eib-tabs > button.active {
    color: var(--bbpc_brand_color,#0866ff);
    font-weight: 600;
}

#bbp-eib-modal .bbp-eib-tabs > button:not(.active):hover {
    color: #7c848a;
}

/* Tab indicator bar */
#bbp-eib-modal .blue-bar {
    position: absolute;
    z-index: 10;
    bottom: 0;
    height: 3px;
    background: var(--bbpc_brand_color,#0866ff);
    display: block;
    left: 0;
    transition: left 0.2s ease;
}

#bbp-eib-modal .tab-btn[data-tab="upload"].active ~ .blue-bar {
    left: 0;
    width: 80px;
}

#bbp-eib-modal .tab-btn[data-tab="url"].active ~ .blue-bar {
    left: 82px;
    width: 157px;
}

/* Tab Content Areas */
#bbp-eib-modal .tab-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

/* Upload Tab */
#bbp-eib-modal .bbp-eib-upload-wrapper {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
    height: 100%;
    flex: 1;
    border: 2px dashed transparent;
    border-radius: 10px;
    transition: border-color 0.3s ease;
}

#bbp-eib-modal .bbp-eib-upload-wrapper.dragover {
    border-color: #e0e0e0;
}

/* Upload icon */
#bbp-eib-modal .bbp-eib-upload-wrapper img {
    margin-bottom: 12px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#bbp-eib-modal .bbp-eib-upload-wrapper img:hover {
    opacity: 1;
}

#bbp-eib-modal .bbp-eib-upload-wrapper .info {
    text-align: center;
    color: rgb(128, 134, 139);
    font-size: 20px;
    margin-top: 15px;
}

/* Browse Button */
#bbp-eib-modal .btn {
    display: inline-block;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background-color: var(--bbpc_brand_color,#0866ff);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#bbp-eib-modal .btn:hover {
    background-color: rgba(8, 102, 255, 0.8);
    transform: translateY(-1px);
}

#bbp-eib-modal .btn:active {
    transform: translateY(0);
}

/* File Input & Progress Bar */
#bbp-eib-modal .bbp-eib-input {
    width: 100%;
    padding: 6px;
    margin: 50px 0 8px;
    max-width: 450px;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0;
}

#bbp-eib-modal .bbp-eib-input:focus {
    outline: none;
    border-color: var(--bbpc_brand_color,#0866ff);
}

#bbp-eib-modal .progress-container {
    width: 100%;
    background: #eee;
    border-radius: 5px;
    margin-top: 10px;
}

#bbp-eib-modal .progress-bar {
    width: 0;
    height: 6px;
    background: var(--bbpc_brand_color,#0866ff);
    border-radius: 5px;
    transition: width 0.3s;
}

/* URL Tab */
#bbp-eib-modal .url-tab {
    text-align: center;
}

/* Preview Box */
#bbp-eib-modal #bbp-eib-preview {
    margin: 10px 0 20px;
    text-align: center;
}

#bbp-eib-modal #bbp-eib-preview img {
    display: block;
    margin: 0 auto;
    max-width: 50%;
}

/* Responsive */
@media only screen and (max-width: 520px) {
    #bbp-eib-modal .bbp-eib-tabs > button {
        font-size: 11px;
    }
}
