/**
 * Feedback System Frontend Styles
 * БЭМ методология - Улучшенная версия с акцентом на читаемость
 */

/* Блок: feedback-form */
.feedback-form {
    max-width: 700px;
    margin: 30px 0;
    padding: 30px;
    border: 1px solid #e0e5e9;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.feedback-form__title {
    margin: 0 0 24px;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.feedback-form__inner {
    width: 100%;
}

/* Элемент: form-group */
.feedback-form__group {
    margin-bottom: 24px;
}

.feedback-form__label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2d2d2d;
    font-size: 15px;
    line-height: 1.4;
}

.feedback-form__label--required::after {
    content: " *";
    color: #e53e3e;
    font-weight: bold;
}

/* Элементы: поля ввода */
.feedback-form__input,
.feedback-form__textarea,
.feedback-form__select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #d1d9e0;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    color: #2d2d2d;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    font-family: inherit;
}

.feedback-form__input:focus,
.feedback-form__textarea:focus,
.feedback-form__select:focus {
    outline: 0;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: #fefefe;
}

.feedback-form__input--error,
.feedback-form__textarea--error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.feedback-form__textarea {
    min-height: 140px;
    resize: vertical;
    font-family: inherit;
}

/* Элемент: кнопка отправки */
.feedback-form__submit {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.feedback-form__submit:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.feedback-form__submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.feedback-form__submit--disabled {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
    transform: none;
    box-shadow: none;
}

.feedback-form__submit--disabled:hover {
    background: #9ca3af;
    transform: none;
    box-shadow: none;
}

/* Элемент: сообщения */
.feedback-form__message {
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
}

.feedback-form__message--success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.feedback-form__message--error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.feedback-form__message--hidden {
    display: none;
}

/* Элемент: уведомление об анонимности */
.feedback-form__notice {
    background-color: #fefce8;
    color: #854d0e;
    padding: 16px 20px;
    border: 1px solid #fde047;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

.feedback-form__notice-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #713f12;
}

/* Блок: feedback-questions */
.feedback-questions {
    margin: 30px 0;
}

.feedback-questions__title {
    color: #1a1a1a;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    line-height: 1.2;
    text-align: center;
}

.feedback-questions__empty {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 60px 20px;
    font-size: 16px;
}

/* Блок: feedback-question */
.feedback-question {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease-in-out;
}

.feedback-question:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.feedback-question__meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.4;
    font-weight: 500;
}

.feedback-question__subject {
    font-weight: 700;
    color: #1f2937;
    margin-top: 6px;
    font-size: 16px;
}

.feedback-question__text {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #374151;
    white-space: pre-line;
    font-size: 15px;
}

.feedback-question__response {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #2563eb;
    padding: 20px;
    margin-top: 20px;
    border-radius: 0 8px 8px 0;
}

.feedback-question__response-title {
    color: #1e40af;
    font-weight: 700;
    margin: 0 0 12px;
    font-size: 17px;
}

.feedback-question__response-text {
    line-height: 1.6;
    color: #1f2937;
    margin: 0;
    white-space: pre-line;
    font-size: 15px;
}

/* Информация об отвечающем */
.feedback-question__responder {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.feedback-question__responder-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
    margin-bottom: 5px;
}

.feedback-question__responder-position {
    font-style: italic;
    color: #6b7280;
    font-size: 14px;
}

