/**
 * WPApps Smart Review - Frontend Styles
 * Author: Hefin Dsouza
 * Company: WPApps.net
 * Version: 1.0.0
 */

/* ===========================================
   RESET & BASE STYLES
   =========================================== */
.wpapps-sr-modal *,
.wpapps-sr-widget * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================================
   STAR STYLES
   =========================================== */
.wpapps-sr-stars {
    display: inline-block;
    font-size: 20px;
    line-height: 1;
}

.wpapps-sr-star {
    display: inline-block;
    margin: 0 2px;
    transition: transform 0.2s ease;
}

/* Different star styles */
.wpapps-sr-style-hearts .wpapps-sr-star {
    font-size: 18px;
}

.wpapps-sr-style-circles .wpapps-sr-star {
    font-size: 16px;
}

.wpapps-sr-style-squares .wpapps-sr-star {
    font-size: 14px;
}

.wpapps-sr-style-thumbs .wpapps-sr-star {
    font-size: 16px;
}

.wpapps-sr-style-smileys .wpapps-sr-star {
    font-size: 16px;
}

/* ===========================================
   MODAL OVERLAY
   =========================================== */
.wpapps-sr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wpapps-sr-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Animation variations */
.wpapps-sr-modal-overlay.fade .wpapps-sr-modal-content {
    transition: opacity 0.3s ease;
}

