/* Общие стили для админ-панели */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
}

/* CSS переменные генерируются динамически через admin/css/colors.php */
/* Блок :root удалён, чтобы не переопределять переменные из colors.php */

/* Контейнеры */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: var(--admin-bg);
}

/* Заголовки */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--admin-border);
}

.admin-header h1 {
    color: var(--admin-text);
    font-size: 32px;
}

.admin-header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-header .user-info span {
    color: var(--admin-muted);
    font-weight: 500;
}

/* Блок с кнопками в admin-header */
.admin-header .header-buttons,
.admin-header > div.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Кнопки в admin-header должны быть одинакового размера */
.admin-header .header-buttons .btn,
.admin-header .header-buttons .btn-logout,
.admin-header > div.header-buttons .btn {
    min-width: 140px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    box-sizing: border-box;
}

.admin-header h1 i,
.admin-header .user-info i {
    color: var(--admin-primary);
}

/* SVG стрелки всегда белого цвета */
svg,
svg path,
svg polygon,
svg polyline,
svg line,
svg circle,
svg rect,
svg ellipse {
    fill: white !important;
    stroke: white !important;
    color: white !important;
}

.btn svg,
.btn svg path,
.btn svg polygon,
.btn svg polyline,
.btn svg line {
    fill: white !important;
    stroke: white !important;
    color: white !important;
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.btn-primary:hover {
    background: var(--admin-primary-dark);
}

.btn-danger {
    background: var(--admin-danger);
    color: white;
}

.btn-danger:hover {
    background: var(--admin-danger-dark);
}

.btn-success {
    background: var(--admin-success);
    color: white;
}

.btn-success:hover {
    background: var(--admin-success-dark);
}

.btn-secondary {
    background: var(--admin-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--admin-secondary-dark);
}

.btn-warning {
    background: var(--admin-warning);
    color: white;
}

.btn-warning:hover {
    background: var(--admin-warning-dark);
}

.btn-secondary svg,
.btn-secondary i,
.btn-secondary svg path,
.btn-secondary svg polygon,
.btn-secondary svg polyline,
.btn-secondary svg line {
    color: white !important;
    fill: white !important;
    stroke: white !important;
}

.btn-logout {
    padding: 10px 20px;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-logout:hover {
    background: var(--admin-primary-dark);
}

.btn-logout svg,
.btn-logout i,
.btn-logout svg path,
.btn-logout svg polygon,
.btn-logout svg polyline,
.btn-logout svg line {
    color: white !important;
    fill: white !important;
    stroke: white !important;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* Таблицы */
.players-table,
.games-table,
.schedule-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.schedule-table {
    overflow: hidden;
}

.schedule-table .table-wrapper,
.players-table .table-wrapper,
.games-table .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
}

thead {
    background: #f8f9fa;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    font-weight: 600;
    color: #333;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody td {
    vertical-align: middle;
}

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

.avatar-cell img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.actions-cell {
    
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.actions-cell .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.modal.active {
    display: flex;
}

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

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

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

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

/* Строка-настройка (переключатель) */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.015);
}

.setting-row__text {
    min-width: 0;
}

.setting-row__title {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.setting-row__desc {
    margin: 6px 0 0 0;
    color: #666;
    font-size: 13px;
    line-height: 1.35;
}

/* Switch */
.switch {
    position: relative;
    width: 52px;
    height: 30px;
    flex: 0 0 auto;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d7dbe0;
    border-radius: 999px;
    transition: background 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.switch__slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.switch input:checked + .switch__slider {
    background: var(--admin-primary);
}

.switch input:checked + .switch__slider:before {
    transform: translateX(22px);
}

.switch input:focus-visible + .switch__slider {
    outline: 3px solid rgba(74, 144, 226, 0.35);
    outline-offset: 2px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}

.form-group input[type="file"] {
    padding: 8px;
}

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

.file-info {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Алерты */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

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

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

/* Навигация */
.admin-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.admin-nav-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.admin-nav-card i {
    font-size: 36px;
    color: var(--admin-primary);
}

.admin-nav-card-content h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 20px;
}

.admin-nav-card-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--admin-primary);
}

/* Страница входа */
.login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Montserrat', sans-serif;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(224, 102, 42, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.loading {
    display: none;
    text-align: center;
    margin-top: 10px;
}

.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Бейджи файлов */
.file-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
}

.file-badge.has-file {
    background: #d4edda;
    color: #155724;
}

.upload-progress {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    display: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.upload-progress__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.upload-progress__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--admin-text);
}

.upload-progress__cancel {
    cursor: pointer;
    color: #dc3545;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.upload-progress__cancel:hover {
    background-color: #f8d7da;
}

.upload-progress__bar {
    position: relative;
    width: 100%;
    height: 16px;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.upload-progress__bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-primary-dark) 100%);
    transition: width 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.upload-progress__value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.upload-progress__details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-progress__text {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.upload-progress__stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #666;
    flex-wrap: wrap;
}

.upload-progress__stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.upload-progress__stats span::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--admin-primary);
    opacity: 0.6;
}

/* Превью аватара */
#avatarPreview {
    margin-top: 10px;
}

#avatarPreviewImg {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

