/* Racing Neon Theme - Karting Championship Style */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Orbitron:wght@400;500;600;700;900&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Цвета из референса */
    --bg-primary: #0a0e1a;
    --bg-secondary: #1a1f2e;
    --bg-card: #151922;
    --neon-cyan: #00d9ff;
    --neon-lime: #c6ff00;
    --text-primary: #ffffff;
    --text-secondary: #8b92a8;
    --text-muted: #5a5f73;
    --success: #00ff88;
    --danger: #ff3366;
    --warning: #ffb800;
    
    /* Эффекты свечения */
    --glow-cyan: 0 0 15px rgba(0,217,255,0.6), 0 0 30px rgba(0,217,255,0.4), 0 0 45px rgba(0,217,255,0.2);
    --glow-lime: 0 0 15px rgba(198,255,0,0.6), 0 0 30px rgba(198,255,0,0.4), 0 0 45px rgba(198,255,0,0.2);
    
    /* Размеры */
    --header-height: 70px;
    --max-width: 1400px;
    
    /* Шрифты */
    --font-heading: 'Orbitron', 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,217,255,0.03) 2px, rgba(0,217,255,0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,217,255,0.03) 2px, rgba(0,217,255,0.03) 4px);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - Яркий неоновый голубой фон */
header, .site-header {
    background: var(--neon-cyan);
    box-shadow: 0 4px 30px rgba(0,217,255,0.4), 0 0 60px rgba(0,217,255,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid rgba(255,255,255,0.1);
}

.header-row, .header-container, .header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
}

header h1, .site-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #0a0e1a;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    transition: all 0.3s;
    margin: 0;
}

.site-logo:hover, header h1:hover {
    text-shadow: 0 0 20px rgba(255,255,255,0.8);
    transform: scale(1.05);
}

.header-nav, .site-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link, .header-nav a {
    color: #0a0e1a;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.nav-link:hover, .header-nav a:hover {
    background: rgba(255,255,255,0.2);
    color: #000;
}

.nav-link.active, .header-nav a:hover {
    background: rgba(255,255,255,0.3);
    color: #000;
    box-shadow: 0 0 15px rgba(255,255,255,0.4);
}

.tagline {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
    padding: 0.5rem;
    background: var(--bg-secondary);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: #0a0e1a;
    border: 2px solid #000;
    color: #fff;
    font-size: 1.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* Main */
main, .main-content {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
}

/* Footer - темный с cyan акцентом */
footer, .site-footer {
    background: var(--bg-secondary);
    border-top: 3px solid var(--neon-cyan);
    box-shadow: 0 -4px 30px rgba(0,217,255,0.2);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--neon-cyan);
    margin-bottom: 1rem;
    text-shadow: var(--glow-cyan);
}

.footer-section h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--neon-lime);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a, footer a, .footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.footer-links a:hover, footer a:hover, .footer-link:hover {
    color: var(--neon-lime);
    text-shadow: var(--glow-lime);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,217,255,0.2);
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(0,217,255,0.5);
}

h2, .section-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px rgba(0,217,255,0.4);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header .tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

.back-link {
    display: inline-block;
    color: var(--neon-cyan);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.back-link:hover {
    color: var(--neon-lime);
    text-shadow: var(--glow-lime);
    transform: translateX(-5px);
}

/* Buttons - Кислотно-лаймовый для primary */
.btn, button[type="submit"] {
    display: inline-block;
    padding: 0.85rem 1.8rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: var(--font-heading);
}

.btn:not(.secondary):not(.danger):not(.success):not(.disabled), 
.btn.primary,
button[type="submit"]:not(.secondary) {
    background: var(--neon-lime);
    color: #000;
    box-shadow: var(--glow-lime);
    border: 2px solid var(--neon-lime);
}

.btn:not(.secondary):not(.danger):not(.success):not(.disabled):hover,
.btn.primary:hover,
button[type="submit"]:not(.secondary):hover {
    background: #fff;
    color: #000;
    box-shadow: 0 0 25px rgba(198,255,0,0.8), 0 0 50px rgba(198,255,0,0.4);
    transform: translateY(-3px);
}

.btn.secondary {
    background: transparent;
    color: var(--neon-cyan);
    border: 2px solid var(--neon-cyan);
}

.btn.secondary:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

.btn.success {
    background: var(--success);
    color: #000;
    border: 2px solid var(--success);
}

.btn.danger {
    background: var(--danger);
    color: white;
    border: 2px solid var(--danger);
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.btn.disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Cards */
.card, .competition-card, .reg-card, .active-competition article {
    background: var(--bg-card);
    border: 2px solid var(--neon-cyan);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0,217,255,0.15);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-lime), transparent);
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card:hover, .competition-card:hover {
    border-color: var(--neon-lime);
    box-shadow: 0 8px 30px rgba(0,217,255,0.3), 0 0 40px rgba(198,255,0,0.2);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Адаптивные сетки */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Гибкие контейнеры для кнопок */
.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-group .btn {
    flex: 1;
    min-width: 120px;
}

@media (max-width: 480px) {
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

/* Tables */
table, .competitions-table, .participants-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 2px solid var(--neon-cyan);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,217,255,0.15);
}

thead {
    background: var(--neon-cyan);
    color: #000;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    font-family: var(--font-heading);
}

td {
    padding: 1rem;
    border-top: 1px solid rgba(0,217,255,0.2);
}

tr:hover {
    background: rgba(0,217,255,0.1);
}

tr.highlight-cyan {
    background: rgba(0,217,255,0.2);
}

