/* Квизы - копируем стили из mailings.css */
@import url('mailings.css');

/* Переопределяем только необходимое */
.quizzes-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.quizzes-table-container {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.quizzes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.quizzes-table thead th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
}

.quizzes-table tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.quizzes-table tbody tr:last-child td {
    border-bottom: none;
}

.quizzes-table tbody tr {
    animation: fadeInUp 0.5s ease-out backwards;
}

.quizzes-table tbody tr:hover {
    background: var(--highlight-color);
}

/* Модальное окно деталей квиза */
.quiz-details-modal {
    max-width: 1000px;
    max-height: 90vh;
}

.quiz-details-modal .modal-body {
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.quiz-details-loading {
    text-align: center;
    padding: 3rem;
}

.quiz-details-loading .spinner {
    margin: 0 auto 1rem;
}

.details-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.details-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.details-section h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.details-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

.quiz-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Сетка статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    padding: 1rem;
    background: var(--highlight-color);
    border-radius: 4px;
}

.stat-item .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Telegram превью */
.telegram-preview {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 1rem;
    max-width: 500px;
}

.telegram-message {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
}

.telegram-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.telegram-button {
    padding: 0.625rem 1rem;
    background: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #0088cc;
    cursor: default;
    text-align: center;
    font-weight: 500;
}

/* Карточки вопросов со статистикой */
.question-stats-card {
    background: var(--highlight-color);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.question-stats-card:last-child {
    margin-bottom: 0;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.question-header h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.responses-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.question-text {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Статистика ответов (кнопки) */
.answers-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-stat {
    background: white;
    border-radius: 4px;
    padding: 0.75rem;
}

.answer-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.answer-bar-container {
    position: relative;
    height: 24px;
    background: var(--highlight-color);
    border-radius: 4px;
    overflow: hidden;
}

.answer-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #d0d0d0;
    transition: width 0.3s ease;
}

.answer-count {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 1;
}

/* Текстовые ответы */
.text-answers-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.text-answer-item {
    background: white;
    border-radius: 4px;
    padding: 0.625rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.text-answer-item strong {
    color: var(--text-muted);
    font-weight: 600;
}

/* Таблица пользователей */
.users-table-container {
    overflow-x: auto;
}

.users-responses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.users-responses-table thead th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.users-responses-table tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.users-responses-table tbody tr:last-child td {
    border-bottom: none;
}

.users-responses-table tbody tr:hover {
    background: var(--highlight-color);
}

.progress-info {
    font-size: 0.875rem;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Модальное окно ответов пользователя */
.user-responses-modal {
    max-width: 700px;
}

.user-meta {
    background: var(--highlight-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.user-meta h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.user-meta p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.responses-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.response-card {
    background: var(--highlight-color);
    border-radius: 4px;
    padding: 1rem;
}

.response-question {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.response-answer {
    padding: 0.625rem;
    background: white;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

