/**
 * NEXA KPI Survey Widget Styles
 * 
 * Styles for NPS and Satisfaction survey modals.
 * 
 * @package NexaKPI
 */

/* ======================================
   Survey Overlay
   ====================================== */
.nexa-survey-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.nexa-survey-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ======================================
   Survey Modal
   ====================================== */
.nexa-survey-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 100%;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.nexa-survey-overlay.show .nexa-survey-modal {
    transform: translateY(0) scale(1);
}

/* ======================================
   Header
   ====================================== */
.nexa-survey-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.nexa-survey-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.nexa-survey-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.nexa-survey-close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ======================================
   Body
   ====================================== */
.nexa-survey-body {
    padding: 24px;
}

.nexa-survey-question {
    margin: 0 0 20px 0;
    font-size: 15px;
    color: #6b7280;
    line-height: 1.5;
}

/* ======================================
   Star Rating (Satisfaction)
   ====================================== */
.nexa-survey-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.nexa-survey-star {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.nexa-survey-star svg {
    fill: #d1d5db;
    stroke: #d1d5db;
    stroke-width: 1;
    transition: all 0.2s;
}

.nexa-survey-star:hover svg,
.nexa-survey-star.highlight svg {
    fill: #fcd34d;
    stroke: #fbbf24;
    transform: scale(1.1);
}

.nexa-survey-star.filled svg,
.nexa-survey-star.selected svg {
    fill: #fbbf24;
    stroke: #f59e0b;
}

.nexa-survey-star-label {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    min-height: 20px;
    margin-bottom: 16px;
}

/* ======================================
   NPS Scale
   ====================================== */
.nexa-survey-nps-scale {
    margin-bottom: 20px;
}

.nexa-survey-nps-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: #9ca3af;
}

.nexa-survey-nps-buttons {
    display: flex;
    gap: 4px;
}

.nexa-survey-nps-btn {
    flex: 1;
    padding: 12px 4px;
    border: 2px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.nexa-survey-nps-btn:hover {
    border-color: #9ca3af;
    transform: translateY(-2px);
}

.nexa-survey-nps-btn.detractor {
    border-color: #fecaca;
    color: #dc2626;
}

.nexa-survey-nps-btn.detractor:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.nexa-survey-nps-btn.detractor.selected {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.nexa-survey-nps-btn.passive {
    border-color: #fde68a;
    color: #d97706;
}

.nexa-survey-nps-btn.passive:hover {
    background: #fffbeb;
    border-color: #f59e0b;
}

.nexa-survey-nps-btn.passive.selected {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

.nexa-survey-nps-btn.promoter {
    border-color: #bbf7d0;
    color: #059669;
}

.nexa-survey-nps-btn.promoter:hover {
    background: #ecfdf5;
    border-color: #10b981;
}

.nexa-survey-nps-btn.promoter.selected {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

/* ======================================
   Comment Field
   ====================================== */
.nexa-survey-comment {
    margin-top: 20px;
}

.nexa-survey-comment label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.nexa-survey-comment textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    resize: vertical;
    transition: border-color 0.2s;
    font-family: inherit;
}

.nexa-survey-comment textarea:focus {
    outline: none;
    border-color: #1e0e4a;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.nexa-survey-comment textarea::placeholder {
    color: #9ca3af;
}

/* ======================================
   Footer
   ====================================== */
.nexa-survey-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.nexa-survey-skip {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.nexa-survey-skip:hover {
    color: #374151;
}

.nexa-survey-submit {
    padding: 10px 24px;
    border: none;
    background: #fff;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.nexa-survey-submit:hover:not(:disabled) {
    background: #f9fafb;
}

.nexa-survey-submit:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* ======================================
   Thank You State
   ====================================== */
.nexa-survey-thankyou {
    text-align: center;
    padding: 48px 24px;
}

.nexa-survey-thankyou-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    animation: nexa-survey-pop 0.3s ease;
}

@keyframes nexa-survey-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.nexa-survey-thankyou h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.nexa-survey-close-btn {
    padding: 10px 24px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.nexa-survey-close-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* ======================================
   Inline Survey Widget (non-modal)
   ====================================== */
.nexa-survey-inline {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
}

.nexa-survey-inline .nexa-survey-header {
    padding: 0 0 16px 0;
    border-bottom: none;
}

.nexa-survey-inline .nexa-survey-body {
    padding: 0;
}

.nexa-survey-inline .nexa-survey-footer {
    padding: 16px 0 0 0;
    border-top: none;
    background: transparent;
}

.nexa-survey-inline .nexa-survey-close {
    display: none;
}

/* ======================================
   Responsive Design
   ====================================== */
@media (max-width: 540px) {
    .nexa-survey-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .nexa-survey-modal {
        border-radius: 16px 16px 0 0;
        max-width: 100%;
        transform: translateY(100%);
    }
    
    .nexa-survey-overlay.show .nexa-survey-modal {
        transform: translateY(0);
    }
    
    .nexa-survey-nps-buttons {
        flex-wrap: wrap;
    }
    
    .nexa-survey-nps-btn {
        flex: 0 0 calc(20% - 4px);
        padding: 10px 2px;
        font-size: 12px;
    }
    
    .nexa-survey-stars {
        gap: 4px;
    }
    
    .nexa-survey-star svg {
        width: 28px;
        height: 28px;
    }
}

/* ======================================
   Dark Mode Support
   ====================================== */
@media (prefers-color-scheme: dark) {
    .nexa-survey-modal {
        background: #1f2937;
    }
    
    .nexa-survey-header {
        border-color: #374151;
    }
    
    .nexa-survey-header h3 {
        color: #f9fafb;
    }
    
    .nexa-survey-close {
        background: #374151;
        color: #9ca3af;
    }
    
    .nexa-survey-close:hover {
        background: #4b5563;
        color: #f3f4f6;
    }
    
    .nexa-survey-question {
        color: #d1d5db;
    }
    
    .nexa-survey-star svg {
        fill: #4b5563;
        stroke: #4b5563;
    }
    
    .nexa-survey-nps-btn {
        background: #374151;
        border-color: #6b7280;
        color: #e5e7eb;
    }
    
    .nexa-survey-comment label {
        color: #e5e7eb;
    }
    
    .nexa-survey-comment textarea {
        background: #374151;
        border-color: #6b7280;
        color: #f3f4f6;
    }
    
    .nexa-survey-comment textarea::placeholder {
        color: #6b7280;
    }
    
    .nexa-survey-footer {
        background: #111827;
        border-color: #374151;
    }
    
    .nexa-survey-skip {
        color: #9ca3af;
    }
    
    .nexa-survey-skip:hover {
        color: #e5e7eb;
    }
    
    .nexa-survey-thankyou h3 {
        color: #f9fafb;
    }
    
    .nexa-survey-close-btn {
        background: #374151;
        border-color: #6b7280;
        color: #e5e7eb;
    }
    
    .nexa-survey-close-btn:hover {
        background: #4b5563;
    }
}

/* ======================================
   Animation Utilities
   ====================================== */
@keyframes nexa-survey-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.nexa-survey-error {
    animation: nexa-survey-shake 0.3s ease;
}

/* ======================================
   Print Styles
   ====================================== */
@media print {
    .nexa-survey-overlay {
        display: none !important;
    }
}
