* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Header & Navigation */
.navbar {
    background-color: #1b4332;
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.navbar h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

nav {
    display: flex;
    gap: 2rem;
}

.nav-item {
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.dashboard {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.dashboard h2 {
    color: #1b4332;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

/* Sensors Grid */
.sensors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.sensor-card {
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(27, 67, 50, 0.2);
    transition: transform 0.3s;
}

.sensor-card:hover {
    transform: translateY(-4px);
}

.sensor-card h3 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.sensor-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.sensor-unit {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.sensor-status {
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.15);
    margin-top: 0.5rem;
}

/* Pump Control */
.pump-control {
    background-color: #f0f0f0;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 5px solid #1b4332;
}

.pump-control h2 {
    color: #1b4332;
    margin-bottom: 1.5rem;
}

.pump-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #dc2f02;
    box-shadow: 0 0 10px rgba(220, 47, 2, 0.5);
    animation: pulse 2s infinite;
}

.status-indicator.active {
    background-color: #2d6a4f;
    box-shadow: 0 0 10px rgba(45, 106, 79, 0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pump-button {
    background-color: #1b4332;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 600;
}

.pump-button:hover {
    background-color: #2d6a4f;
    transform: scale(1.05);
}

.pump-button:active {
    transform: scale(0.98);
}

.pump-button.active {
    background-color: #dc2f02;
}

/* Crops Section */
.crops-section {
    margin-top: 2rem;
}

.crops-section h2 {
    color: #1b4332;
    margin-bottom: 1.5rem;
}

.crops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.crop-card {
    background: white;
    border: 2px solid #1b4332;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.crop-card:hover {
    transform: translateY(-4px);
}

.crop-card h3 {
    background-color: #1b4332;
    color: white;
    padding: 1rem;
    margin: 0;
}

.crop-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #e0e0e0;
}

.crop-card p {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-weight: 500;
}

/* Footer */
.footer {
    background-color: #1b4332;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

/* Weather Card Styles */
.weather-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin: 1rem 0;
}

.weather-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
}

.weather-main {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.weather-main .temperature {
    font-size: 2.5rem;
    font-weight: bold;
}

.weather-main .description {
    font-size: 1rem;
    font-style: italic;
    opacity: 0.9;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.weather-item {
    background: rgba(255,255,255,0.2);
    padding: 0.8rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weather-item .label {
    font-weight: 600;
}

.weather-item .value {
    font-size: 1.1rem;
    font-weight: bold;
}

.irrigation-tip {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

#weatherInfo {
    margin: 1.5rem 0;
}

.weather-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.weather-section h3 {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .sensors-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .sensor-value {
        font-size: 2rem;
    }

    .crops-grid {
        grid-template-columns: 1fr;
    }
}
