/**
 * Oz Reez License Modal - Styles
 * Dark theme with brand blue accents
 */

/* Modal Overlay */
.oz-reez-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 999998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2.5px);
    -webkit-backdrop-filter: blur(4px);
}

.oz-reez-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Modal Container */
.oz-reez-modal-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background-color: #111;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    margin: auto;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.oz-reez-modal-overlay.active .oz-reez-modal-container {
    transform: translateY(0);
}

/* Mobile: Slide up from bottom */
@media (max-width: 768px) {
    .oz-reez-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .oz-reez-modal-container {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        margin: 0;
        transform: translateY(100%);
    }
    
    .oz-reez-modal-overlay.active .oz-reez-modal-container {
        transform: translateY(0);
    }
}

/* Modal Header */
.oz-reez-modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* BEGIN MODAL UPDATE - Header content with thumbnail */
.oz-reez-modal-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.oz-reez-modal-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.oz-reez-modal-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #D8D8D8;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}
/* END MODAL UPDATE */

.oz-reez-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    opacity: 0.7;
}

.oz-reez-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.oz-reez-modal-close:focus {
    outline: 2px solid #3176CE;
    outline-offset: 2px;
}

/* Modal Body */
.oz-reez-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    position: relative;
    min-height: 200px;
}

/* Spinner Overlay for Loading State */
.oz-reez-modal-body .oz-filter-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #111111;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.oz-reez-modal-body .oz-filter-spinner-overlay.active {
    display: flex;
}

.oz-reez-modal-body .oz-filter-spinner {
    width: 35px;
    height: 35px;
    border: 7px solid rgba(255, 255, 255, 0.2);
    border-top-color: #d8d8d8;
    border-radius: 50%;
    animation: oz-modal-spin 0.8s linear infinite;
}

@keyframes oz-modal-spin {
    to {
        transform: rotate(360deg);
    }
}

/* License Options List */
.oz-reez-license-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oz-reez-license-item {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.oz-reez-license-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(49, 118, 206, 0.5);
}

.oz-reez-license-item.selected {
    background-color: rgba(49, 118, 206, 0.15);
    border-color: #3176CE;
}

.oz-reez-license-item.expanded {
    background-color: rgba(49, 118, 206, 0.1);
    border-color: rgba(49, 118, 206, 0.3);
}

.oz-reez-license-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.oz-reez-license-info {
    flex: 1;
}

.oz-reez-license-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #D8D8D8;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Most Popular Badge - Star Icon (circle with star cutout) */
.oz-reez-most-popular-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    vertical-align: middle;
}

.oz-reez-most-popular-badge svg {
    display: block;
    width: 18px;
    height: 18px;
}

.oz-reez-license-price {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #3176CE;
    margin: 0 0 12px 0;
}

/* Show Details Toggle */
.oz-reez-show-details-toggle {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    border: none;
    color: #b8b8b8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    margin: 0 0 8px 0;
    text-align: left;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.oz-reez-show-details-toggle:hover {
    color: #b8b8b8;
}

.oz-reez-show-details-toggle:focus {
    outline: 2px solid #D8D8D8;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ISSUE #8 FIX: Proper chevron icon styling */
.oz-reez-toggle-arrow {
    font-size: 20px;
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 2px;
    margin-top: 2px;
}

/* Rotate chevron when expanded */
.oz-reez-show-details-toggle[aria-expanded="true"] .oz-reez-toggle-arrow {
    transform: rotate(180deg);
}

/* Collapsible license descriptions */
.oz-reez-license-description-content {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.oz-reez-license-description-text {
    color: rgba(255, 255, 255, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

.oz-reez-license-description-text p {
    margin: 0 0 12px 0;
}

.oz-reez-license-description-text p:last-child {
    margin-bottom: 0;
}

.oz-reez-license-description-text ul,
.oz-reez-license-description-text ol {
    margin: 12px 0;
    padding-left: 20px;
}

.oz-reez-license-description-text li {
    margin-bottom: 6px;
}

.oz-reez-license-description-text li:last-child {
    margin-bottom: 0;
}

.oz-reez-license-select-btn {
    background-color: #3176CE;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oz-reez-license-select-btn:hover {
    background-color: #2a63ae;
    color: white;
}

.oz-reez-license-select-btn:active {
    transform: translateY(0);
}

.oz-reez-license-select-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.oz-reez-license-select-btn:focus {
    outline: 2px solid #3176CE;
    outline-offset: 2px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .oz-reez-modal-header {
        padding: 20px;
    }
    
    /* BEGIN MODAL UPDATE - Mobile header adjustments */
    .oz-reez-modal-header-content {
        gap: 12px;
    }
    
    .oz-reez-modal-thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .oz-reez-modal-title {
        font-size: 18px;
    }
    /* END MODAL UPDATE */
    
    .oz-reez-modal-body {
        padding: 20px;
    }
    
    .oz-reez-license-item {
        padding: 16px;
    }
    
    .oz-reez-license-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .oz-reez-license-select-btn {
        width: 100%;
    }
    
    .oz-reez-license-name {
        font-size: 16px;
    }
    
    .oz-reez-license-price {
        font-size: 18px;
    }
    
    /* Mobile description adjustments */
    .oz-reez-license-description-text {
        font-size: 13px;
    }
}

/* Success Toast */
.oz-reez-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #3176CE;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.oz-reez-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

@media (max-width: 768px) {
    .oz-reez-toast {
        left: 20px;
        right: 20px;
        transform: translateY(100px);
        width: auto;
    }
    
    .oz-reez-toast.show {
        transform: translateY(0);
    }
}

/* Error Message */
.oz-reez-error-message {
    background-color: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
}

/* Empty State */
.oz-reez-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
}

/* Scrollbar Styling */
.oz-reez-modal-body::-webkit-scrollbar {
    width: 8px;
}

.oz-reez-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.oz-reez-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.oz-reez-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Hide "View Cart" text/link and WooCommerce messages in modal */
.oz-reez-modal-body .woocommerce-message,
.oz-reez-modal-body .woocommerce-message a[href*="cart"],
.oz-reez-modal-body .wc-forward[href*="cart"],
.oz-reez-modal-overlay .woocommerce-message,
.oz-reez-modal-overlay .woocommerce-message a {
    display: none !important;
    visibility: hidden !important;
}

