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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-link:hover {
    color: white;
}

/* Hero */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Marathons Grid */
.marathons-section {
    padding: 40px 0;
}

.marathons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.marathon-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.marathon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-badge {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
}

.badge-info { background: #eff6ff; color: #1e40af; }
.badge-success { background: #f0fdf4; color: #166534; }
.badge-warning { background: #fffbeb; color: #92400e; }

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #1e293b;
}

.card-dates {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.date-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 0.9rem;
}

.date-label {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
}

.date-value {
    font-weight: 600;
    color: #334155;
}

.date-divider {
    color: #cbd5e1;
}

.card-description {
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.participants-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin: 30px 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 1.5rem;
    color: #64748b;
    margin-bottom: 10px;
}

/* Marathon Detail Page */
.marathon-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
}

.marathon-hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.marathon-dates {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.date-badge {
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.participants-limit {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.marathon-description {
    padding: 40px 0;
}

.marathon-description h2 {
    margin-bottom: 20px;
    color: #1e293b;
}

.description-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    line-height: 1.8;
    color: #334155;
}

.marathon-participants {
    padding: 40px 0;
}

.marathon-participants h2 {
    margin-bottom: 30px;
    color: #1e293b;
}

.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.participant-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
}

.participant-avatar {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.participant-goal {
    color: #64748b;
    margin-top: 10px;
    font-size: 0.9rem;
}

.participant-joined {
    display: block;
    margin-top: 15px;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 80px 20px;
}

.error-state i {
    font-size: 5rem;
    color: #f59e0b;
    margin-bottom: 20px;
}

.error-state h2 {
    color: #64748b;
    margin-bottom: 20px;
}

/* Footer */
.main-footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h3,
.footer-col h4 {
    color: white;
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col a {
    color: #94a3b8;
    text-decoration: none;
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 20px;
    text-align: center;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .marathons-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .main-header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Стили для карточек участников на странице марафона */
.participant-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.participant-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.participant-card-link {
    text-decoration: none;
    color: inherit;
}

.participant-card-link:hover h3 {
    color: #4f46e5;
}

.participant-avatar {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.participant-card h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: #1e293b;
    transition: color 0.2s;
}

.participant-progress {
    margin: 5px 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.progress-label {
    color: #64748b;
}

.progress-value {
    font-weight: 700;
    color: #4f46e5;
}

.progress-bar-container {
    background: #e2e8f0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #4f46e5);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.participant-stats-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

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

.mini-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.mini-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.participant-last-update {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

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

/* Форма ввода пароля */
.password-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 20px;
}

.password-form-wrapper {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.password-icon {
    font-size: 50px;
    color: #4f46e5;
    margin-bottom: 20px;
}

.password-form-wrapper h2 {
    margin-bottom: 10px;
    color: #1e293b;
}

.password-form-wrapper p {
    color: #64748b;
    margin-bottom: 20px;
}

.password-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 16px;
    text-align: center;
}

.password-form .form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.btn-block {
    width: 100%;
    justify-content: center;
    margin-top: 15px;
    padding: 12px;
    font-size: 16px;
}

.password-error {
    color: #ef4444;
    margin-top: 10px;
    font-size: 14px;
}

/* Карточки участников на странице марафона */
.participant-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.participant-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.participant-card-link {
    text-decoration: none;
    color: inherit;
}

.participant-card-link:hover h3 {
    color: #4f46e5;
}

.participant-avatar {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.participant-card h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: #1e293b;
    transition: color 0.2s;
}

.participant-progress {
    margin: 5px 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.progress-label {
    color: #64748b;
}

.progress-value {
    font-weight: 700;
    color: #4f46e5;
}

.progress-bar-container {
    background: #e2e8f0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #4f46e5);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.participant-stats-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

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

.mini-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.mini-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.participant-last-update {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}
/* Карточка достигшего цель */
.participant-card.goal-reached {
    border: 2px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.participant-card.goal-reached::after {
    content: '👑';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    animation: float 2s ease-in-out infinite;
}