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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

header h1 {
    color: #333;
    font-size: 28px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #666;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-dot.disconnected {
    background-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    animation: none;
}

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card.full-width {
    grid-column: 1 / -1;
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #10b981;
    padding-bottom: 10px;
}

/* Plant Image Card */
.plant-image-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.plant-image-container {
    width: 400px;
    height: 400px;
    border: 3px solid #10b981;
    border-radius: 10px;
    overflow: hidden;
    background: #f9fafb;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2);
}

.plant-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
}

.plant-info {
    width: 100%;
}

.plant-info h2 {
    text-align: center;
    color: #059669;
    font-size: 24px;
    margin-bottom: 15px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f3f4f6;
    border-radius: 5px;
    margin-bottom: 10px;
}

.status-item .label {
    font-weight: 600;
    color: #666;
}

.status-item .value {
    color: #333;
    font-family: 'Courier New', monospace;
}

.status-item .value.status-online {
    color: #10b981;
    font-weight: bold;
}

.status-item .value.status-offline {
    color: #ef4444;
    font-weight: bold;
}

/* Chart Cards */
.chart-card {
    display: flex;
    flex-direction: column;
}

.current-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin: 10px 0;
}

.big-value {
    font-size: 48px;
    font-weight: bold;
    color: #059669;
}

.unit {
    font-size: 24px;
    color: #999;
    margin-left: 5px;
}

.chart-container {
    margin-top: 20px;
    text-align: center;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
}

/* Moisture Status Bar */
.moisture-status-bar {
    width: 100%;
    height: 30px;
    background: #e5e7eb;
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.moisture-bar-fill {
    height: 100%;
    transition: width 0.5s ease, background-color 0.5s ease;
    border-radius: 15px;
}

.moisture-bar-fill.dry {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.moisture-bar-fill.low {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.moisture-bar-fill.optimal {
    background: linear-gradient(90deg, #10b981, #059669);
}

.moisture-bar-fill.high {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.moisture-bar-fill.very-wet {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.moisture-recommendation {
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    font-weight: 600;
    margin-bottom: 10px;
}

.moisture-recommendation.critical {
    background: #fee2e2;
    color: #dc2626;
}

.moisture-recommendation.low {
    background: #fef3c7;
    color: #d97706;
}

.moisture-recommendation.optimal {
    background: #d1fae5;
    color: #059669;
}

.moisture-recommendation.good {
    background: #dbeafe;
    color: #2563eb;
}

.moisture-recommendation.warning {
    background: #ede9fe;
    color: #7c3aed;
}

/* Message Log */
.log-card {
    min-height: 400px;
}

.log-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.log-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    cursor: pointer;
}

.log-controls input[type="checkbox"] {
    cursor: pointer;
}

.message-log {
    background: #1f2937;
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    padding: 15px;
    border-radius: 5px;
    height: 300px;
    overflow-y: auto;
    line-height: 1.6;
}

.message-log::-webkit-scrollbar {
    width: 8px;
}

.message-log::-webkit-scrollbar-track {
    background: #111827;
}

.message-log::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

.message-log::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.log-entry {
    margin-bottom: 5px;
}

.log-entry .timestamp {
    color: #6b7280;
}

.log-entry .message {
    color: #10b981;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }

    header h1 {
        font-size: 24px;
    }

    .plant-image-container {
        width: 160px;
        height: 160px;
    }

    .big-value {
        font-size: 36px;
    }

    .unit {
        font-size: 18px;
    }

    .message-log {
        height: 250px;
        font-size: 12px;
    }
}
