/**
 * Feedback Modal Styles
 * Floating button and modal for user feedback
 */

/* ============================================================================
   TOP BAR FEEDBACK BUTTON
   ============================================================================ */

.feedback-top-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-right: 2rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-top-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.feedback-top-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

.feedback-top-btn svg {
    flex-shrink: 0;
}

.feedback-top-btn__text {
    white-space: nowrap;
}

/* Mobile: icon only */
@media (max-width: 600px) {
    .feedback-top-btn {
        padding: 8px;
        margin-right: 0.5rem;
    }

    .feedback-top-btn__text {
        display: none;
    }
}

/* ============================================================================
   MODAL OVERLAY
   ============================================================================ */

.feedback-modal-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;
    padding: 20px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* ============================================================================
   MODAL
   ============================================================================ */

.feedback-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

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

/* Header */
.feedback-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
}

.feedback-modal__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.feedback-modal__title svg {
    color: #368BC1;
}

.feedback-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f8f9fa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
}

.feedback-modal__close:hover {
    background: #e9ecef;
    color: #212529;
}

/* Form */
.feedback-modal__form {
    padding: 24px;
}

.feedback-modal__field {
    margin-bottom: 20px;
}

.feedback-modal__field--optional {
    margin-bottom: 24px;
}

.feedback-modal__label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.feedback-modal__label-hint {
    font-weight: 400;
    color: #6c757d;
    font-size: 0.85rem;
}

/* Feedback Type Selection */
.feedback-modal__type-group {
    margin-bottom: 24px;
}

.feedback-modal__type-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

.feedback-modal__type-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.feedback-type-option {
    cursor: pointer;
}

.feedback-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.feedback-type-option__box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;
}

.feedback-type-option__box svg {
    flex-shrink: 0;
    color: #6c757d;
}

.feedback-type-option input:checked + .feedback-type-option__box {
    background: #e7f3fa;
    border-color: #368BC1;
    color: #368BC1;
}

.feedback-type-option input:checked + .feedback-type-option__box svg {
    color: #368BC1;
}

.feedback-type-option:hover .feedback-type-option__box {
    border-color: #adb5bd;
}

/* Textarea */
.feedback-modal__textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feedback-modal__textarea:focus {
    outline: none;
    border-color: #368BC1;
    box-shadow: 0 0 0 3px rgba(54, 139, 193, 0.15);
}

.feedback-modal__textarea::placeholder {
    color: #adb5bd;
}

.feedback-modal__char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 6px;
}

/* Input */
.feedback-modal__input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feedback-modal__input:focus {
    outline: none;
    border-color: #368BC1;
    box-shadow: 0 0 0 3px rgba(54, 139, 193, 0.15);
}

.feedback-modal__input::placeholder {
    color: #adb5bd;
}

/* Actions */
.feedback-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

.feedback-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-modal__btn--primary {
    background: linear-gradient(135deg, #368BC1 0%, #2d7ab0 100%);
    color: white;
}

.feedback-modal__btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(54, 139, 193, 0.4);
}

.feedback-modal__btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-modal__btn--secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.feedback-modal__btn--secondary:hover {
    background: #e9ecef;
}

.feedback-modal__btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Spinner animation */
.feedback-spinner {
    animation: feedback-spin 1s linear infinite;
}

@keyframes feedback-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

.feedback-modal__success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 24px;
}

.feedback-modal__success-icon {
    color: #28a745;
    margin-bottom: 20px;
}

.feedback-modal__success-icon svg {
    width: 64px;
    height: 64px;
}

.feedback-modal__success-title {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
}

.feedback-modal__success-text {
    margin: 0 0 24px;
    font-size: 1rem;
    color: #6c757d;
    line-height: 1.6;
}

/* ============================================================================
   MOBILE STYLES
   ============================================================================ */

