/**
 * CusRev Username Warning Modal - Styles
 * 
 * Styling für das Popup, das bei generierten Benutzernamen erscheint
 * 
 * @version 1.0
 */

/* ========================================
   Modal Overlay & Container
   ======================================== */

.cusrev-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(2px);
    animation: cusrevFadeIn 0.2s ease-out;
}

.cusrev-modal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 20px 0;
}

.cusrev-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    position: relative;
    padding: 40px 30px 30px;
    animation: cusrevSlideUp 0.3s ease-out;
}

/* ========================================
   Modal Close Button
   ======================================== */

.cusrev-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.cusrev-modal-close:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.cusrev-modal-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ========================================
   Modal Icon
   ======================================== */

.cusrev-modal-icon {
    text-align: center;
    margin-bottom: 20px;
}

.cusrev-modal-icon svg {
    animation: cusrevPulse 2s ease-in-out infinite;
}

/* ========================================
   Modal Content
   ======================================== */

.cusrev-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 20px;
    text-align: center;
    line-height: 1.3;
}

.cusrev-modal-body {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.cusrev-modal-body p {
    margin: 0 0 12px;
}

.cusrev-modal-body p:last-child {
    margin-bottom: 0;
}

.cusrev-modal-body strong {
    color: #111827;
    font-weight: 600;
}

.cusrev-modal-hint {
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    margin-top: 16px !important;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* ========================================
   Modal Actions (Buttons)
   ======================================== */

.cusrev-modal-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.cusrev-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.4;
}

.cusrev-modal-btn-primary {
    background-color: #386f45;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cusrev-modal-btn-primary:hover {
    background-color: #386f45;
    color: #ffffff;
    transform: translateY(-1px);
}

.cusrev-modal-btn-primary:active {
    transform: translateY(0);
}

.cusrev-modal-btn-primary:focus {
    background-color: #386f45;
    color: #ffffff;
    outline-offset: 2px;
}

.cusrev-modal-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.cusrev-modal-btn-secondary:hover {
    background-color: #e5e7eb;
}

.cusrev-modal-btn-secondary:focus {
    outline: 2px solid #6b7280;
    outline-offset: 2px;
}

/* ========================================
   Loading State für Button
   ======================================== */

.cr-all-reviews-add-review.cusrev-checking {
    opacity: 0.7;
    cursor: wait;
    position: relative;
    pointer-events: none;
}

/* Button-Text und Inhalte ausblenden */
.cr-all-reviews-add-review.cusrev-checking {
    color: transparent !important;
    font-size: 0 !important;
}

/* Alle Kind-Elemente ausblenden */
.cr-all-reviews-add-review.cusrev-checking > *,
.cr-all-reviews-add-review.cusrev-checking span,
.cr-all-reviews-add-review.cusrev-checking svg,
.cr-all-reviews-add-review.cusrev-checking img {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Zentrierter Spinner - mit fester Farbe */
.cr-all-reviews-add-review.cusrev-checking::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid #e5e7eb;
    border-top-color: #386f45;
    border-radius: 50%;
    animation: cusrevSpin 0.8s linear infinite;
    opacity: 1 !important;
}

/* ========================================
   Body Lock (verhindert Scrollen)
   ======================================== */

body.cusrev-modal-open {
    overflow: hidden;
}

/* ========================================
   Animations
   ======================================== */

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

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

@keyframes cusrevPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes cusrevSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 640px) {
    .cusrev-modal-overlay {
        padding: 10px;
    }
    
    .cusrev-modal-content {
        padding: 30px 20px 20px;
        border-radius: 12px;
    }
    
    .cusrev-modal-title {
        font-size: 20px;
        margin-bottom: 16px;
    }
    
    .cusrev-modal-body {
        font-size: 14px;
    }
    
    .cusrev-modal-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .cusrev-modal-icon svg {
        width: 48px;
        height: 48px;
    }
}

@media (min-width: 641px) {
    .cusrev-modal-actions {
        flex-direction: row;
    }
    
    .cusrev-modal-btn {
        flex: 1;
    }
}


/* ========================================
   High Contrast Mode Support
   ======================================== */

@media (prefers-contrast: high) {
    .cusrev-modal-overlay {
        background-color: rgba(0, 0, 0, 0.9);
    }
    
    .cusrev-modal-btn {
        border: 2px solid currentColor;
    }
}

/* ========================================
   Reduced Motion Support
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .cusrev-modal-overlay,
    .cusrev-modal-content,
    .cusrev-modal-icon svg {
        animation: none;
    }
    
    .cusrev-modal-btn {
        transition: none;
    }
}


.cr-all-reviews-shortcode .cr-summaryBox-wrap .cr-add-review-wrap .cr-all-reviews-add-review, .cr-reviews-grid .cr-summaryBox-wrap .cr-add-review-wrap .cr-all-reviews-add-review {
    width: 230px;
}

/* ========================================
   WooCommerce Spinner Override
   Gleicher Stil wie cusrev-checking Spinner
   ======================================== */

/* --- CusRev Spinner Override (GIF → CSS) --- */

.cr-show-more-review-spinner,
.cr-show-more .cr-show-more-spinner,
.cr-all-reviews-shortcode .commentlist.cr-pagination-load .cr-pagination-review-spinner {
    display: block;
    margin: 20px auto;
    width: 20px;
    height: 20px;
    background: none !important;
    border: 3px solid #e5e7eb;
    border-top-color: #386f45;
    border-radius: 50%;
    animation: cusrevSpin 0.8s linear infinite;
}

/* --- WooCommerce blockUI Spinner --- */

.woocommerce .blockUI.blockOverlay,
.woocommerce-page .blockUI.blockOverlay {
    background-color: rgba(255, 255, 255, 0.7) !important;
    background-image: none !important;
}

.woocommerce .blockUI.blockOverlay::before,
.woocommerce-page .blockUI.blockOverlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid #e5e7eb;
    border-top-color: #386f45;
    border-radius: 50%;
    animation: cusrevSpin 0.8s linear infinite;
    z-index: 1;
}