/* =====================================================
   TACTICO - Feedback System Styles
   Floating button, popup modal, and terms overlay
   ===================================================== */

/* =====================================================
   FLOATING FEEDBACK BUTTON
   ===================================================== */
.feedback-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    opacity: 0;
    transform: translateX(100px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-trigger.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.feedback-trigger-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 48px;
    background: linear-gradient(135deg, #00d4aa 0%, #00a8ff 100%);
    border: none;
    border-radius: 60px;
    color: white;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(0, 212, 170, 0.7),
                0 0 60px rgba(0, 212, 170, 0.5),
                0 0 90px rgba(0, 168, 255, 0.4),
                0 10px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    animation: feedbackGlow 1.5s ease-in-out infinite, feedbackBounce 2s ease-in-out infinite;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 2px;
    isolation: isolate; /* Contain stacking context to prevent canvas issues */
}

/* Outer glow ring */
.feedback-trigger-btn::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 60px;
    background: linear-gradient(135deg, #00d4aa 0%, #00a8ff 100%);
    z-index: -1;
    opacity: 0.5;
    animation: feedbackRing 1.5s ease-in-out infinite;
    pointer-events: none;
}

/* Extra outer pulse ring */
.feedback-trigger-btn::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 60px;
    border: 3px solid rgba(0, 212, 170, 0.6);
    z-index: -2;
    animation: feedbackPulseRing 1.5s ease-in-out infinite;
    pointer-events: none;
}

.feedback-trigger-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(0, 212, 170, 0.9),
                0 0 80px rgba(0, 212, 170, 0.7),
                0 0 120px rgba(0, 168, 255, 0.5),
                0 15px 50px rgba(0, 0, 0, 0.4);
}

.feedback-trigger-icon {
    font-size: 32px;
    animation: feedbackIconBounce 1s ease-in-out infinite;
}

.feedback-trigger-text {
    letter-spacing: 1.5px;
}

/* Main glow animation */
@keyframes feedbackGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 212, 170, 0.7),
                    0 0 60px rgba(0, 212, 170, 0.5),
                    0 0 90px rgba(0, 168, 255, 0.4),
                    0 10px 40px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 50px rgba(0, 212, 170, 1),
                    0 0 100px rgba(0, 212, 170, 0.7),
                    0 0 150px rgba(0, 168, 255, 0.6),
                    0 10px 40px rgba(0, 0, 0, 0.3);
    }
}

/* Subtle bounce animation */
@keyframes feedbackBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Inner ring pulse */
@keyframes feedbackRing {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.05);
    }
}

/* Outer pulse ring expanding */
@keyframes feedbackPulseRing {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.4);
    }
}

/* Soccer ball icon bounce */
@keyframes feedbackIconBounce {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* =====================================================
   FEEDBACK POPUP OVERLAY
   ===================================================== */
.feedback-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.feedback-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* =====================================================
   FEEDBACK MODAL
   ===================================================== */
.feedback-modal {
    background: linear-gradient(180deg, #1a2332 0%, #0d1117 100%);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5),
                0 0 60px rgba(0, 212, 170, 0.1);
}

.feedback-overlay.active .feedback-modal {
    transform: scale(1) translateY(0);
}

.feedback-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #a0aec0;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.feedback-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

.feedback-modal h2 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: #ffffff;
}

.feedback-subtitle {
    text-align: center;
    color: #a0aec0;
    font-size: 14px;
    margin-bottom: 24px;
}

/* =====================================================
   SOCCER BALL RATING
   ===================================================== */
.feedback-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.feedback-rating button {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    filter: grayscale(100%) opacity(0.4);
    transition: all 0.2s ease;
    padding: 4px;
}

.feedback-rating button:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.2);
}

.feedback-rating button.selected {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

.feedback-rating button.filled {
    filter: grayscale(0%) opacity(1);
}

.rating-label {
    text-align: center;
    font-size: 14px;
    color: #00d4aa;
    margin-bottom: 24px;
    min-height: 20px;
    font-weight: 500;
}

/* =====================================================
   FORM FIELDS
   ===================================================== */
.feedback-field {
    margin-bottom: 16px;
}

.feedback-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.feedback-field textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
}

.feedback-field textarea:focus {
    outline: none;
    border-color: rgba(0, 212, 170, 0.5);
}

.feedback-field textarea::placeholder {
    color: #718096;
}

/* =====================================================
   TERMS CHECKBOX
   ===================================================== */
.feedback-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #a0aec0;
}

.feedback-terms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #00d4aa;
    cursor: pointer;
    flex-shrink: 0;
}

.feedback-terms span {
    line-height: 1.4;
}

.feedback-terms a {
    color: #00d4aa;
    text-decoration: none;
}

.feedback-terms a:hover {
    text-decoration: underline;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.feedback-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #00d4aa 0%, #00a8ff 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 12px;
}

.feedback-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.4);
}

.feedback-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.feedback-cancel {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #a0aec0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.feedback-never-show {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-never-show:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
}

/* =====================================================
   SUCCESS STATE
   ===================================================== */
.feedback-success {
    text-align: center;
    padding: 20px 0;
}

.feedback-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.feedback-success h3 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.feedback-success p {
    color: #a0aec0;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.feedback-success .feedback-close-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #00d4aa 0%, #00a8ff 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-success .feedback-close-btn:hover {
    transform: scale(1.05);
}

/* =====================================================
   TERMS MODAL OVERLAY
   ===================================================== */
.feedback-terms-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.feedback-terms-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.feedback-terms-modal {
    background: #1a2332;
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}

.feedback-terms-modal h3 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    padding-right: 40px;
}

.terms-content {
    color: #a0aec0;
    font-size: 13px;
    line-height: 1.7;
}

.terms-content h4 {
    color: #00d4aa;
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 8px 0;
}

.terms-content h4:first-child {
    margin-top: 0;
}

.terms-content p {
    margin-bottom: 8px;
}

.terms-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.terms-content li {
    margin-bottom: 4px;
}

.feedback-terms-accept {
    width: 100%;
    margin-top: 20px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #00d4aa 0%, #00a8ff 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-terms-accept:hover {
    transform: scale(1.02);
}

/* =====================================================
   MOBILE RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .feedback-trigger {
        bottom: 80px; /* Above mobile toolbar */
        right: 16px;
    }

    .feedback-trigger-btn {
        padding: 14px 24px;
        font-size: 15px;
        gap: 10px;
    }

    .feedback-trigger-icon {
        font-size: 20px;
    }

    .feedback-modal {
        padding: 24px 20px;
        max-width: 95%;
    }

    .feedback-icon {
        font-size: 40px;
    }

    .feedback-modal h2 {
        font-size: 20px;
    }

    .feedback-rating button {
        font-size: 28px;
    }

    .feedback-field textarea {
        min-height: 70px;
    }
}

@media (max-width: 480px) {
    .feedback-trigger {
        bottom: 76px;
        right: 12px;
    }

    .feedback-trigger-btn {
        padding: 12px 20px;
        font-size: 14px;
        gap: 8px;
    }

    .feedback-trigger-btn::before {
        inset: -3px;
    }

    .feedback-trigger-btn::after {
        inset: -6px;
    }

    .feedback-modal {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .feedback-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }

    .feedback-modal h2 {
        font-size: 18px;
    }

    .feedback-rating button {
        font-size: 24px;
        padding: 2px;
    }

    .feedback-rating {
        gap: 4px;
    }
}

/* Safe area for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .feedback-trigger {
        bottom: calc(24px + env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .feedback-trigger {
            bottom: calc(80px + env(safe-area-inset-bottom));
        }
    }
}
