/**
 * Улучшенные стили для шаблонов городов
 */

/* Основные стили и переменные */
:root {
    --primary-color: #2e86de;
    --primary-dark: #1a5cb0;
    --secondary-color: #ff9f43;
    --dark-color: #222f3e;
    --light-color: #f5f6fa;
    --accent-color: #10ac84;
    --danger-color: #ee5253;
    --text-color: #333;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    background-color: #f9f9f9;
    background-image: linear-gradient(to bottom, #f3f9ff 0%, #f9f9f9 100%);
    background-attachment: fixed;
    color: var(--text-color);
}

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

/* Заголовки страниц */
.archive-header,
.city-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin-bottom: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

.archive-header:before,
.city-header:before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: 150px 150px;
    z-index: 0;
    opacity: 0.3;
}

.archive-header h1,
.city-header h1 {
    position: relative;
    z-index: 1;
    margin-top: 0;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.archive-header p,
.city-header p {
    position: relative;
    z-index: 1;
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Поиск */
.search-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0 2.5rem;
}

.search-container input {
    padding: 1rem 1.5rem;
    width: 70%;
    max-width: 600px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
    background-color: white;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="gray" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>');
    background-repeat: no-repeat;
    background-position: 20px center;
    padding-left: 55px;
}

.search-container input:focus {
    outline: none;
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.15);
    width: 75%;
}

/* Вкладки */
.tabs {
    display: flex;
    margin: 2.5rem 0 0;
    border-bottom: none;
    justify-content: center;
}

.tab {
    padding: 1rem 2rem;
    cursor: pointer;
    background-color: white;
    border: none;
    border-radius: 50px;
    margin-right: 1rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    color: #777;
}

.tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    color: var(--primary-color);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.tab-content {
    display: none;
    padding: 2rem;
    background-color: transparent;
    border: none;
    margin-top: 1.5rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Карточки городов */
.popular-cities {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.city-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    width: 300px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border-top: 5px solid var(--primary-color);
}

.city-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.city-card:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, rgba(46, 134, 222, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 0;
}

.single-city-card {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 3rem;
    padding: 2.5rem;
}

.city-name {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
    position: relative;
}

.city-name:after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 0.75rem auto;
    border-radius: 3px;
}

.city-time {
    font-size: 3rem;
    font-weight: 700;
    margin: 1.5rem 0;
    color: var(--primary-color);
    letter-spacing: -1px;
    font-family: 'Montserrat', sans-serif;
}

.city-date {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.city-details {
    margin-top: 1.5rem;
    font-size: 1rem;
    color: #555;
    padding-bottom: 1rem;
    border-bottom: 1px dashed #eee;
}

.city-link {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #f9ca24 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(255, 159, 67, 0.3);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.city-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 159, 67, 0.4);
}

/* Список городов */
.cities-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2rem 0;
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

.cities-list a {
    margin: 0.5rem 0.75rem;
    padding: 0.5rem 1rem;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    transition: var(--transition);
    font-weight: 500;
    background-color: #f5f9ff;
}

.cities-list a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Информация о часовом поясе */
.timezone-info {
    background-color: #f5f9ff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    text-align: left;
    border-left: 4px solid var(--primary-color);
}

.timezone-detail {
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
}

.timezone-detail strong {
    margin-right: 0.5rem;
    color: var(--dark-color);
}

/* Информация о солнце */
.sun-info {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(to right, #fff9e6, #ffefd1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.sun-detail {
    text-align: center;
    flex: 1;
    position: relative;
}

.sun-detail:first-child:after {
    content: "";
    position: absolute;
    top: 10%;
    right: 0;
    height: 80%;
    width: 1px;
    background-color: rgba(0,0,0,0.1);
}

.sun-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.sun-rise, .sun-set {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* Сравнение */
.comparison-container {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin: 2.5rem 0;
    border-top: 5px solid var(--accent-color);
}

.comparison-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--accent-color);
}

.comparison-selectors {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.city-selector {
    padding: 0.85rem 1.5rem;
    border-radius: 50px;
    border: 1px solid #e6e6e6;
    min-width: 250px;
    background-color: #fafafa;
    font-size: 1rem;
    transition: var(--transition);
}

.city-selector:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(16, 172, 132, 0.1);
}

#compareButton,
#compareWithCurrentButton {
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #1dd1a1 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(16, 172, 132, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

#compareButton:hover,
#compareWithCurrentButton:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 172, 132, 0.4);
}

.comparison-results {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed #e6e6e6;
}

.comparison-card {
    background: linear-gradient(to bottom, #f3f4f6, #e5e7eb);
    border-radius: var(--border-radius);
    padding: 2rem;
    min-width: 220px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-weight: 600;
    color: var(--dark-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.comparison-card strong {
    margin-bottom: 1rem;
    display: block;
    font-size: 1.1rem;
    color: var(--accent-color);
}

/* Детальная страница города */
.city-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.city-description {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 2rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    line-height: 1.6;
}

.city-description h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.nearby-cities h2,
.compare-with-current h2 {
    text-align: center;
    margin: 3rem 0 1.5rem;
    color: var(--dark-color);
    font-size: 1.8rem;
    position: relative;
}

.nearby-cities h2:after,
.compare-with-current h2:after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 0.75rem auto;
    border-radius: 3px;
}

.back-to-cities {
    text-align: center;
    margin: 3rem 0;
}

.back-to-cities .button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--dark-color) 0%, #34495e 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.back-to-cities .button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Анимации и декоративные элементы */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.city-time {
    animation: pulse 2s infinite;
}

/* Медиа запросы */
@media (max-width: 768px) {
    .archive-header h1,
    .city-header h1 {
        font-size: 2rem;
    }
    
    .popular-cities {
        flex-direction: column;
        align-items: center;
    }
    
    .city-card {
        width: 100%;
        max-width: 350px;
    }
    
    .comparison-selectors {
        flex-direction: column;
        align-items: center;
    }
    
    .city-selector {
        width: 100%;
    }
    
    .comparison-results {
        flex-direction: column;
        align-items: center;
    }
    
    .comparison-card {
        width: 100%;
    }
    
    .tab {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .search-container input {
        width: 90%;
    }
}