/* ==========================================================================
   SPOKO — Feedback page (/zpetna-vazba)
   ========================================================================== */

.feedback-page {
    background: var(--color-bg);
    padding-top: var(--header-height);
    min-height: 100vh;
}

.feedback-intro {
    padding: 60px 0 32px;
    text-align: center;
}

.feedback-title {
    font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.feedback-lead {
    color: var(--color-text-light);
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.6;
}

.feedback-grid {
    padding: 16px 0 80px;
}

.feedback-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
}

@media (min-width: 992px) {
    .feedback-columns {
        grid-template-columns: 1fr 1fr;
    }
}

.feedback-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 50px -30px rgba(10, 90, 138, 0.25);
}

@media (min-width: 768px) {
    .feedback-card {
        padding: 36px;
    }
}

.feedback-card--cloud {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
}

.feedback-card__head {
    margin-bottom: 24px;
}

.feedback-card__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 8px;
}

.feedback-card__hint {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin: 0;
}

/* ---------- Word cloud ---------- */
.word-cloud {
    position: relative;
    min-height: 256px;
    border: 2px dashed var(--color-border);
    border-radius: 18px;
    background: #f6fafc;
    margin-bottom: 24px;
    padding: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (min-width: 768px) {
    .word-cloud {
        min-height: 320px;
    }
}

.word-cloud__empty {
    color: var(--color-text-light);
    font-size: 0.95rem;
    font-style: italic;
    text-align: center;
    padding: 24px;
}

.word-bubble {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 6px rgba(10, 90, 138, 0.06);
    color: var(--color-primary-dark);
    font-weight: 700;
    line-height: 1.2;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease,
                background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    font-family: inherit;
    text-align: center;
}

.word-bubble:hover,
.word-bubble:focus-visible {
    transform: scale(1.08);
    filter: brightness(1.05);
    box-shadow: 0 6px 14px rgba(10, 90, 138, 0.12);
    outline: none;
}

.word-bubble.is-selected {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary-dark);
    opacity: 1 !important;
    box-shadow: 0 8px 18px rgba(61, 204, 213, 0.35);
}

.word-bubble.is-selected::after {
    content: ' ✓';
    font-weight: 700;
    margin-left: 2px;
}

.word-bubble--new {
    animation: spoko-bubble-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes spoko-bubble-pop {
    0%   { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1);   opacity: var(--bubble-opacity, 1); }
}

/* ---------- Term form ---------- */
.word-form__row {
    position: relative;
}

.word-form__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 60px;
    padding: 12px 130px 12px 14px;
    border-radius: 14px;
    border: 2px solid #f0f3f6;
    background: #fff;
    box-shadow: 0 2px 6px rgba(10, 90, 138, 0.04);
    transition: border-color var(--transition), box-shadow var(--transition);
    cursor: text;
}

.word-form__chips:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(61, 204, 213, 0.15);
}

.word-form__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 12px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(61, 204, 213, 0.25);
    animation: spoko-chip-in 0.18s ease-out both;
}

@keyframes spoko-chip-in {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.word-form__chip-text {
    white-space: nowrap;
}

.word-form__chip-remove {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background-color var(--transition);
}

.word-form__chip-remove:hover,
.word-form__chip-remove:focus {
    background: rgba(255, 255, 255, 0.4);
    outline: none;
}

.word-form__inline-input {
    flex: 1 1 140px;
    min-width: 120px;
    border: 0;
    outline: 0;
    padding: 6px 0;
    background: transparent;
    font-size: 1.0625rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--color-text);
}

.word-form__inline-input::placeholder {
    color: #9aa6b2;
}

.word-form__submit {
    position: absolute;
    right: 8px;
    top: 8px;
    bottom: 8px;
    padding: 0 22px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background-color var(--transition);
}

.word-form__submit:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.word-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .word-form__submit {
        font-size: 1.125rem;
        padding: 0 26px;
        letter-spacing: 0.01em;
    }
    .word-form__chips {
        padding-right: 140px;
    }
}

.word-form__note {
    margin-top: 12px;
    text-align: center;
    font-size: 0.75rem;
    color: #98a4b1;
}

.word-form__note kbd {
    display: inline-block;
    padding: 1px 6px;
    margin: 0 1px;
    background: #f0f3f6;
    border: 1px solid #dde5ec;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    color: var(--color-text);
}

.word-form__suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: 0 16px 40px -16px rgba(10, 90, 138, 0.3);
    max-height: 280px;
    overflow-y: auto;
}

.word-form__suggestion {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.word-form__suggestion:hover,
.word-form__suggestion.is-active {
    background: var(--color-primary);
    color: #fff;
}

.word-form__feedback,
.extended-form__feedback {
    margin-top: 12px;
    font-size: 0.875rem;
    text-align: center;
    min-height: 1.2em;
}

.word-form__feedback.is-success,
.extended-form__feedback.is-success {
    color: #155724;
}

.word-form__feedback.is-error,
.extended-form__feedback.is-error {
    color: #b3261e;
}

/* ---------- Extended form ---------- */
.feedback-card--form .feedback-card__title {
    margin-bottom: 24px;
}

.extended-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.extended-form__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.extended-form__field label {
    font-weight: 700;
    font-size: 0.875rem;
    color: #475260;
}

.extended-form__field input,
.extended-form__field textarea {
    padding: 12px 16px;
    border-radius: 12px;
    background: #f8fafb;
    border: 1px solid var(--color-border);
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text);
    transition: border-color var(--transition), background-color var(--transition);
    outline: none;
    resize: vertical;
}

.extended-form__field input:focus,
.extended-form__field textarea:focus {
    border-color: var(--color-primary);
    background: #fff;
}

.extended-form__field textarea {
    min-height: 140px;
    line-height: 1.5;
}

.extended-form__notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #e6f7f8;
    border: 1px solid #c5edf0;
    border-radius: 12px;
    color: #176870;
    font-size: 0.875rem;
    margin: 0;
}

.extended-form__notice svg {
    flex-shrink: 0;
}

.extended-form__submit {
    padding: 16px;
    background: linear-gradient(90deg, var(--color-gradient-start) 0%, var(--color-gradient-mid) 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 10px 24px -10px rgba(42, 152, 196, 0.6);
    transition: transform var(--transition), box-shadow var(--transition);
}

.extended-form__submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px -10px rgba(42, 152, 196, 0.7);
}

.extended-form__submit:active {
    transform: scale(0.98);
}

.extended-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Mobile fixes ---------- */
@media (max-width: 640px) {
    .feedback-intro {
        padding: 40px 0 24px;
    }

    .feedback-card {
        padding: 20px;
        border-radius: 18px;
    }

    .word-cloud {
        padding: 16px;
        gap: 8px;
        overflow-x: hidden;
    }

    /* Cap large bubble sizes set inline by JS so they can't overflow narrow viewports */
    .word-bubble {
        font-size: clamp(12px, 3.6vw, 22px) !important;
        padding: 5px 11px;
    }

    /* Stack the chips area and the submit button vertically on phones —
       the absolute right-side button doesn't fit when the chip area is narrow */
    .word-form__row {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .word-form__chips {
        padding: 10px 12px;
        min-height: 52px;
    }

    .word-form__submit {
        position: static;
        width: 100%;
        padding: 12px 18px;
    }

    .word-form__suggestions {
        max-height: 220px;
    }

    .word-form__note {
        font-size: 0.7rem;
    }
}
