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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5e8 100%);
    min-height: 100vh;
    color: #2d5016;
}

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

.header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(45, 80, 22, 0.1);
    border: 1px solid #e8f5e8;
}

.header h1 {
    font-size: 2.2rem;
    color: #2d5016;
    font-weight: 700;
    margin-bottom: 8px;
}

.header p {
    color: #5a7c47;
    font-size: 1rem;
    font-weight: 400;
}

.top-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(45, 80, 22, 0.1);
    border: 1px solid #e8f5e8;
    flex-wrap: wrap;
}

.city-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.city-selector label {
    font-size: 1rem;
    color: #2d5016;
    font-weight: 500;
}

.city-selector select {
    padding: 12px 16px;
    border: 2px solid #e8f5e8;
    border-radius: 12px;
    background: white;
    color: #2d5016;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
    min-width: 120px;
}

.city-selector select:focus {
    outline: none;
    border-color: #4a7c59;
}

.control-btn {
    background: #6ba172;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.control-btn:hover {
    background: #5a8f61;
}

.refresh-btn {
    background: #4a7c59;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    background: #3d6b4a;
}

.ai-section {
    background: linear-gradient(135deg, #4a7c59 0%, #6ba172 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 6px 30px rgba(45, 80, 22, 0.15);
    border: 1px solid #e8f5e8;
    color: white;
    text-align: center;
}

.ai-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ai-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

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

.ai-feature {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.ai-feature:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.ai-feature-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.ai-feature-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.ai-feature-desc {
    font-size: 0.8rem;
    opacity: 0.8;
}

.ai-activate-btn {
    background: white;
    color: #4a7c59;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ai-activate-btn:hover {
    background: #f8fdf8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.weather-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(45, 80, 22, 0.1);
    border: 1px solid #e8f5e8;
}

.weather-title {
    font-size: 1.3rem;
    color: #2d5016;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.weather-item {
    text-align: center;
    padding: 15px;
    border-radius: 12px;
    background: #f8fdf8;
    border: 1px solid #e8f5e8;
}

.weather-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.weather-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d5016;
    margin-bottom: 5px;
}

.weather-label {
    font-size: 0.85rem;
    color: #5a7c47;
}

.sensors-section {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.sensor-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(45, 80, 22, 0.1);
    border: 1px solid #e8f5e8;
    transition: transform 0.3s ease;
    max-width: 500px;
    width: 100%;
}

.sensor-card:hover {
    transform: translateY(-2px);
}

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

.sensor-title {
    font-size: 1.1rem;
    color: #2d5016;
    font-weight: 600;
}

.sensor-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #5a7c47;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4a7c59;
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: #d32f2f;
}

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

.sensor-value-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.sensor-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2d5016;
}

.sensor-unit {
    font-size: 0.9rem;
    color: #5a7c47;
    margin-left: 5px;
}

.soil-condition {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8fdf8;
    border-radius: 12px;
    border: 1px solid #e8f5e8;
}

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

.condition-text {
    font-size: 1rem;
    font-weight: 600;
    color: #2d5016;
}

.humidity-bar {
    width: 100%;
    height: 8px;
    background: #e8f5e8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.humidity-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a7c59 0%, #6ba172 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.chart-container {
    height: 200px;
    margin-top: 15px;
    background: #f8fdf8;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e8f5e8;
}

.mqtt-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(45, 80, 22, 0.1);
    border: 1px solid #e8f5e8;
    margin-bottom: 25px;
}

.mqtt-connected {
    color: #4a7c59;
}

.mqtt-disconnected {
    color: #d32f2f;
}

.last-update {
    text-align: center;
    color: #5a7c47;
    font-size: 0.9rem;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(45, 80, 22, 0.1);
    border: 1px solid #e8f5e8;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #5a7c47;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #ffcdd2;
}

@media (max-width: 768px) {
    .weather-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header h1 {
        font-size: 1.8rem;
    }

    .top-controls {
        flex-direction: column;
        gap: 15px;
    }

    .ai-features {
        grid-template-columns: 1fr;
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}
.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    cursor: pointer;
}