.wpapps-sr-modal-overlay.slide .wpapps-sr-modal-content {
    transform: translateY(-50px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.wpapps-sr-modal-overlay.zoom .wpapps-sr-modal-content {
    transform: scale(0.9);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.wpapps-sr-modal-overlay.active.slide .wpapps-sr-modal-content {
    transform: translateY(0);
}

.wpapps-sr-modal-overlay.active.zoom .wpapps-sr-modal-content {
    transform: scale(1);
}

/* ===========================================
   MODAL CONTENT
   =========================================== */
.wpapps-sr-modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.wpapps-sr-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.wpapps-sr-modal-close:hover {
    background: #f0f0f0;
    transform: rotate(90deg);
}

/* ===========================================
   RATING WIDGET CORE
   =========================================== */
.wpapps-sr-widget {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wpapps-sr-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.wpapps-sr-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
}

/* ===========================================
   STAR RATING SYSTEM
   Trustpilot Color System Implementation
   =========================================== */
.wpapps-sr-stars-container {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin: 25px 0;
}

.wpapps-sr-star {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ddd;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 2px;
    user-select: none;
}

/* Star size variations */
.wpapps-sr-size-small .wpapps-sr-star {
    width: 35px;
    height: 35px;
    font-size: 22px;
}

.wpapps-sr-size-large .wpapps-sr-star {
    width: 55px;
    height: 55px;
    font-size: 34px;
}

.wpapps-sr-star:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Trustpilot Authentic Colors */
.wpapps-sr-star.rating-1 { background: #ff1744 !important; }
.wpapps-sr-star.rating-2 { background: #ff6d00 !important; }
.wpapps-sr-star.rating-3 { background: #ffc400 !important; }
.wpapps-sr-star.rating-4 { background: #66bb6a !important; }
.wpapps-sr-star.rating-5 { background: #00b67a !important; }

/* ===========================================
   RATING LABELS
   =========================================== */
.wpapps-sr-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    margin: 10px 0 25px 0;
    color: #666;
}

.wpapps-sr-size-small .wpapps-sr-labels {
    font-size: 11px;
}

.wpapps-sr-size-large .wpapps-sr-labels {
    font-size: 13px;
}

/* ===========================================
   FEEDBACK SECTION
   =========================================== */
.wpapps-sr-feedback-section {
    margin-top: 25px;
}

.wpapps-sr-feedback-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
    background-color: white;
}

.wpapps-sr-feedback-textarea:focus {
    outline: none;
    border-color: #00B67A;
    box-shadow: 0 0 0 3px rgba(0, 182, 122, 0.1);
}

.wpapps-sr-char-counter {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.wpapps-sr-char-counter.warning {
    color: #ff6d00;
}

.wpapps-sr-char-counter.error {
    color: #ff1744;
}

/* ===========================================
   SUBMIT BUTTON
   =========================================== */
.wpapps-sr-submit-btn {
    background: #00B67A;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
    width: 100%;
}

.wpapps-sr-submit-btn:hover {
    background: #009963;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 182, 122, 0.3);
}

.wpapps-sr-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ===========================================
   LOADING INDICATOR
   =========================================== */
.wpapps-sr-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #00B67A;
    border-radius: 50%;
    animation: wpapps-sr-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes wpapps-sr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================================
   SUCCESS & FEEDBACK MESSAGES
   =========================================== */
.wpapps-sr-message {
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

.wpapps-sr-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wpapps-sr-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wpapps-sr-celebration {
    text-align: center;
    padding: 40px 20px;
}

.wpapps-sr-celebration-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.wpapps-sr-celebration-title {
    color: #00B67A;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.wpapps-sr-celebration-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.wpapps-sr-redirect-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.wpapps-sr-redirect-info small {
    color: #666;
    font-size: 13px;
}

.wpapps-sr-trustpilot-link {
    display: inline-block;
    background: #00B67A;
    color: white !important;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.wpapps-sr-trustpilot-link:hover {
    background: #009963;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 182, 122, 0.3);
    text-decoration: none;
    color: white !important;
}

/* ===========================================
   TRIGGER BUTTON
   =========================================== */
.smart-rating-trigger {
    display: inline-block;
    padding: 12px 24px;
    background: #00B67A !important;
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.smart-rating-trigger:hover {
    background: #009963 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 182, 122, 0.3);
}

/* Integration with other plugins */
button.smart-rating-trigger,
a.smart-rating-trigger,
.button.smart-rating-trigger {
    cursor: pointer !important;
}

/* ===========================================
   TEMPLATE VARIATIONS
   =========================================== */

/* Trustpilot Template */
.wpapps-sr-template-trustpilot {
    /* Default styles */
}

/* Minimalist Template */
.wpapps-sr-template-minimalist .wpapps-sr-star {
    border-radius: 50%;
    gap: 8px;
}

.wpapps-sr-template-minimalist .wpapps-sr-modal-content {
    border-radius: 8px;
}

.wpapps-sr-template-minimalist .wpapps-sr-submit-btn {
    border-radius: 4px;
    padding: 10px 20px;
}

/* Colorful Template */
.wpapps-sr-template-colorful .wpapps-sr-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.wpapps-sr-template-colorful .wpapps-sr-title,
.wpapps-sr-template-colorful .wpapps-sr-subtitle {
    color: white;
}

.wpapps-sr-template-colorful .wpapps-sr-star {
    background: rgba(255, 255, 255, 0.3);
}

/* Corporate Template */
.wpapps-sr-template-corporate .wpapps-sr-modal-content {
    border-radius: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.wpapps-sr-template-corporate .wpapps-sr-star {
    border-radius: 0;
}

.wpapps-sr-template-corporate .wpapps-sr-submit-btn {
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===========================================
   ACCESSIBILITY
   =========================================== */
.wpapps-sr-star:focus {
    outline: 2px solid #00B67A;
    outline-offset: 2px;
}

.wpapps-sr-modal-close:focus {
    outline: 2px solid #00B67A;
    outline-offset: 2px;
}

.wpapps-sr-submit-btn:focus {
    outline: 2px solid #00B67A;
    outline-offset: 2px;
}

/* Screen reader only text */
.wpapps-sr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */
@media (max-width: 768px) {
    .wpapps-sr-modal-content {
        margin: 20px;
        padding: 20px;
        width: calc(100% - 40px);
    }
    
    .wpapps-sr-stars-container {
        gap: 2px;
    }
    
    .wpapps-sr-star {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .wpapps-sr-size-large .wpapps-sr-star {
        width: 45px;
        height: 45px;
        font-size: 28px;
    }
    
    .wpapps-sr-labels {
        font-size: 11px;
    }
    
    .wpapps-sr-title {
        font-size: 20px;
    }
    
    .wpapps-sr-subtitle {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .wpapps-sr-star {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .wpapps-sr-labels span {
        font-size: 10px;
    }
}

/* ===========================================
   PRINT STYLES
   =========================================== */
@media print {
    .wpapps-sr-modal-overlay,
    .smart-rating-trigger {
        display: none !important;
    }
}

/* ===========================================
   RTL SUPPORT
   =========================================== */
.rtl .wpapps-sr-modal-close {
    right: auto;
    left: 20px;
}

.rtl .wpapps-sr-char-counter {
    text-align: left;
}

.rtl .wpapps-sr-labels {
    direction: rtl;
}