@media (max-width: 600px) {
    .feedback-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .feedback-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

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

    .feedback-modal__header {
        padding: 16px 20px;
    }

    .feedback-modal__form {
        padding: 20px;
    }

    .feedback-modal__type-options {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .feedback-type-option__box {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .feedback-modal__actions {
        flex-direction: column-reverse;
    }

    .feedback-modal__btn {
        width: 100%;
    }
}

/* ============================================================================
   DARK MODE STYLES
   ============================================================================ */

/* Manual dark mode */
html.dark-mode .feedback-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

html.dark-mode .feedback-modal {
    background: #1a1d23;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

html.dark-mode .feedback-modal__header {
    border-bottom-color: #363c47;
}

html.dark-mode .feedback-modal__title {
    color: #f3f4f6;
}

html.dark-mode .feedback-modal__title svg {
    color: #4a9ed4;
}

html.dark-mode .feedback-modal__close {
    background: #22262e;
    color: #9ca3af;
}

html.dark-mode .feedback-modal__close:hover {
    background: #363c47;
    color: #f3f4f6;
}

html.dark-mode .feedback-modal__label,
html.dark-mode .feedback-modal__type-label {
    color: #d1d5db;
}

html.dark-mode .feedback-modal__label-hint {
    color: #9ca3af;
}

html.dark-mode .feedback-type-option__box {
    background: #22262e;
    border-color: #363c47;
    color: #d1d5db;
}

html.dark-mode .feedback-type-option__box svg {
    color: #9ca3af;
}

html.dark-mode .feedback-type-option:hover .feedback-type-option__box {
    border-color: #4b5563;
}

html.dark-mode .feedback-type-option input:checked + .feedback-type-option__box {
    background: #1e3a5f;
    border-color: #4a9ed4;
    color: #60a5fa;
}

html.dark-mode .feedback-type-option input:checked + .feedback-type-option__box svg {
    color: #60a5fa;
}

html.dark-mode .feedback-modal__textarea,
html.dark-mode .feedback-modal__input {
    background: #22262e;
    border-color: #363c47;
    color: #f3f4f6;
}

html.dark-mode .feedback-modal__textarea:focus,
html.dark-mode .feedback-modal__input:focus {
    border-color: #4a9ed4;
    box-shadow: 0 0 0 3px rgba(74, 158, 212, 0.2);
}

html.dark-mode .feedback-modal__textarea::placeholder,
html.dark-mode .feedback-modal__input::placeholder {
    color: #6b7280;
}

html.dark-mode .feedback-modal__char-count {
    color: #9ca3af;
}

html.dark-mode .feedback-modal__btn--secondary {
    background: #22262e;
    color: #d1d5db;
    border-color: #363c47;
}

html.dark-mode .feedback-modal__btn--secondary:hover {
    background: #363c47;
}

html.dark-mode .feedback-modal__success-title {
    color: #f3f4f6;
}

html.dark-mode .feedback-modal__success-text {
    color: #9ca3af;
}

html.dark-mode .feedback-modal__success-icon {
    color: #4ade80;
}

/* Auto dark mode */
@media (prefers-color-scheme: dark) {
    html.dark-mode-auto .feedback-modal-overlay {
        background: rgba(0, 0, 0, 0.7);
    }

    html.dark-mode-auto .feedback-modal {
        background: #1a1d23;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }

    html.dark-mode-auto .feedback-modal__header {
        border-bottom-color: #363c47;
    }

    html.dark-mode-auto .feedback-modal__title {
        color: #f3f4f6;
    }

    html.dark-mode-auto .feedback-modal__title svg {
        color: #4a9ed4;
    }

    html.dark-mode-auto .feedback-modal__close {
        background: #22262e;
        color: #9ca3af;
    }

    html.dark-mode-auto .feedback-modal__close:hover {
        background: #363c47;
        color: #f3f4f6;
    }

    html.dark-mode-auto .feedback-modal__label,
    html.dark-mode-auto .feedback-modal__type-label {
        color: #d1d5db;
    }

    html.dark-mode-auto .feedback-modal__label-hint {
        color: #9ca3af;
    }

    html.dark-mode-auto .feedback-type-option__box {
        background: #22262e;
        border-color: #363c47;
        color: #d1d5db;
    }

    html.dark-mode-auto .feedback-type-option__box svg {
        color: #9ca3af;
    }

    html.dark-mode-auto .feedback-type-option:hover .feedback-type-option__box {
        border-color: #4b5563;
    }

    html.dark-mode-auto .feedback-type-option input:checked + .feedback-type-option__box {
        background: #1e3a5f;
        border-color: #4a9ed4;
        color: #60a5fa;
    }

    html.dark-mode-auto .feedback-type-option input:checked + .feedback-type-option__box svg {
        color: #60a5fa;
    }

    html.dark-mode-auto .feedback-modal__textarea,
    html.dark-mode-auto .feedback-modal__input {
        background: #22262e;
        border-color: #363c47;
        color: #f3f4f6;
    }

    html.dark-mode-auto .feedback-modal__textarea:focus,
    html.dark-mode-auto .feedback-modal__input:focus {
        border-color: #4a9ed4;
        box-shadow: 0 0 0 3px rgba(74, 158, 212, 0.2);
    }

    html.dark-mode-auto .feedback-modal__textarea::placeholder,
    html.dark-mode-auto .feedback-modal__input::placeholder {
        color: #6b7280;
    }

    html.dark-mode-auto .feedback-modal__char-count {
        color: #9ca3af;
    }

    html.dark-mode-auto .feedback-modal__btn--secondary {
        background: #22262e;
        color: #d1d5db;
        border-color: #363c47;
    }

    html.dark-mode-auto .feedback-modal__btn--secondary:hover {
        background: #363c47;
    }

    html.dark-mode-auto .feedback-modal__success-title {
        color: #f3f4f6;
    }

    html.dark-mode-auto .feedback-modal__success-text {
        color: #9ca3af;
    }

    html.dark-mode-auto .feedback-modal__success-icon {
        color: #4ade80;
    }
}
