/* --- Global Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Comfortaa', sans-serif; /* Applied from style.css */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Gradient from style.css and screenshot */
    background: radial-gradient(circle at top left, skyblue, #9cb8b3); 
}

/* --- Header (Green Bar) --- */
header {
    background: #4CAF50;
    color: #fff;
    padding: 15px 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.8rem;
    margin: 0;
}

/* --- Navigation (White Bar) --- */
nav {
    background: #fff;
    border-bottom: 1px solid #ddd;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 10px;
    gap: 30px;
}

nav a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: transform 0.2s;
}

nav a:hover {
    transform: scale(1.1);
}

/* --- Main Content --- */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* --- Green Card Container (from style.css) --- */
.container {
    background: rgb(82, 175, 82);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-header h2, .card-header p {
    background: white;
    color: #1b4332;
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.card-header h2 { font-size: 1.2rem; }
.card-header p { font-size: 0.9rem; margin-bottom: 30px; }

/* --- Upload Area --- */
#imageInput { display: none; } /* Hides the "Choose File" text */

.custom-file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f0fdf4;
    color: #2d6a4f;
    padding: 20px;
    border: 2px dashed #b7e4c7;
    border-radius: 20px;
    margin-bottom: 20px;
    cursor: pointer;
    font-weight: 600;
}

#previewImg {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 20px;
}

/* --- Buttons --- */
button {
    background: linear-gradient(135deg, #40916c 0%, #2d6a4f 100%);
    color: white;
    border: none;
    padding: 18px;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(45, 106, 79, 0.3);
}

/* --- Results --- */
.result-box {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 20px;
    text-align: left;
}

/* --- Footer --- */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 15px 0;
    font-size: 0.8rem;
}

.hidden { display: none; }

.spinner {
    border: 3px solid #e9f5ee;
    border-top: 3px solid #40916c;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 0.8s linear infinite;
    margin: 10px auto;
}

@keyframes spin { 100% { transform: rotate(360deg); } }