:root {
    --primary-green: #4CAF50;
    --dark-green: #2E7D32;
    --light-green: #E8F5E9;
    --orange-accent: #FF9800;
    --blue-accent: #2196F3;
    --text-dark: #333333;
    --text-white: #FFFFFF;
    --bg-gray: #F5F5F5;
    --font-family: 'Inter', sans-serif;
    --border-radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-gray);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    max-width: 480px;
    /* Mobile simulation on desktop */
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.screen.hidden {
    transform: translateX(100%);
    pointer-events: none;
    z-index: 0;
}


/* Home Screen Styles */
.home-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--light-green);
    /* Subtle green background top */
}

.home-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-green);
}

.home-header .weather {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

#home-screen {
    background-color: var(--light-green);
    /* Full background match */
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-action-card {
    background: linear-gradient(135deg, #FFB74D, #FF9800);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
    min-height: 180px;
}

.main-action-card:active {
    transform: scale(0.98);
}

.main-action-card .icon-container {
    font-size: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 90px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-action-card .text-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.main-action-card .text-content p {
    font-size: 14px;
    opacity: 0.9;
}

.secondary-actions {
    display: flex;
    gap: 16px;
}

.secondary-actions .action-card {
    flex: 1;
    border-radius: var(--border-radius);
    padding: 20px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.secondary-actions .action-card.green {
    background-color: var(--primary-green);
}

.secondary-actions .action-card.blue {
    background-color: var(--blue-accent);
}

.secondary-actions .action-card .icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.secondary-actions .action-card h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}


/* Camera Screen Styles */
#camera-screen {
    background-color: black;
    color: white;
}

.camera-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
}

.camera-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
}

.camera-view {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.camera-view video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-frame {
    position: absolute;
    width: 80%;
    aspect-ratio: 3/4;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
    /* Dim outside */
    z-index: 10;
}

.scan-text {
    position: absolute;
    bottom: -40px;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.camera-controls {
    height: 120px;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 20;
}

.shutter-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: white;
    border: 4px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s;
}

.shutter-btn-inner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--orange-accent);
    display: flex;
    justify-content: center;
    align-items: center;
}

.shutter-btn:active {
    transform: scale(0.95);
}

.shutter-icon {
    font-size: 24px;
}

/* Loading Screen Styles */
#loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
}

.loading-content {
    text-align: center;
}

.plant-loader {
    font-size: 64px;
    margin-bottom: 24px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

.loading-content h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.loading-content p {
    color: #666;
}

/* Result Screen Styles */
#result-screen {
    background-color: var(--bg-gray);
}

.result-header {
    background-color: var(--primary-green);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-header h2 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    margin-right: 24px;
    /* Balance back button */
}

.result-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 100px;
    /* Space for fixed bottom bar */
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.product-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: #eee;
}

.product-info h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.uses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.use-item {
    background: white;
    padding: 16px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.use-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.use-title {
    font-weight: 600;
    display: block;
    font-size: 14px;
}

.use-desc {
    font-size: 12px;
    color: #666;
}

.npk-chart {
    background: white;
    padding: 16px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.npk-bar {
    margin-bottom: 12px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
}

.progress-track {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
}

.bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 16px;
    display: flex;
    gap: 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 30;
}

.btn-secondary,
.btn-primary {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-primary {
    background: var(--dark-green);
    color: white;
}

/* Inventory Screen Styles */
.inventory-header {
    background-color: var(--primary-green);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inventory-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.inventory-content {
    padding: 16px;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 80px;
    /* Space for FAB */
}

.inventory-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    flex: 1;
    background: white;
    padding: 16px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.summary-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.summary-card .number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-green);
}

.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inventory-item {
    background: white;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.item-icon {
    font-size: 24px;
    background: var(--light-green);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.item-info {
    flex: 1;
}

.item-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-date {
    font-size: 12px;
    color: #888;
}

.item-qty span {
    background: var(--light-green);
    color: var(--dark-green);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    color: #999;
    font-style: italic;
    margin-top: 40px;
}

/* FAB Styles */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
}

.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-green);
    color: white;
    border: none;
    font-size: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
}

.fab-btn:active {
    transform: scale(0.9);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid #eee;
}