/* ===== VARIABLES ===== */
:root {
    --bg: #0b1e14;
    --surface: rgba(20, 40, 30, 0.8);
    --text: #e2f0e6;
    --text-secondary: #a0c9b0;
    --accent: #4caf50;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, #0a1a10 0%, #0f2a1c 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 24px 16px;
}

.app { max-width: 800px; margin: 0 auto; }

/* Header */
.header { text-align: center; margin-bottom: 32px; }
.logo { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 2.5rem; }
.logo i { color: var(--accent); filter: drop-shadow(0 0 10px rgba(76,175,80,0.3)); }
h1 { font-weight: 700; letter-spacing: -0.02em; }
.tagline { color: var(--text-secondary); margin-top: 8px; }

/* Cards */
.card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
h2 { font-size: 1.5rem; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
h2 i { color: var(--accent); }

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 24px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}
.upload-area:hover { border-color: var(--accent); background: rgba(76,175,80,0.05); }
.upload-area i { font-size: 3rem; color: var(--text-secondary); margin-bottom: 12px; }
.upload-area p { font-size: 1.1rem; margin-bottom: 6px; }
.hint { font-size: 0.85rem; color: var(--text-secondary); }

/* Preview */
.preview-container { text-align: center; margin-bottom: 20px; }
.preview-container img { max-width: 100%; max-height: 250px; border-radius: 16px; margin-bottom: 12px; border: 1px solid var(--border); }
.preview-actions { display: flex; gap: 10px; justify-content: center; }

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 40px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 20px rgba(76,175,80,0.2);
    width: 100%;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:hover:not(:disabled) { background: #5cbf60; transform: scale(1.01); }

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); }
.btn-small { padding: 6px 14px; font-size: 0.9rem; }

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.icon-btn:hover { background: var(--accent); border-color: var(--accent); }

/* Plant Info */
.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.plant-info { display: grid; gap: 12px; }
.info-row { display: flex; border-bottom: 1px solid var(--border); padding: 10px 0; }
.info-label { font-weight: 600; width: 130px; color: var(--text-secondary); }
.info-value { flex: 1; }

/* Garden Tips */
.garden-tips { background: rgba(76,175,80,0.1); border-radius: 18px; padding: 18px; border-left: 4px solid var(--accent); }

/* History */
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
    background: rgba(0,0,0,0.15);
    padding: 12px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}
.history-item:hover { background: rgba(76,175,80,0.1); }
.history-item img { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; }
.history-item .history-info { flex: 1; }
.history-item .history-name { font-weight: 600; }
.history-item .history-scientific { font-size: 0.85rem; color: var(--text-secondary); font-style: italic; }
.empty-message { text-align: center; color: var(--text-secondary); padding: 20px; }

.loading-spinner { margin-left: 8px; }

/* Footer */
footer { text-align: center; margin-top: 32px; color: var(--text-secondary); }

/* Responsive */
@media (max-width: 600px) {
    .card { padding: 20px; }
    .info-row { flex-direction: column; gap: 4px; }
    .info-label { width: 100%; }
}
