/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
	background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    font-family: Arial, sans-serif;
}

/* Контейнер - УВЕЛИЧЕН */
.container {
    flex: 1 0 auto;
    max-width: 1800px;
    margin: 20px auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Шапка */
header {
/*    background-color: #1e88e5; */
    background-image: url('../images/oblakaP1.jpg');
    background-size: cover;
    color: white;
    padding: 15px 20px;
}

nav {
    background-color: #1565c0;
    padding: 10px 20px;
}

nav ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

nav li {
    margin-right: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

/* Карточка погоды */
.weather-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.city-selector {
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 16px;
}

/* Сетка прогноза - 7 КАРТОЧЕК В СТРОКУ */
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
}

.forecast-day {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: transform 0.2s;
    border: 1px solid #e0e0e0;
}

.forecast-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.time-slot {
    margin: 10px 0;
    padding: 10px;
    border-radius: 6px;
    background-color: white;
    border: 1px solid #f0f0f0;
}

.time-of-day {
    font-weight: bold;
    margin-bottom: 5px;
    color: #1e88e5;
}

.weather-icon {
    margin: 10px 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-icon img {
    max-width: 100%;
    max-height: 50px;
    object-fit: contain;
}

.temperature {
    font-size: 20px;
    font-weight: bold;
    margin: 10px 0;
}

.absolute-zero {
    color: #9c27b0;
    font-weight: bold;
}

.extreme {
    color: #ff5722;
    font-weight: bold;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Стили для множественного выбора */
.multiple-select {
    height: auto;
    min-height: 120px;
}

.multiple-select option {
    padding: 5px;
    border-bottom: 1px solid #eee;
}

.multiple-select option:hover {
    background-color: #f0f0f0;
}

/* Стили для отображения нескольких условий */
.conditions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.condition-tag {
    background-color: #e3f2fd;
    border: 1px solid #1e88e5;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    color: #1565c0;
    display: inline-block;
    margin: 2px;
}

/* Специфические стили для экстремальных условий */
.condition-tag.extreme {
    background-color: #ffebee;
    border-color: #f44336;
    color: #c62828;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Стили для разных типов явлений */
.condition-tag.sunny { background-color: #fff9c4; border-color: #ffeb3b; color: #f57f17; }
.condition-tag.cloudy { background-color: #f5f5f5; border-color: #9e9e9e; color: #616161; }
.condition-tag.rainy { background-color: #e3f2fd; border-color: #2196f3; color: #1565c0; }
.condition-tag.snowy { background-color: #e0f2f1; border-color: #009688; color: #00695c; }
.condition-tag.stormy { background-color: #f3e5f5; border-color: #9c27b0; color: #6a1b9a; }
.condition-tag.extreme-event { 
    background-color: #ffebee; 
    border-color: #f44336; 
    color: #c62828; 
    font-weight: bold;
}

/* Стили для админ-панели */
.admin-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn {
    padding: 10px 15px;
    background-color: #1e88e5;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #1565c0;
}

.btn-danger {
    background-color: #f44336;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.message {
    background-color: #4caf50;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error {
    background-color: #f44336;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Стили для вкладок админ-панели */
.admin-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #1e88e5;
}

.admin-tab {
    padding: 12px 20px;
    background-color: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    border-radius: 8px 8px 0 0;
    margin-right: 5px;
}

.admin-tab.active {
    background-color: #1e88e5;
    color: white;
}

.admin-tab:hover:not(.active) {
    background-color: #e0e0e0;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Стили для статистики посещений */
.stats-overview {
    margin-bottom: 30px;
}

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

.stat-card {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.stat-card h3 {
    margin-bottom: 15px;
    color: #1e88e5;
    border-bottom: 2px solid #1e88e5;
    padding-bottom: 5px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.stat-label {
    font-weight: bold;
}

.stat-value {
    color: #1e88e5;
    font-weight: bold;
}

.daily-stats {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
}

.daily-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.daily-stat-item:last-child {
    border-bottom: none;
}

.stat-date {
    font-weight: bold;
}

.stat-count {
    color: #1e88e5;
}

/* Стили для страницы входа */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
}

.login-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.back-link {
    display: inline-block;
    margin-top: 15px;
    color: #1e88e5;
    text-decoration: none;
}

/* Стили для изображений */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-item {
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #f9f9f9;
}

.image-item img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}

.image-name {
    margin-top: 5px;
    font-size: 14px;
    word-break: break-word;
}

/* Стили для истории */
.history-list {
    max-height: 600px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    gap: 15px;
}

.history-item:hover {
    background-color: #f9f9f9;
}

.history-date {
    font-weight: bold;
    min-width: 150px;
}

.history-time {
    min-width: 60px;
    text-align: center;
    background-color: #e3f2fd;
    padding: 2px 8px;
    border-radius: 4px;
}

.history-conditions {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.history-temperature {
    font-weight: bold;
    min-width: 80px;
    text-align: right;
}

/* Стили для API страницы */
.api-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.code-block {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
}

.code-block a {
    color: #1e88e5;
    text-decoration: none;
}

.code-block a:hover {
    text-decoration: underline;
}

/* Футер всегда внизу */
footer {
    background-image: url('../images/oblakaP2.jpg');
    background-size: cover;
    flex-shrink: 0;
    background-color: #1e88e5;
    color: white;
    padding: 30px 0 10px;
    margin-top: 40px;
    width: 100%;
}

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

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

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

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

.footer-section a {
    color: #e3f2fd;
    text-decoration: none;
}

.footer-section a:hover {
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid #64b5f6;
    padding-top: 15px;
    text-align: center;
    font-size: 14px;
    max-width: 1800px;
    margin: 0 auto;
    padding: 15px 20px 0;
}

/* Адаптивность для мобильных */
@media (max-width: 1800px) {
    .forecast-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 1600px) {
    .forecast-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1400px) {
    .forecast-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .forecast-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .forecast-grid {
        grid-template-columns: 1fr;
    }
    
    .weather-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .time-slot {
        padding: 5px;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .admin-tab {
        border-radius: 0;
        margin-right: 0;
        margin-bottom: 2px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .history-date, .history-time, .history-temperature {
        min-width: auto;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Стили для формы удаления изображений */
.delete-image-form {
    margin-top: 10px;
    text-align: center;
}

.image-item {
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #f9f9f9;
    transition: all 0.3s;
    position: relative;
}

.image-item:hover {
    border-color: #1e88e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-item img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
    border-radius: 4px;
}

.image-name {
    margin-top: 5px;
    font-size: 14px;
    word-break: break-word;
    font-weight: bold;
    color: #333;
}

/* Маленькие кнопки */
.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    margin-top: 5px;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .image-item {
        padding: 8px;
    }
    
    .image-item img {
        max-height: 80px;
    }
}

.news-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.news-list {
    max-width: 800px;
    margin: 0 auto;
}

.news-item {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    width: 100%;
}

.news-item h3 {
    color: #333;
    margin-bottom: 10px;
}

.news-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.news-content {
    color: #444;
    line-height: 1.6;
}

/* Стили для админ-панели */
.news-list .news-item {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #ddd;
}

.current-version {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.version-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #1e88e5;
}

.version-info p {
    margin: 8px 0;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.version-info p:last-child {
    border-bottom: none;
}

.admin-form-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
}

.admin-form-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #1e88e5;
    padding-bottom: 10px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease;
    max-width: 300px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background-color: #4CAF50;
}

.notification.error {
    background-color: #f44336;
}

.notification.info {
    background-color: #2196F3;
}

.locate-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
}

.locate-btn:hover {
    background: #45a049;
}

.locate-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.alternative-cities {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #2196F3;
}