/* ==============================================
   СИСТЕМА РЕГИСТРАЦИИ НА МЕРОПРИЯТИЯ - СТИЛЬ, ЕЕЕ
   ============================================== */

/* Цвета */
:root {
    --primary-red: #e20613;
    --primary-red-hover: #c50511;
    --accent-blue: #0088ab;
    --mr-grey: #e0e0e0; 
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-gray: #666666;
    --border-color: #e0e0e0;
    --success-green: #28a745;
    --error-red: #dc3545;
}

/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Контейнер */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Логотип */
.logo {
    width: 180px;
    margin: 20px 0;
    display: block;
}

/* Карточки */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 20px 0;
}

/* Баннер мероприятия */
.event-banner {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 20px 0;
}

/* Заголовки */
h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 10px;
}

/* Описание мероприятия */
.event-description {
    color: var(--text-gray);
    margin-bottom: 20px;
    white-space: pre-line;
    line-height: 1.8;
}

/* Счётчик мест */
.seats-counter {
    background: #f7d0d2; /*linear-gradient(135deg, var(--accent-blue), var(--primary-red));*/
    color: var(--primary-red);
    border-color: var(--primary-red);
    border-style: solid;
    border-width: 1px;
    padding: 15px 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 16px;
    margin: 20px 0;
}

.seats-counter strong {
    font-size: 20px;
    font-weight: 700;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-red);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-gray);
    font-size: 13px;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-red);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(226, 6, 19, 0.3);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #a1a1a1;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
}

.btn-outline:hover {
    background: var(--primary-red);
    color: white;
}

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

/* Блоки сообщений */
.message-box {
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.message-box.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.message-box.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.message-box.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.message-box h2 {
    margin-bottom: 15px;
}

.message-box p {
    margin: 10px 0;
    font-size: 16px;
}

/* Админ-панель */
.admin-header {
    background: var(--primary-red);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header .logo {
    margin: 0;
}

.admin-nav {
    display: flex;
    gap: 10px;
}

.admin-nav a,
.admin-nav button {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
}

.admin-nav a:hover,
.admin-nav button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Табы */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-gray);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.tab.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

.tab:hover {
    color: var(--primary-red);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Таблицы */
.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

table thead {
    background: var(--bg-color);
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    font-weight: 600;
    color: var(--text-color);
}

table tr:hover {
    background: rgba(226, 6, 19, 0.05);
}

table .actions {
    display: flex;
    gap: 8px;
}

table .actions button {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

/* Бейджи статуса */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.draft {
    background: #6c757d;
    color: white;
}

.badge.active {
    background: var(--success-green);
    color: white;
}

.badge.closed {
    background: var(--error-red);
    color: white;
}

.badge.archived {
    background: #cd853f;
    color: white;
}

.badge.approved {
    background: var(--success-green);
    color: white;
}

.badge.registered {
    background: var(--accent-blue);
    color: white;
}

.badge.reserve {
    background: #ffc107;
    color: #212529;
}

/* Рандомайзер */
.randomizer-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.participants-list {
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-color);
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
}

.participants-list ul {
    list-style: none;
}

.participants-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.randomizer-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin: 20px 0;
}

.randomizer-controls input {
    width: 100px;
}

.roulette {
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-red));
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    color: white;
    font-size: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.winners-list {
    background: #d4edda;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
}

.winners-list ol {
    margin-left: 25px;
}

.winners-list li {
    padding: 8px 0;
    font-size: 16px;
    font-weight: 500;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-gray);
}

.modal-close:hover {
    color: var(--text-color);
}

/* Loader */
.loader {
    border: 4px solid var(--bg-color);
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Адаптивность - Mobile First */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .card {
        padding: 20px;
    }

    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    .btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Предотвращает зум на iOS */
    }

    .seats-counter {
        font-size: 14px;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
    }

    .admin-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .tab {
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .tab.active {
        border-bottom-color: var(--primary-red);
    }

    .table-responsive {
        overflow-x: scroll;
    }

    table {
        font-size: 13px;
    }

    table th,
    table td {
        padding: 8px 10px;
    }

    .randomizer-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .randomizer-controls input {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* Дополнительные утилиты */
.text-center {
    text-align: center;
}

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Печать */
@media print {
    .admin-header,
    .btn,
    .tabs,
    .modal {
        display: none;
    }
}
