/**
 * Football Arena Theme for JohnCMS 9.x
 * Light-Green & Slate Gray Modern Sports Palette
 */

:root {
    --fm-primary: #059669;
    --fm-primary-dark: #047857;
    --fm-primary-light: #10b981;
    --fm-primary-glow: rgba(5, 150, 105, 0.2);
    
    --fm-bg-main: #f1f5f9;
    --fm-bg-card: #ffffff;
    --fm-bg-sidebar: #ffffff;
    --fm-bg-nav: #ffffff;
    
    --fm-border: #e2e8f0;
    --fm-border-focus: #059669;
    
    --fm-text-main: #0f172a;
    --fm-text-muted: #64748b;
    --fm-text-light: #f8fafc;
    
    --bs-primary: #059669;
    --bs-primary-rgb: 5, 150, 105;
    --bs-success: #059669;
    --bs-success-rgb: 5, 150, 105;
    --bs-body-bg: #f1f5f9;
    --bs-body-color: #0f172a;
    --bs-link-color: #059669;
    --bs-link-hover-color: #047857;
    --bs-border-color: #e2e8f0;
}

/* 1. Глобальный фон и типографика */
body, body.light, body.auto, body.football {
    background-color: var(--fm-bg-main) !important;
    color: var(--fm-text-main) !important;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 2. Верхняя панель навигации (Navbar) */
.top_nav {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

.top_nav .navbar-toggler-bar {
    background-color: #059669 !important;
}

.top_nav .icon_with_badge {
    color: #475569 !important;
    transition: color 0.2s, transform 0.2s;
}

.top_nav .icon_with_badge:hover {
    color: #059669 !important;
    transform: scale(1.08);
}

.top_nav .badge.bg-danger {
    background: #ef4444 !important;
}

/* 3. Сайдбар (Sidebar) — Чистый белый спортивный стиль в едином тоне с сайтом */
.sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 2px 0 10px rgba(15, 23, 42, 0.03);
}

.sidebar .sidebar__logo {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 16px 20px;
    text-align: center;
}

.sidebar .sidebar-heading {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8 !important;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 12px 16px 4px;
    list-style: none;
}

.sidebar .nav-link,
.sidebar a {
    color: #334155 !important;
    border-radius: 8px;
    margin: 1px 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar a:hover {
    background: #f1f5f9 !important;
    color: #059669 !important;
    padding-left: 14px;
}

.sidebar .nav-item.active .nav-link,
.sidebar .nav-link.active,
.sidebar a.active {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    font-weight: 700;
    border-left: 3px solid #059669;
    box-shadow: none !important;
}

.sidebar .user_profile {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px;
    margin: 12px;
    padding: 10px 14px;
}

.sidebar .user_profile a,
.sidebar .user_profile .user_name,
.sidebar .user_profile span {
    color: #0f172a !important;
    font-weight: 700;
}

.sidebar svg.icon {
    fill: currentColor !important;
}

.sidebar .sidebar__footer {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    color: #64748b !important;
}

.sidebar .sidebar__footer a,
.sidebar .sidebar__footer button {
    color: #64748b !important;
}

.sidebar .sidebar__footer a:hover,
.sidebar .sidebar__footer button:hover {
    color: #059669 !important;
}

/* 4. Контентные контейнеры и карточки */
.content-container {
    background: var(--fm-bg-main) !important;
}

.card {
    background: var(--fm-bg-card);
    border: 1px solid var(--fm-border);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid var(--fm-border) !important;
    font-weight: 700;
    color: var(--fm-text-main) !important;
    padding: 14px 20px !important;
}

/* 5. Кнопки (Buttons) — Спокойный спортивный стиль */
.btn-primary,
.btn-success {
    background: #059669 !important;
    border: 1px solid #059669 !important;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 18px;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.2) !important;
    transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-success:hover {
    background: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3) !important;
}

.btn-outline-primary,
.btn-outline-success {
    color: #059669 !important;
    border-color: #059669 !important;
    border-radius: 8px;
    font-weight: 600;
}

.btn-outline-primary:hover,
.btn-outline-success:hover {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
}

.btn-secondary,
.btn-outline-secondary {
    border-radius: 10px;
    font-weight: 600;
}

/* 6. Поля ввода (Inputs & Forms) */
.form-control,
.form-select {
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 10px 14px;
    background-color: #ffffff !important;
    color: var(--fm-text-main) !important;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--fm-primary) !important;
    box-shadow: 0 0 0 0.25rem var(--fm-primary-glow) !important;
}

/* 7. Форум, Списки и Темы */
.forum-section,
.post-item,
.list-item {
    background: #ffffff !important;
    border-bottom: 1px solid var(--fm-border) !important;
    transition: background 0.2s ease;
    border-radius: 8px;
}

.forum-section:hover,
.list-item:hover {
    background: #f8fafc !important;
}

.post-user .user-name {
    color: var(--fm-text-main) !important;
    font-weight: 700;
}

.counter-badge {
    background: #e2e8f0 !important;
    color: #334155 !important;
    font-weight: 700;
    border-radius: 12px;
    padding: 3px 8px;
}

.badge-success,
.badge.bg-success {
    background: #10b981 !important;
    color: #ffffff !important;
}

.badge-info,
.badge.bg-info {
    background: #0ea5e9 !important;
    color: #ffffff !important;
}

/* 8. Таблицы (Tables) */
.table {
    border-color: var(--fm-border) !important;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700;
    border-bottom: 2px solid var(--fm-border) !important;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table-hover tbody tr:hover {
    background-color: rgba(16, 185, 129, 0.04) !important;
}

/* 9. Пагинация (Pagination) */
.pagination .page-item .page-link {
    color: var(--fm-text-main);
    border-color: var(--fm-border);
    border-radius: 8px;
    margin: 0 2px;
    font-weight: 600;
}

.pagination .page-item.active .page-link {
    background: var(--fm-primary) !important;
    border-color: var(--fm-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px var(--fm-primary-glow);
}

/* 10. Кнопка «Наверх» (To Top) */
.btn__top {
    background: var(--fm-bg-sidebar) !important;
    color: var(--fm-primary-light) !important;
    border: 2px solid var(--fm-primary) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

.btn__top:hover {
    background: var(--fm-primary) !important;
    color: #ffffff !important;
}

/* 11. Подвал (Footer) */
.page-footer {
    background: #ffffff;
    border-top: 1px solid var(--fm-border) !important;
    border-radius: 16px 16px 0 0;
    color: var(--fm-text-muted);
}

.page-footer a {
    color: #059669 !important;
    font-weight: 600;
}

/* 12. Зеленый пульсирующий индикатор онлайна */
.online-pulse {
    display: inline-block;
    width: 9px;
    height: 9px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
    margin-right: 4px;
    vertical-align: middle;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* 13. Матч-Центр / Бегущая строка результатов (Match Ticker) */
.fm-ticker-wrapper {
    background: #0f172a;
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 16px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.fm-ticker-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #334155 #0f172a;
}
.fm-ticker-scroll::-webkit-scrollbar {
    height: 5px;
}
.fm-ticker-scroll::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
.fm-ticker-item {
    flex: 0 0 auto;
    background: #1e293b;
    border-radius: 8px;
    padding: 6px 12px;
    min-width: 175px;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.fm-ticker-item:hover {
    background: #273549;
    border-color: #10b981;
    transform: translateY(-2px);
    color: #ffffff;
}
.fm-ticker-live {
    border-color: #ef4444 !important;
    background: linear-gradient(135deg, #1e293b 0%, #450a0a 100%) !important;
}

/* 14. Пульсирующий индикатор LIVE */
.live-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: live-pulse-red 1.5s infinite;
    margin-right: 4px;
}
@keyframes live-pulse-red {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 15. Компактная турнирная таблица на главной */
.fm-portal-table {
    margin-bottom: 0;
    font-size: 0.88rem;
}
.fm-portal-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    border-bottom: 2px solid #e2e8f0;
}
.fm-portal-table td {
    padding: 8px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}
.fm-portal-table tr.my-team-row {
    background: #ecfdf5 !important;
    font-weight: 700;
    border-left: 3px solid #10b981;
}
.fm-portal-table tr.my-team-row td {
    color: #065f46;
}

/* 16. Тотализатор промо-карточка */
.fm-toto-banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-radius: 12px;
    color: #ffffff;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* 17. Чат трибун на главной */
.fm-tribune-chat {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.fm-chat-msg-row {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.88rem;
}
.fm-chat-msg-row:last-child {
    border-bottom: none;
}

