:root {
    --primary: #2d5016;
    --primary-light: #4a7729;
    --primary-dark: #1b3610;
    --secondary: #7cb342;
    --accent: #ff6f00;
    --background: #fafaf5;
    --surface: #ffffff;
    --text: #2c3e2d;
    --text-light: #5a6c5b;
    --border: #d4e4d4;
    --shadow: rgba(45, 80, 22, 0.08);
    --shadow-medium: rgba(45, 80, 22, 0.12);
    --shadow-strong: rgba(45, 80, 22, 0.2);
    --error: #d32f2f;
    --success: #388e3c;
    --warning: #f57c00;
}

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

body {
    font-family: 'Crimson Pro', 'Georgia', serif;
    background: linear-gradient(135deg, #fafaf5 0%, #f0f4e8 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--background);
    box-shadow: 0 0 60px var(--shadow);
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 12px var(--shadow-medium);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo h1 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.install-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.install-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Navigation Tabs */
.tabs {
    display: flex;
    background: white;
    border-bottom: 2px solid var(--border);
    padding: 0 2rem;
    gap: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: inherit;
    position: relative;
}

.tab-btn::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--secondary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(124, 179, 66, 0.05);
}

.tab-btn.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-btn.active::before {
    transform: scaleX(1);
}

/* Main Content */
.main-content {
    padding: 2rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

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

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

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px var(--shadow-medium);
    transform: translateY(-2px);
}

.card h2 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    margin: 0;
}

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--surface);
    min-height: 44px;
}

/* Styles spécifiques pour les inputs date */
.form-group input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
    padding-right: 2.5rem;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 1rem;
    cursor: pointer;
    opacity: 0.7;
    width: 20px;
    height: 20px;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.1);
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 179, 66, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 179, 66, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--secondary);
    background: rgba(124, 179, 66, 0.05);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
    justify-content: center;
}

.btn-delete {
    background: #ffebee;
    color: var(--error);
    border: 2px solid #ffcdd2;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-delete:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* Status Messages */
.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    display: none;
}

.status-message.success {
    background: #e8f5e9;
    color: var(--success);
    border: 1px solid #c8e6c9;
    display: block;
}

.status-message.error {
    background: #ffebee;
    color: var(--error);
    border: 1px solid #ffcdd2;
    display: block;
}

/* Semis List */
.semis-list {
    display: grid;
    gap: 1rem;
}

.semis-item {
    background: linear-gradient(135deg, #f1f8e9 0%, #ffffff 100%);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.semis-item:hover {
    border-color: var(--secondary);
    box-shadow: 0 4px 16px var(--shadow-medium);
    transform: translateX(4px);
}

.semis-number {
    background: var(--primary);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.semis-details {
    flex: 1;
}

.semis-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.semis-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    color: var(--text-light);
    font-size: 0.95rem;
}

.semis-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.semis-meta-item strong {
    color: var(--text);
}

.semis-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.empty-state small {
    font-size: 0.9rem;
}

/* Search Box */
.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.1);
}

/* Plant Results */
.plant-results {
    display: grid;
    gap: 1.5rem;
}

.plant-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fdf7 100%);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
}

.plant-card:hover {
    border-color: var(--secondary);
    box-shadow: 0 8px 24px var(--shadow-medium);
}

.plant-header {
    display: flex;
    align-items: start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.plant-image {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid var(--border);
}

.plant-title h3 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.plant-latin {
    color: var(--text-light);
    font-style: italic;
    font-size: 1.1rem;
}

.plant-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-section {
    background: white;
    padding: 1.2rem;
    border-radius: 10px;
    border-left: 4px solid var(--secondary);
}

.info-section h4 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-section p {
    color: var(--text);
    line-height: 1.6;
}

.info-section ul {
    margin-left: 1.5rem;
    color: var(--text);
}

.info-section li {
    margin-bottom: 0.4rem;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .app-container {
        box-shadow: none;
    }
    
    .app-header {
        padding: 1rem;
    }
    
    .logo {
        gap: 0.6rem;
    }
    
    .logo svg {
        width: 32px;
        height: 32px;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .install-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .install-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .tabs {
        padding: 0 0.5rem;
        gap: 0.2rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .tab-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card h2 {
        font-size: 1.3rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.75rem 1rem;
        font-size: 16px; /* Évite le zoom sur iOS */
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    /* Fix pour les inputs de type date sur mobile */
    .form-group input[type="date"] {
        min-height: 44px; /* Taille tactile recommandée */
        line-height: normal;
    }
    
    .form-group input[type="date"]::-webkit-inner-spin-button,
    .form-group input[type="date"]::-webkit-calendar-picker-indicator {
        opacity: 1;
        cursor: pointer;
    }
    
    .btn {
        padding: 0.65rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .btn-large {
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
    }
    
    .semis-item {
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .semis-number {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
    
    .semis-name {
        font-size: 1.1rem;
    }
    
    .semis-meta {
        gap: 0.75rem;
        font-size: 0.85rem;
    }
    
    .semis-meta-item svg {
        width: 14px;
        height: 14px;
    }
    
    .semis-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
    
    .btn-delete {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-box input {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
    
    .plant-card {
        padding: 1rem;
    }
    
    .plant-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .plant-image {
        width: 100%;
        height: 180px;
    }
    
    .plant-title h3 {
        font-size: 1.4rem;
    }
    
    .plant-latin {
        font-size: 1rem;
    }
    
    .plant-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .info-section {
        padding: 1rem;
    }
    
    .info-section h4 {
        font-size: 1rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state svg {
        width: 50px;
        height: 50px;
    }
    
    .empty-state p {
        font-size: 1rem;
    }
}

/* Petits mobiles */
@media (max-width: 380px) {
    .logo h1 {
        font-size: 1.1rem;
    }
    
    .install-btn span {
        display: none;
    }
    
    .tab-btn {
        font-size: 0.8rem;
        padding: 0.7rem 0.8rem;
    }
    
    .card h2 {
        font-size: 1.2rem;
    }
    
    .semis-number {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .semis-name {
        font-size: 1rem;
    }
}
