/* style.css */
:root {
    --primary-color: #2E7D32; /* Green */
    --secondary-color: #4CAF50;
    --background-color: #f0f4f0;
    --text-color: #333;
    --card-bg: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    text-align: center;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.upload-label {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.upload-label:hover {
    background-color: var(--secondary-color);
}

#image-preview {
    max-width: 100%;
    max-height: 300px;
    margin-top: 20px;
    border-radius: var(--border-radius);
    border: 2px dashed #ccc;
}

#controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

button {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    background-color: var(--secondary-color);
    color: white;
    transition: all 0.3s ease;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

#identify-disease-btn {
    background-color: #c62828; /* Red for disease */
}
#identify-disease-btn:hover {
    background-color: #d32f2f;
}

.hidden {
    display: none !important;
}

#results {
    margin-top: 20px;
    padding: 20px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    min-height: 100px;
    text-align: left;
    white-space: pre-wrap; /* Preserves formatting from AI */
    line-height: 1.6;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 1.5rem;
    }
    #controls {
        flex-direction: column;
    }
}