tr.highlight-lime {
    background: rgba(198,255,0,0.2);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 0.85rem;
    background: var(--bg-secondary);
    border: 2px solid rgba(0,217,255,0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0,217,255,0.3);
    background: var(--bg-primary);
}

input[type="file"] {
    border: 2px dashed rgba(0,217,255,0.3);
    padding: 1rem;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: var(--neon-cyan);
    background: rgba(0,217,255,0.05);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--neon-lime);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge.success {
    background: var(--success);
    color: #000;
}

.badge.warning {
    background: var(--warning);
    color: #000;
}

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

.badge.active {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: var(--glow-cyan);
}

.badge.registration-open {
    background: var(--neon-lime);
    color: #000;
    box-shadow: var(--glow-lime);
}

/* Status Colors */
.status-pending {
    border-left: 4px solid var(--warning);
}

.status-approved {
    border-left: 4px solid var(--success);
}

.status-rejected {
    border-left: 4px solid var(--danger);
}

.payment-confirmed {
    background: rgba(0,255,136,0.15) !important;
    border-left: 4px solid var(--success);
    box-shadow: 0 0 20px rgba(0,255,136,0.2);
}

/* Category badges */
.category-badge {
    display: inline-block;
    background: var(--neon-lime);
    color: #000;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(198,255,0,0.3);
}

/* Lists */
.info {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.info li {
    padding: 0.5rem 0;
    border-left: 3px solid var(--neon-cyan);
    padding-left: 0.8rem;
    margin: 0.5rem 0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

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

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

/* Messages */
.message {
    padding: 1.2rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid;
    font-weight: 500;
}

.message.success {
    background: rgba(0,255,136,0.15);
    border-color: var(--success);
    color: var(--success);
}

.message.error {
    background: rgba(255,51,102,0.15);
    border-color: var(--danger);
    color: var(--danger);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 3px solid var(--neon-cyan);
    border-radius: 12px;
    padding: 2rem;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--glow-cyan), 0 10px 50px rgba(0,0,0,0.5);
}

/* Receipt viewing */
.receipt-view {
    width: 100%;
    border-radius: 8px;
}

.receipt-img {
    max-width: 100%;
    height: auto;
    display: block;
}

.receipt-pdf {
    width: 100%;
    height: 80vh;
    min-height: 600px;
    border: none;
}

#receipt-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-close {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    float: right;
    font-weight: bold;
}

/* Stats */
.stats-panel {
    background: rgba(0,217,255,0.05);
    border-left: 4px solid var(--neon-cyan);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(0,217,255,0.05);
    border: 2px solid rgba(0,217,255,0.3);
    border-radius: 8px;
    transition: all 0.3s;
}

.stat-item-link {
    text-decoration: none;
    cursor: pointer;
}

.stat-item-link:hover {
    border-color: var(--neon-lime);
    box-shadow: var(--glow-lime);
    transform: scale(1.08);
    background: rgba(198,255,0,0.1);
}

.stat-item:hover {
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    transform: scale(1.05);
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    font-family: var(--font-heading);
    color: var(--neon-lime);
    text-shadow: var(--glow-lime);
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-row, .header-container {
        flex-wrap: wrap;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }
    
    .site-nav, .header-nav {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--neon-cyan);
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s;
        border-top: 3px solid rgba(0,0,0,0.2);
        z-index: 999;
        overflow-y: auto;
    }
    
    .site-nav.active, .site-nav.open, .header-nav.active, .header-nav.open {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    main {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2, .section-title {
        font-size: 1.5rem;
    }
    
    /* Таблицы на мобильных */
    table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    thead {
        display: table-header-group;
    }
    
    tbody {
        display: table-row-group;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        min-width: 80px;
    }
    
    /* Карточки на мобильных */
    .card, .competition-card {
        padding: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Формы на мобильных */
    .form-row {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        padding: 0.85rem;
        margin: 0.25rem 0;
    }
    
    .btn.small {
        padding: 0.65rem;
        width: auto;
        display: inline-block;
        min-width: 80px;
    }
    
    /* Статистика на мобильных */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    /* Модалки на мобильных */
    .modal-content {
        max-width: 95%;
        padding: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .site-logo, header h1 {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .header-container, .header-row {
        padding: 0 0.75rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2, .section-title {
        font-size: 1.3rem;
    }
    
    main {
        padding: 0.75rem;
    }
    
    .card, .competition-card {
        padding: 0.75rem;
    }
    
    /* Навигационные ссылки на очень маленьких экранах */
    .nav-link, .header-nav a {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }
    
    /* Таблицы на маленьких экранах */
    th, td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        min-width: 70px;
    }
    
    /* Бейджи */
    .badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    /* Информационные списки */
    .info li {
        font-size: 0.9rem;
        padding: 0.4rem 0;
    }
    
    /* Stat items */
    .stat-value {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}

/* Landscape mode для мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .site-nav, .header-nav {
        height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }
    
    main {
        padding: 1rem;
    }
}

/* Адаптивные утилиты */
@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }
    
    .text-center-mobile {
        text-align: center;
    }
}

@media (min-width: 769px) {
    .hidden-desktop {
        display: none !important;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-lime);
}

/* Additional styles */
.back-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.back-link:hover {
    color: var(--neon-lime);
}

.description {
    color: var(--text-secondary);
    margin: 1rem 0;
}

.login-form, .registration-form, .profile-section {
    max-width: 600px;
    margin: 2rem auto;
}

.login-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
}