/* Блок: feedback-tabs */
.feedback-tabs {
    margin: 30px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

.feedback-tabs__nav {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
}

.feedback-tabs__nav-button {
    background: none;
    border: none;
    padding: 18px 24px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
}

.feedback-tabs__nav-button:hover {
    background-color: #f1f5f9;
    color: #1f2937;
}

.feedback-tabs__nav-button--active {
    border-bottom-color: #2563eb;
    color: #2563eb;
    background-color: #ffffff;
    font-weight: 700;
}

.feedback-tabs__content {
    background: #ffffff;
    display: none;
}

.feedback-tabs__content--active {
    display: block;
}

.feedback-tabs__content .feedback-form {
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 30px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .feedback-form {
        padding: 20px;
        margin: 20px 0;
    }
    
    .feedback-form__title {
        font-size: 24px;
    }
    
    .feedback-tabs__nav {
        flex-direction: column;
    }
    
    .feedback-tabs__nav-button {
        text-align: left;
        border-bottom: none;
        border-left: 3px solid transparent;
        padding: 16px 20px;
    }
    
    .feedback-tabs__nav-button--active {
        border-left-color: #2563eb;
        border-bottom-color: transparent;
    }
    
    .feedback-question {
        padding: 20px;
    }
    
    .feedback-tabs__content .feedback-form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .feedback-form {
        padding: 16px;
    }
    
    .feedback-form__title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .feedback-form__input,
    .feedback-form__textarea {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .feedback-form__submit {
        width: 100%;
        padding: 16px 24px;
        font-size: 17px;
    }
    
    .feedback-question {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .feedback-question__response {
        padding: 16px;
    }
    
    .feedback-questions__title {
        font-size: 26px;
    }
}

/* Светлая тема по умолчанию - убираем темную */
/* Убрали темную тему для лучшей читаемости */

/* Анимации загрузки */
.feedback-form__loading {
    position: relative;
    overflow: hidden;
}

.feedback-form__loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #2563eb, transparent);
    animation: feedback-loading 1.5s infinite;
}

@keyframes feedback-loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Состояния валидации */
.feedback-form__group--error .feedback-form__input,
.feedback-form__group--error .feedback-form__textarea {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.feedback-form__group--success .feedback-form__input,
.feedback-form__group--success .feedback-form__textarea {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Улучшения для лучшей читаемости */
.feedback-form__input::placeholder,
.feedback-form__textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.feedback-form__select:focus {
    cursor: pointer;
}

/* Индикаторы обязательных полей */
.feedback-form__group--required .feedback-form__label::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2563eb;
    margin-right: 6px;
}

/* Улучшения для кнопок */
.feedback-form__submit:focus {
    outline: 3px solid rgba(37, 99, 235, 0.3);
    outline-offset: 2px;
}

/* Печать */
@media print {
    .feedback-form__submit,
    .feedback-tabs__nav {
        display: none;
    }
    
    .feedback-form,
    .feedback-question {
        border: 2px solid #1a1a1a;
        box-shadow: none;
        background: #ffffff;
    }
    
    .feedback-tabs__content {
        display: block !important;
    }
    
    * {
        color: #1a1a1a !important;
        background: #ffffff !important;
    }
}

/**
 * Стили пагинации фронтенда
 */
.feedback-pagination {
    margin-top: 30px;
    text-align: center;
}

.feedback-pagination__nav {
    display: inline-block;
}

.feedback-pagination__info {
    display: block;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.feedback-pagination__list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.feedback-pagination__item {
    margin: 0;
    padding: 0;
}

.feedback-pagination__link {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: #007cba;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.feedback-pagination__link:hover {
    color: #005a87;
    background-color: #f0f8ff;
    border-color: #007cba;
    text-decoration: none;
}

.feedback-pagination__link--current {
    background-color: #007cba;
    color: white;
    border-color: #007cba;
}

.feedback-pagination__link--first,
.feedback-pagination__link--last {
    font-weight: bold;
    padding: 8px 16px;
}

.feedback-pagination__link--prev,
.feedback-pagination__link--next {
    font-weight: 500;
    padding: 8px 14px;
}

.feedback-pagination__dots {
    display: block;
    padding: 8px 4px;
    color: #666;
    font-weight: bold;
}

/* Адаптивность пагинации */
@media (max-width: 768px) {
    .feedback-pagination__list {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .feedback-pagination__link {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .feedback-pagination__link--first,
    .feedback-pagination__link--last,
    .feedback-pagination__link--prev,
    .feedback-pagination__link--next {
        padding: 6px 10px;
    }
}
