/* style.css — основные стили метеостанции */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    padding-bottom: 120px;
    position: relative;
}

body.maintenance-mode {
    background: linear-gradient(135deg, #434343 0%, #2c2c2c 100%);
}

body.winter-mode {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

/* Баннер техобслуживания */
.maintenance-banner {
    display: none;
    background: rgba(255, 193, 7, 0.25);
    border: 2px solid rgba(255, 193, 7, 0.5);
    border-radius: 12px;
    padding: 15px 20px;
    margin: 0 auto 15px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    gap: 10px;
    color: #ffc107;
    max-width: 700px;
    width: 100%;
}

.maintenance-banner.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.maintenance-icon {
    font-size: 1.5rem;
}

/* Шапка */
.header {
    text-align: center;
    margin-bottom: 8px;
}

.header-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.header-title {
    font-size: 1.4rem;
    font-weight: 700;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Прогноз */
.forecast-banner {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 0 auto 10px;
    font-size: 0.9rem;
    text-align: center;
    max-width: 700px;
    width: 100%;
    line-height: 1.4;
}

.forecast-banner .icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 4px;
}

.forecast-banner .main-text {
    font-weight: 600;
    font-size: 1rem;
}

.forecast-banner .detail {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 4px;
}

/* Предупреждения */
.warning-banner {
    background: rgba(255, 107, 107, 0.25);
    border: 2px solid rgba(255, 107, 107, 0.6);
    border-radius: 12px;
    padding: 14px 18px;
    margin: 0 auto 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    max-width: 700px;
    width: 100%;
    display: none;
    animation: pulse 2s infinite;
}

.warning-banner.active {
    display: block;
}

.warning-banner.frost {
    background: rgba(100, 181, 246, 0.25);
    border-color: rgba(100, 181, 246, 0.6);
    color: #e3f2fd;
}

.warning-banner.disease {
    background: rgba(156, 39, 176, 0.25);
    border-color: rgba(156, 39, 176, 0.6);
    color: #f3e5f5;
}

.warning-banner.extreme-cold {
    background: rgba(33, 150, 243, 0.35);
    border-color: rgba(33, 150, 243, 0.8);
    color: #e3f2fd;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Агроблоки */
.agro-container {
    max-width: 700px;
    width: 100%;
    margin: 0 auto 10px;
}

.agro-block {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}

.agro-header {
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.agro-header:hover {
    background: rgba(255, 255, 255, 0.18);
}

.agro-header .title {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agro-header .toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.agro-header.expanded .toggle-icon {
    transform: rotate(180deg);
}

.agro-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: rgba(0, 0, 0, 0.15);
}

.agro-content.expanded {
    max-height: 500px;
}

.agro-inner {
    padding: 14px 18px;
}

.agro-block.general {
    border-color: rgba(144, 238, 144, 0.4);
}

.agro-block.general .agro-header {
    background: rgba(144, 238, 144, 0.15);
}

.agro-tips p {
    margin: 4px 0;
    font-size: 0.85rem;
    opacity: 0.95;
}

.agro-block.crops {
    border-color: rgba(255, 255, 255, 0.2);
}

.agro-block.crops .agro-header {
    background: rgba(255, 255, 255, 0.12);
}

.crops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.crop-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.8rem;
    border-left: 3px solid #90EE90;
}

.crop-card.critical {
    border-left-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

.crop-card.warning {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.15);
}

.crop-card.good {
    border-left-color: #90EE90;
    background: rgba(144, 238, 144, 0.15);
}

.crop-card .crop-icon {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 4px;
}

.crop-card .crop-name {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.crop-card .crop-status {
    font-size: 0.7rem;
    opacity: 0.8;
    display: block;
}

.crop-card .crop-action {
    font-size: 0.7rem;
    opacity: 0.9;
    margin-top: 4px;
    display: block;
    font-style: italic;
}

/* Индикатор предупреждений */
.warning-indicator {
    display: none;
    background: rgba(255, 107, 107, 0.3);
    border: 1px solid rgba(255, 107, 107, 0.6);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.warning-indicator.active {
    display: inline-block;
}

/* Лунный календарь */
.lunar-banner {
    background: rgba(171, 178, 235, 0.15);
    border: 1px solid rgba(171, 178, 235, 0.4);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 0 auto 10px;
    font-size: 0.85rem;
    text-align: center;
    max-width: 700px;
    width: 100%;
}

.lunar-banner .icon {
    font-size: 1.3rem;
    margin-right: 6px;
}

.lunar-banner .phase {
    font-weight: 600;
    color: #e8eaf6;
}

.lunar-banner .recommendation {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 4px;
}

/* Карточки погоды */
.dual-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 700px;
    width: 100%;
    margin-bottom: 10px;
}

.location-block {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 10px;
    text-align: center;
}

.location-block.hidden {
    display: none;
}

.location-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.location-title a {
    color: #fff;
    text-decoration: none;
}

.location-title a:hover {
    text-decoration: underline;
}

.location-period {
    font-size: 0.65rem;
    opacity: 0.6;
    color: #90EE90;
    margin-bottom: 6px;
}

.location-update {
    font-size: 0.6rem;
    opacity: 0.5;
    margin-bottom: 6px;
}

.param-row {
    margin: 4px 0;
    font-size: 0.85rem;
}

.param-row .val {
    font-weight: 700;
    font-size: 1.2rem;
}

.param-row .unit {
    font-size: 0.7rem;
    opacity: 0.7;
}

.no-data {
    font-size: 0.85rem;
    opacity: 0.5;
    padding: 10px 0;
}

.soil-temp {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Статистика */
.stats-row {
    display: flex;
    gap: 10px;
    max-width: 700px;
    width: 100%;
    margin: 8px auto;
}

.stats-toggle {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.stats-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.stats-block {
    display: none;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    padding: 16px 20px;
    margin: 6px auto 10px;
    max-width: 500px;
    width: 95%;
    font-size: 0.9rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.stats-block.active {
    display: block;
}

.stats-item {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.stats-item span:first-child {
    opacity: 0.8;
    font-size: 0.85rem;
}

.stats-item span:last-child {
    font-weight: 600;
    font-size: 0.9rem;
}

.stats-block h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.9;
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Подвал */
.narodmon-info {
    position: fixed;
    bottom: 65px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: center;
    width: 100%;
    max-width: 400px;
    z-index: 5;
}

.narodmon-info a {
    color: #90EE90;
}

.copyright {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: center;
    width: 100%;
}

.visit-counter {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.visit-counter img {
    width: 50px;
    height: 16px;
}

/* Кнопка уведомлений */
.notification-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 10px 16px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.notification-btn.enabled {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
}

/* Адаптивность */
@media (max-width: 480px) {
    .dual-columns {
        gap: 6px;
    }
    
    .location-block {
        padding: 10px 6px;
    }
    
    .location-title {
        font-size: 0.8rem;
    }
    
    .param-row {
        font-size: 0.75rem;
    }
    
    .param-row .val {
        font-size: 1.1rem;
    }
    
    .stats-block {
        max-width: 340px;
        padding: 12px 14px;
        font-size: 0.8rem;
    }
    
    .stats-toggle {
        font-size: 0.8rem;
        padding: 8px 10px;
    }
    
    .crops-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .warning-banner,
    .agro-inner {
        font-size: 0.85rem;
        padding: 12px 14px;
    }
    
    .notification-btn {
        bottom: 80px;
        right: 10px;
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* Вспомогательные классы */
.hidden {
    display: none !important;
}

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

.mt-2 {
    margin-top: 8px;
}

.mb-2 {
    margin-bottom: 8px;
}

/* Кнопка уведомлений в ряду статистики */
.notification-toggle {
    background: rgba(255, 255, 255, 0.15);
}

.notification-toggle.enabled {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
}

.notification-toggle.enabled:hover {
    background: rgba(76, 175, 80, 0.4);
}

/* Адаптив для кнопок статистики */
@media (max-width: 480px) {
    .stats-row {
        flex-wrap: wrap;
    }
    
    .stats-toggle {
        flex: 1 1 auto;
        font-size: 0.75rem;
        padding: 8px 6px;
    }
}

/* ===== СТИЛИ ДЛЯ ПАНЕЛИ НАСТРОЕК (nastroiki.php) ===== */

/* Контейнер для быстрых ссылок */
.quick-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Стиль для ссылок-кнопок в админке */
.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px 16px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
}

.admin-link:active {
    transform: translateY(0);
}

/* Альтернативный стиль для кнопок действий (блокировка/разблокировка) */
.action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    color: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
}

.block-btn {
    background: rgba(255, 193, 7, 0.3);
    border: 1px solid rgba(255, 193, 7, 0.5);
}

.block-btn:hover {
    background: rgba(255, 193, 7, 0.5);
}

.unblock-btn {
    background: rgba(40, 167, 69, 0.3);
    border: 1px solid rgba(40, 167, 69, 0.5);
}

.unblock-btn:hover {
    background: rgba(40, 167, 69, 0.5);
}

/* Секция с нагрузкой на сервер */
.stats-section {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.stats-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px 20px;
    text-align: center;
    min-width: 100px;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Таблицы в админке */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 600;
    font-size: 0.85rem;
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Заголовки секций */
.section-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Тоггл-переключатель (улучшенный) */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 12px;
    border-radius: 30px;
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Адаптив для админки */
@media (max-width: 768px) {
    .admin-table th,
    .admin-table td {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .admin-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .stat-card {
        min-width: 80px;
        padding: 8px 12px;
    }
    
    .stat-card .stat-value {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .quick-links {
        flex-direction: column;
    }
    
    .admin-link {
        justify-content: center;
    }
    
    .admin-table {
        display: block;
        overflow-x: auto;
    }
}
/* ===== ССЫЛКИ НА ГРАФИКИ В КАРТОЧКАХ ===== */

/* Основная ссылка в заголовке карточки */
.location-title {
    margin-bottom: 8px;
}

.graph-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 6px 14px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.graph-link:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.graph-link:active {
    transform: translateY(0);
}

.graph-link-icon {
    font-size: 1.1rem;
}

.graph-link-text {
    border-bottom: 1px dashed rgba(255,255,255,0.5);
}

/* Маленькая ссылка внизу карточки */
.card-footer {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.graph-link-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 4px 12px;
    text-decoration: none;
    color: #90EE90;
    font-size: 0.7rem;
    transition: all 0.2s ease;
}

.graph-link-small:hover {
    background: rgba(144, 238, 144, 0.2);
    border-color: #90EE90;
    color: #fff;
    transform: translateX(3px);
}

/* Для мобильных устройств */
@media (max-width: 480px) {
    .graph-link {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    .graph-link-icon {
        font-size: 0.9rem;
    }
    
    .graph-link-small {
        padding: 3px 10px;
        font-size: 0.65rem;
    }
}
/* === TOAST УВЕДОМЛЕНИЯ === */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 200px;
    max-width: 350px;
    padding: 12px 16px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease forwards;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toast-success {
    background: rgba(40, 167, 69, 0.9);
    border-left: 4px solid #28a745;
    color: white;
}

.toast-error {
    background: rgba(220, 53, 69, 0.9);
    border-left: 4px solid #dc3545;
    color: white;
}

.toast-info {
    background: rgba(0, 123, 255, 0.9);
    border-left: 4px solid #007bff;
    color: white;
}

.toast-warning {
    background: rgba(255, 193, 7, 0.9);
    border-left: 4px solid #ffc107;
    color: #333;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.75rem;
    opacity: 0.9;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@media (max-width: 480px) {
    .toast {
        max-width: 280px;
        padding: 10px 14px;
    }
    .toast-icon {
        font-size: 1rem;
    }
}