:root {
    --primary: #2d5a27;
    --primary-light: #4a8c42;
    --primary-dark: #1e3d1a;
    --secondary: #f4a261;
    --danger: #e63946;
    --warning: #f4a261;
    --success: #2a9d8f;
    --bg-main: #f8faf8;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #e0e0e0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

/* Header */
.header {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 16px;
    padding-bottom: 80px;
    overflow-y: auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Dashboard */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.welcome-card h2 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.welcome-card p {
    opacity: 0.9;
}

.alerts-section, .suggestion-section {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.alerts-section h3, .suggestion-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--warning);
}

.alert-item.urgent {
    border-left-color: var(--danger);
    background: #fff5f5;
}

.alert-item .emoji {
    font-size: 1.5rem;
}

.alert-item .info {
    flex: 1;
}

.alert-item .name {
    font-weight: 500;
}

.alert-item .detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 1.3rem;
}

.btn-add {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Plantes List */
.plantes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plante-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.plante-card .emoji {
    font-size: 2.5rem;
}

.plante-card .info {
    flex: 1;
}

.plante-card .name {
    font-weight: 600;
    font-size: 1.1rem;
}

.plante-card .location {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.plante-card .status {
    font-size: 0.85rem;
    margin-top: 4px;
}

.plante-card .status.ok {
    color: var(--success);
}

.plante-card .status.warning {
    color: var(--warning);
}

.plante-card .status.urgent {
    color: var(--danger);
}

.plante-card .actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-water {
    background: #e3f2fd;
    color: #1976d2;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-water:hover {
    background: #bbdefb;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 1.2rem;
}

.btn-delete:hover {
    color: var(--danger);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Ingredients List */
.ingredients-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ingredient-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.ingredient-card .emoji {
    font-size: 1.8rem;
}

.ingredient-card .info {
    flex: 1;
}

.ingredient-card .name {
    font-weight: 500;
}

.ingredient-card .detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ingredient-card .expiry {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
}

.ingredient-card .expiry.ok {
    background: #e8f5e9;
    color: var(--success);
}

.ingredient-card .expiry.warning {
    background: #fff3e0;
    color: #e65100;
}

.ingredient-card .expiry.urgent {
    background: #ffebee;
    color: var(--danger);
}

/* Recettes List */
.recettes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recette-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}

.recette-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.recette-card .header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.recette-card .emoji {
    font-size: 2rem;
}

.recette-card .name {
    font-weight: 600;
    flex: 1;
}

.recette-card .match {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--primary-light);
    color: white;
}

.recette-card .ingredients-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.recette-card .ingredient-tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.recette-card .ingredient-tag.have {
    background: #e8f5e9;
    color: var(--success);
}

.recette-card .ingredient-tag.missing {
    background: #f5f5f5;
    color: var(--text-muted);
}

/* Suggestion Card */
.suggestion-card {
    background: linear-gradient(135deg, #fff9e6, #fff3cc);
    padding: 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.suggestion-card .recette-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.suggestion-card .emoji {
    font-size: 2rem;
}

.suggestion-card .name {
    font-weight: 600;
    font-size: 1.1rem;
}

.suggestion-card .reason {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* Catalogue Grid */
.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.catalogue-item {
    background: var(--bg-main);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.catalogue-item:hover {
    border-color: var(--primary);
    background: #f0f7f0;
}

.catalogue-item .emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.catalogue-item .name {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Form Elements */
.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    margin-bottom: 12px;
    transition: var(--transition);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.input-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    display: flex;
    justify-content: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.bottom-nav .nav-item {
    flex: 1;
    max-width: 166px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.bottom-nav .nav-item.active {
    color: var(--primary);
}

.bottom-nav .nav-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.bottom-nav .nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Notification Banner */
.notif-banner {
    position: fixed;
    bottom: 70px;
    left: 16px;
    right: 16px;
    max-width: 468px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 99;
}

.notif-banner.hidden {
    display: none;
}

.notif-banner p {
    font-weight: 500;
}

.notif-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-secondary {
    background: var(--bg-main);
    color: var(--text-secondary);
}

/* Recette Detail */
.recette-detail .time {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.recette-detail h4 {
    font-size: 0.95rem;
    margin: 16px 0 8px;
    color: var(--text-secondary);
}

.recette-detail ul {
    padding-left: 20px;
}

.recette-detail li {
    margin-bottom: 6px;
}

.recette-detail .instructions {
    white-space: pre-line;
    line-height: 1.6;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.plante-card, .ingredient-card, .recette-card {
    animation: fadeIn 0.3s ease;
}
