/* Modal Button Widget */
.wjcc-modal-btn-wrapper {
    display: inline-block;
    position: relative;
}

.wjcc-modal-btn-wrapper .wjcc-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

/* Button sizes */
.wjcc-modal-btn-wrapper .wjcc-modal-btn--xs {
    font-size: 13px;
}
.wjcc-modal-btn-wrapper .wjcc-modal-btn--sm {
    font-size: 14px;
    padding: 12px 24px;
}
.wjcc-modal-btn-wrapper .wjcc-modal-btn--md {
    font-size: 16px;
    padding: 15px 30px;
}
.wjcc-modal-btn-wrapper .wjcc-modal-btn--lg {
    font-size: 18px;
    padding: 18px 40px;
}
.wjcc-modal-btn-wrapper .wjcc-modal-btn--xl {
    font-size: 20px;
    padding: 20px 50px;
}

/* Dropdown Menu */
.wjcc-modal-btn-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    min-width: 200px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.25s ease;
    padding: 8px 0;
}

.wjcc-modal-btn-wrapper:hover .wjcc-modal-btn-dropdown,
.wjcc-modal-btn-wrapper.wjcc-dropdown-open .wjcc-modal-btn-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wjcc-modal-btn-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wjcc-modal-btn-dropdown ul li {
    margin: 0;
    padding: 0;
}

.wjcc-modal-btn-dropdown ul li a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.wjcc-modal-btn-dropdown ul li a:hover {
    background: #f5f5f5;
    color: #000;
}

/* Sub-menus */
.wjcc-modal-btn-dropdown ul li.menu-item-has-children {
    position: relative;
}

.wjcc-modal-btn-dropdown ul li.menu-item-has-children > .sub-menu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 180px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(5px);
    transition: all 0.25s ease;
    padding: 8px 0;
}

.wjcc-modal-btn-dropdown ul li.menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Modal Overlay */
.wjcc-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    justify-content: center;
    align-items: center;
    animation: wjccFadeIn 0.3s ease;
}

.wjcc-modal-overlay.wjcc-modal-active {
    display: flex;
}

@keyframes wjccFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wjccSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal Container */
.wjcc-modal-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: wjccSlideUp 0.3s ease;
}

/* Modal Close Button */
.wjcc-modal-close {
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.wjcc-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Modal Body */
.wjcc-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.wjcc-modal-embed {
    position: relative;
    min-height: 200px;
}

/* Loading spinner */
.wjcc-modal-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.wjcc-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e5e5;
    border-top-color: #c2272d;
    border-radius: 50%;
    animation: wjccSpin 0.7s linear infinite;
}

@keyframes wjccSpin {
    to { transform: rotate(360deg); }
}

.wjcc-modal-embed.wjcc-embed-loaded .wjcc-modal-loader {
    display: none;
}

/* Modal Footer */
.wjcc-modal-footer {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

.wjcc-modal-footer .wjcc-modal-learn-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .wjcc-modal-container {
        width: 95vw !important;
        height: 85vh !important;
        max-height: 85vh;
    }

    .wjcc-modal-btn-dropdown {
        min-width: 160px;
    }
}
