body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header form {
    display: flex;
    gap: 10px;
}

header input {
    padding: 8px 12px;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

header button {
    padding: 8px 16px;
    background: #0077cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

header button:hover {
    background: #005fa3;
}

.back-link {
    color: #666;
    text-decoration: none;
    font-size: 16px;
}

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

.event-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.event-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.event-info {
    padding: 15px;
}

.event-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.event-info h3 a {
    color: #0077cc;
    text-decoration: none;
}

.event-info h3 a:hover {
    text-decoration: underline;
}

.place {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
}

.place a {
    color: #666;
    text-decoration: none;
    border-bottom: 1px dotted #ccc;
}

.age {
    display: inline-block;
    background: #ff4444;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin: 5px 0;
}

.description {
    color: #333;
    line-height: 1.5;
    margin: 10px 0;
}

.source {
    color: #999;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 0.85em;
}

.source a {
    color: #999;
    text-decoration: none;
    border-bottom: 1px dotted #ccc;
}

.event-detail, .place-detail {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.main-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    margin: 20px 0;
}

.place-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.place-info p {
    margin: 5px 0;
}

.search-results .result-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-item h3 {
    margin: 0 0 5px 0;
}

.result-item h3 a {
    color: #0077cc;
    text-decoration: none;
}
/* Предыдущие стили остаются без изменений, добавляем блок для пагинации */

.pagination {
    margin-top: 30px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    background: #0077cc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.pagination a:hover {
    background: #005fa3;
}

.pagination span {
    display: inline-block;
    padding: 8px 16px;
    background: #eee;
    color: #333;
    border-radius: 4px;
}

/* Стили для блока дат на странице события */
.dates span {
    display: inline-block;
    background: #f0f0f0;
    padding: 2px 8px;
    margin: 2px;
    border-radius: 12px;
    font-size: 0.9em;
}

/* Остальные стили (уже были) */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header form {
    display: flex;
    gap: 10px;
}

header input {
    padding: 8px 12px;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

header button {
    padding: 8px 16px;
    background: #0077cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

header button:hover {
    background: #005fa3;
}

.back-link {
    color: #666;
    text-decoration: none;
    font-size: 16px;
}

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

.event-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.event-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.event-info {
    padding: 15px;
}

.event-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.event-info h3 a {
    color: #0077cc;
    text-decoration: none;
}

.event-info h3 a:hover {
    text-decoration: underline;
}

.place {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
}

.place a {
    color: #666;
    text-decoration: none;
    border-bottom: 1px dotted #ccc;
}

.age {
    display: inline-block;
    background: #ff4444;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin: 5px 0;
}

.description {
    color: #333;
    line-height: 1.5;
    margin: 10px 0;
}

.source {
    color: #999;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 0.85em;
}

.source a {
    color: #999;
    text-decoration: none;
    border-bottom: 1px dotted #ccc;
}

.event-detail, .place-detail {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.main-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    margin: 20px 0;
}

.place-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.place-info p {
    margin: 5px 0;
}

.search-results .result-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-item h3 {
    margin: 0 0 5px 0;
}

.result-item h3 a {
    color: #0077cc;
    text-decoration: none;
}
/* Стили для сообщения об отсутствии дат */
.dates span.no-dates {
    background: transparent;
    color: #999;
    font-style: italic;
    padding: 0;
}

/* Для бесконечных событий */
.dates span.endless {
    background: #4caf50;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.9em;
}