/**
 * Feedback Widget CSS
 * Styl widgetu zgłoszeń/feedbacku dla ZTWS Quiz
 */

/* ==================== Floating Tab (Przycisk) ==================== */
.feedback-floating-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: right bottom;
    background: linear-gradient(135deg, #5144C7 0%, #7B68EE 100%);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 4px 12px rgba(81, 68, 199, 0.3);
    transition: all 0.3s ease;
    z-index: 1040; /* Poniżej modali Bootstrap (1050+) */
    outline: none;
}

.feedback-floating-tab:hover {
    background: linear-gradient(135deg, #E5BD55 0%, #F4D03F 100%);
    color: #1a1a2e;
    box-shadow: 0 6px 16px rgba(229, 189, 85, 0.4);
    transform: translateY(-50%) rotate(-90deg) translateX(-5px);
}

.feedback-floating-tab:active {
    transform: translateY(-50%) rotate(-90deg) translateX(-3px);
}

.feedback-tab-text {
    display: inline-block;
    white-space: nowrap;
}

/* Responsywność dla mniejszych ekranów */
@media (max-width: 768px) {
    .feedback-floating-tab {
        font-size: 12px;
        padding: 10px 16px;
    }
}

/* ==================== Screenshot Preview ==================== */
#feedback-screenshots-preview {
    min-height: 40px;
}

.feedback-screenshot-thumb {
    position: relative;
    width: 100px;
    height: 100px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.feedback-screenshot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feedback-screenshot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: background-color 0.2s;
}

.feedback-screenshot-remove:hover {
    background-color: rgba(220, 53, 69, 1);
}

/* ==================== Screenshot Capture Overlay ==================== */
#screenshot-capture-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    cursor: crosshair;
}

.screenshot-overlay-instructions {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(26, 26, 46, 0.95);
    color: #E5BD55;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}

#screenshot-selection-box {
    position: absolute;
    border: 2px dashed #E5BD55;
    background-color: rgba(229, 189, 85, 0.1);
    pointer-events: none;
}

/* ==================== Screenshot Editor ==================== */
.screenshot-canvas-container {
    position: relative;
    background-color: #f8f9fa;
}

#screenshot-canvas {
    cursor: crosshair;
}

.screenshot-color {
    width: 36px;
    height: 36px;
    font-size: 20px;
    padding: 0;
    line-height: 1;
}

.screenshot-color.active {
    box-shadow: 0 0 0 3px rgba(81, 68, 199, 0.3);
}

/* Przycisk koloru - dopasowanie do koloru */
.btn-danger.screenshot-color {
    background-color: #FF0000;
    border-color: #FF0000;
}

.btn-success.screenshot-color {
    background-color: #00FF00;
    border-color: #00FF00;
}

.btn-primary.screenshot-color {
    background-color: #0000FF;
    border-color: #0000FF;
}

.btn-warning.screenshot-color {
    background-color: #FFFF00;
    border-color: #FFFF00;
    color: #1a1a2e;
}

/* ==================== Animacje ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal.show .modal-dialog {
    animation: fadeIn 0.3s ease;
}

/* ==================== Loading State ==================== */
#feedback-submit-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

#feedback-submit-btn.loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== Alert Messages ==================== */
#feedback-alert {
    margin-bottom: 1rem;
}

#feedback-alert.d-none {
    display: none !important;
}

/* ==================== Responsywność ==================== */
@media (max-width: 768px) {
    .modal-lg {
        max-width: 95% !important;
        margin: 0.5rem auto;
    }

    .modal-xl {
        max-width: 98% !important;
        margin: 0.25rem auto;
    }

    .screenshot-canvas-container {
        max-height: 350px !important;
    }

    .feedback-screenshot-thumb {
        width: 80px;
        height: 80px;
    }

    .btn-group {
        flex-wrap: wrap;
    }
}

/* ==================== Accessibility ==================== */
.feedback-floating-tab:focus-visible {
    outline: 2px solid #E5BD55;
    outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(81, 68, 199, 0.25);
}

/* ==================== Dark Mode Support (opcjonalnie) ==================== */
@media (prefers-color-scheme: dark) {
    .screenshot-canvas-container {
        background-color: #2a2a4a;
        border-color: #3a3a5a !important;
    }

    .feedback-screenshot-thumb {
        border-color: #3a3a5a;
        background-color: #2a2a4a;
    }
}

/* ==================== Google reCAPTCHA Badge - Ukryj ==================== */
/* Ukrywamy badge reCAPTCHA, ale zgodnie z zasadami Google dodajemy informację w formularzu */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* Styl dla informacji o reCAPTCHA w formularzu */
.recaptcha-info {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.recaptcha-info a {
    color: #5144C7;
    text-decoration: none;
}

.recaptcha-info a:hover {
    text-decoration: underline;
}
