:root {
    --primary: #10b981; /* Emerald Green */
    --primary-hover: #059669;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-radius: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

header { 
    text-align: center; 
    margin-bottom: 1rem; 
}

header h1 { 
    font-weight: 800; 
    color: var(--primary); 
    font-size: 2.5rem; 
}

header p { 
    color: var(--text-muted); 
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: var(--border-radius);
    padding: 3rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #f9fafb;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background-color: #ecfdf5;
}

.upload-zone input[type="file"] { 
    display: none; 
}

.upload-btn {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
    cursor: pointer;
}

.upload-btn:hover { 
    background: var(--primary-hover); 
}

/* Preview Image */
#image-preview {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 1rem;
    display: none;
}

/* Loading State */
#loading { 
    display: none; 
    text-align: center; 
    font-weight: 600; 
    color: var(--primary); 
    margin-top: 1rem; 
}

/* Results Section */
#results { 
    display: none; 
}

.score-container {
    background: #e5e7eb;
    border-radius: 999px;
    height: 12px;
    width: 100%;
    margin: 1rem 0;
    overflow: hidden;
}

#confidence-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 1s ease-in-out;
}

.confidence-label {
    font-size: 0.875rem; 
    color: var(--text-muted); 
    margin-bottom: 1rem;
}

.impact-text {
    margin-top: 0.5rem; 
    line-height: 1.5;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.tag.recyclable { 
    background: #d1fae5; 
    color: #065f46; 
}

.tag.not-recyclable { 
    background: #fee2e2; 
    color: #991b1b; 
}

/* History Section */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.history-item:last-child { 
    border-bottom: none; 
}

.empty-history {
    color: var(--text-muted); 
    margin-top: 1rem; 
    font-size: 0.9rem;
}

/* --- New Button Styles --- */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap; /* Allows stacking on small screens */
}

.upload-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    width: 100%; /* Full width on mobile */
    transition: transform 0.1s ease, opacity 0.2s ease;
}

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

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

.upload-btn.primary:hover { background: var(--primary-hover); }

.upload-btn.secondary {
    background: #e5e7eb;
    color: var(--text-main);
}

.upload-btn.secondary:hover { background: #d1d5db; }

/* --- Mobile Responsiveness --- */
@media (min-width: 480px) {
    .upload-btn { width: auto; } 
}

@media (max-width: 600px) {
    /* Tighten up spacing for mobile screens */
    body { padding: 1rem; }
    header h1 { font-size: 2rem; }
    .card { padding: 1.5rem; }
    .upload-zone { padding: 2rem 1rem; }
}

#preview {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 1rem;
    display: none;
}

#photoButton {
    display: none;
}

#browse {
    background-color: #10b981;
    color: white; 
}

#browse:hover {
    background-color: #059669; 
}

/* 2. Mobile Styles (Screens smaller than 768px) */
@media (max-width: 1280px) {
  #photoButton {
    display: flex; 
    justify-content: center;
    align-items: center;
  }
}