/**
 * Excel Import Styles
 * @version 1.3.0
 * @date 2026-02-03
 */

/* =========================================
 * БЛОК ЗАГРУЗКИ EXCEL
 * ========================================= */
.excel-import-section { background: #fafafa; border: 1px solid #e5e5e5; border-radius: 6px; padding: 14px 16px; margin-bottom: 16px; }
.excel-import-content { text-align: center; }
.excel-import-header h4 { margin: 0 0 4px 0; font-size: 13px; font-weight: 600; color: #333; }
.excel-import-description { color: #666; font-size: 12px; margin: 0 0 12px 0; line-height: 1.4; }
.excel-template-link { color: #0066cc; text-decoration: none; }
.excel-template-link:hover { text-decoration: underline; }
.btn-excel-upload { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 4px; font-size: 13px; font-weight: 500; cursor: pointer; background: #333; color: #fff; border: 1px solid #333; }
.btn-excel-upload:hover { opacity: 0.85; }
.excel-file-input { display: none; }

/* =========================================
 * МОДАЛЬНОЕ ОКНО ПРЕВЬЮ
 * ========================================= */
.excel-preview-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 10000; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box; }
.excel-preview-modal.active { display: flex; }
.excel-preview-content { background: white; border-radius: 8px; max-width: 95%; max-height: 90vh; width: 1100px; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.excel-preview-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e5e5e5; flex-shrink: 0; }
.excel-preview-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: #333; }
.btn-close-preview { background: none; border: none; font-size: 20px; color: #999; cursor: pointer; padding: 4px 8px; line-height: 1; border-radius: 4px; }
.btn-close-preview:hover { color: #333; background: #f0f0f0; }
.excel-preview-body { padding: 20px; overflow: auto; flex: 1; min-height: 0; }
.excel-preview-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid #e5e5e5; background: #fafafa; border-radius: 0 0 8px 8px; flex-shrink: 0; }
.btn-cancel-excel,
.btn-apply-excel { padding: 7px 14px; border-radius: 4px; font-size: 13px; font-weight: 500; cursor: pointer; transition: opacity 0.15s; }
.btn-cancel-excel { background: #fff; color: #333; border: 1px solid #ccc; }
.btn-cancel-excel:hover { background: #f5f5f5; }
.btn-apply-excel { background: #333; color: #fff; border: 1px solid #333; }
.btn-apply-excel:hover:not(:disabled) { opacity: 0.85; }
.btn-apply-excel:disabled { opacity: 0.4; cursor: not-allowed; }

/* =========================================
 * СТАТИСТИКА ПРЕВЬЮ
 * ========================================= */
.excel-preview-stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-item { background: #f8fafc; border: 1px solid #e2e8f0; padding: 8px 14px; border-radius: 6px; display: flex; align-items: center; gap: 8px; }
.stat-label { color: #64748b; font-size: 13px; }
.stat-value { font-weight: 600; font-size: 15px; color: #1e293b; }

/* =========================================
 * ПРЕДУПРЕЖДЕНИЯ
 * ========================================= */
.excel-preview-warning { background: #fef9c3; border-left: 3px solid #eab308; color: #713f12; padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.excel-preview-warning-inline { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.1); color: #92400e; font-size: 13px; }
.excel-preview-error { background: #fef2f2; border-left: 3px solid #ef4444; color: #991b1b; padding: 12px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.excel-preview-error ul { margin: 8px 0 0 16px; padding: 0; }
.excel-preview-info { background: #f8f9fa; border-left: 3px solid #28a745; color: #333; padding: 12px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; line-height: 1.6; }

/* =========================================
 * ТАБЛИЦА ПРЕВЬЮ
 * ========================================= */
.excel-preview-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.excel-preview-table th { background: #f5f5f5; padding: 10px 12px; text-align: left; font-weight: 600; color: #555; border-bottom: 2px solid #ddd; white-space: nowrap; font-size: 12px; }
.excel-preview-table td { padding: 9px 12px; border-bottom: 1px solid #eee; color: #333; }
.excel-preview-table tbody tr:hover { background: #fafafa; }
/* Дубликаты */
.excel-preview-table tr.duplicate-row { background: #fff5f5; }
.excel-preview-table tr.duplicate-row:hover { background: #ffecec; }
.excel-preview-table td.duplicate-email { color: #dc3545; font-weight: 500; }
/* Тарифы */
.excel-preview-table .tariff-offline { color: var(--color-primary, #ff6b35); font-weight: 600; }
.excel-preview-table .tariff-online { color: #28a745; font-weight: 600; }

/* =========================================
 * КНОПКИ ДЕЙСТВИЙ
 * ========================================= */
.btn-apply-excel,
.btn-cancel-excel { padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; border: none; }
.btn-apply-excel { background: var(--color-primary, #ff6b35); color: white; }
.btn-apply-excel:hover { background: var(--color-primary-hover, #e55a2b); }
.btn-apply-excel:disabled { background: #ccc; cursor: not-allowed; }
.btn-cancel-excel { background: white; color: #666; border: 1px solid #ddd; }
.btn-cancel-excel:hover { background: #f8f9fa; }

/* =========================================
 * ИНДИКАТОР ЗАГРУЗКИ
 * ========================================= */
.excel-loading { display: flex; flex-direction: column; align-items: center; gap: 15px; padding: 40px; }
.excel-loading-spinner { width: 40px; height: 40px; border: 3px solid #f3f3f3; border-top: 3px solid var(--color-primary, #ff6b35); border-radius: 50%; animation: excel-spin 1s linear infinite; }
@keyframes excel-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.excel-loading-text { color: #666; font-size: 14px; }

/* =========================================
 * ПОДСВЕТКА ДУБЛИКАТОВ В СЛОТАХ
 * ========================================= */
#ca-form-registration .ticket-slot.has-duplicate-email { border-color: #dc3545 !important; background: #fff5f5 !important; }
#ca-form-registration .ticket-slot.has-duplicate-email .participant-fields-row input[data-field="email"] { border-color: #dc3545 !important; background: #fff5f5 !important; }
#ca-form-registration .duplicate-email-warning { color: #dc3545; font-size: 12px; margin-top: 5px; display: flex; align-items: center; gap: 5px; }
#ca-form-registration .duplicate-email-warning::before { content: '⚠️'; }

/* =========================================
 * АДАПТИВ
 * ========================================= */
@media (max-width: 768px) {
.excel-import-buttons { flex-direction: column; }
.btn-excel-upload,
.btn-excel-template { width: 100%; justify-content: center; }
.excel-preview-content { max-height: 95vh; border-radius: 8px; }
.excel-preview-stats { flex-direction: column; gap: 10px; }
.stat-item { justify-content: space-between; }
.excel-preview-footer { flex-direction: column; }
.btn-apply-excel,
.btn-cancel-excel { width: 100%; }
}
