/**
 * Thai Pronunciation Trainer - Feedback Button & Popup
 */

/* ==========================================================================
   BOUTON FEEDBACK FLOTTANT
   ========================================================================== */

.tpt-feedback-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(51, 65, 85, 0.9);
    color: white;
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(71, 85, 105, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 99999998;
}

.tpt-feedback-btn:hover {
    background: rgba(71, 85, 105, 0.95);
    transform: scale(1.03);
}

.tpt-feedback-btn-icon {
    font-size: 16px;
}

/* ==========================================================================
   POPUP OVERLAY
   ========================================================================== */

.tpt-feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 99999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tpt-feedback-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   POPUP
   ========================================================================== */

.tpt-feedback-popup {
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    border-radius: 20px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.tpt-feedback-overlay.show .tpt-feedback-popup {
    transform: scale(1) translateY(0);
}

/* Close button */
.tpt-feedback-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: rgba(148, 163, 184, 0.8);
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tpt-feedback-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.tpt-feedback-header {
    text-align: center;
    margin-bottom: 20px;
}

.tpt-feedback-header-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.tpt-feedback-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 0 0 4px 0;
}

.tpt-feedback-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* ==========================================================================
   FORM
   ========================================================================== */

.tpt-feedback-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tpt-feedback-label {
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: block;
}

/* Type buttons */
.tpt-feedback-types {
    display: flex;
    gap: 8px;
}

.tpt-feedback-type-btn {
    flex: 1;
    padding: 10px 12px;
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tpt-feedback-type-btn:hover {
    background: rgba(71, 85, 105, 0.5);
}

.tpt-feedback-type-btn.active-idea {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-color: #3b82f6;
    color: white;
}

.tpt-feedback-type-btn.active-problem {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-color: #f97316;
    color: white;
}

.tpt-feedback-type-btn.active-other {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border-color: #a855f7;
    color: white;
}

/* Textarea */
.tpt-feedback-textarea {
    width: 100%;
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 12px;
    padding: 12px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 100px;
    transition: all 0.2s ease;
}

.tpt-feedback-textarea::placeholder {
    color: #64748b;
}

.tpt-feedback-textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Submit button */
.tpt-feedback-submit {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.tpt-feedback-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    transform: translateY(-1px);
}

.tpt-feedback-submit:disabled {
    background: rgba(51, 65, 85, 0.5);
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==========================================================================
   SUCCESS STATE
   ========================================================================== */

.tpt-feedback-success {
    text-align: center;
    padding: 32px 16px;
}

.tpt-feedback-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.tpt-feedback-success-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 12px rgba(34, 197, 94, 0.4));
}

.tpt-feedback-success-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0 0 8px 0;
}

.tpt-feedback-success-text {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 480px) {
    .tpt-feedback-btn {
        bottom: 16px;
        right: 16px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .tpt-feedback-btn-text {
        display: none;
    }
    
    .tpt-feedback-btn-icon {
        font-size: 20px;
    }
    
    .tpt-feedback-overlay {
        padding: 12px;
        align-items: flex-end;
    }
    
    .tpt-feedback-popup {
        padding: 20px;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
    }
    
    .tpt-feedback-types {
        flex-direction: column;
        gap: 8px;
    }
    
    .tpt-feedback-type-btn {
        padding: 12px;
    }
    
    .tpt-feedback-header-icon {
        font-size: 28px;
    }
    
    .tpt-feedback-title {
        font-size: 16px;
    }
}