:root {
    --primary-color: #2ecc71;
    --secondary-color: #e67e22;
    --bg-color: #f9fbf9;
    --text-color: #2c3e50;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 30px 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.logo i {
    font-size: 2rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
}

header p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.hidden {
    display: none !important;
}

/* Setup Section */
.input-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

input[type="password"], input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    outline: none;
}

input:focus {
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.secondary {
    background-color: #95a5a6;
    color: white;
    width: 100%;
    margin-top: 20px;
}

.btn:active {
    transform: scale(0.98);
}

/* Upload Buttons */
.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fdfdfd;
    border: 2px dashed #dcdde1;
    padding: 30px 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-action:hover {
    border-color: var(--primary-color);
    background: #f0fff4;
}

.btn-action i {
    font-size: 24px;
    color: var(--primary-color);
}

.btn-action input {
    display: none;
}

/* Result Section */
.preview-container {
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #eee;
    aspect-ratio: 4 / 3;
}

#image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid var(--secondary-color);
}

.result-item {
    margin-bottom: 15px;
}

.result-item h4 {
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.calorie-badge {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 10px 0;
}

/* Contact Form */
.contact-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-color);
}

.form-group input, .form-group textarea {
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
}

.btn.full-width {
    width: 100%;
}

footer {
    text-align: center;
    font-size: 0.8rem;
    color: #bdc3c7;
    margin-top: auto;
    padding: 20px 0;
}

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