@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

/* Variables CSS - Design inspiré de GROW */
:root {
    --primary-color: #5ABD7D;
    --secondary-color: #4ECDC4;
    --accent-color: #F7B801;
    --danger-color: #FF6B6B;
    --dark-color: #2D3142;
    --light-color: #F8FAFB;
    --gray-color: #A0AFBA;
    --text-color: #2D3142;
    --border-color: #E8E9EB;
    --success-color: #5ABD7D;
    --warning-color: #FFB84D;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Ubuntu', sans-serif;
    color: var(--text-color);
    background-color: var(--light-color);
    line-height: 1.6;
}

/* Conteneur principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 15px;
    color: var(--dark-color);
    font-weight: 600;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 10px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* Header / Navigation */
.header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.header h1 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 40px;
    width: auto;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.nav a:hover,
.nav a.active {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.header-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.header-feedback-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: flex-start;
    padding: 0;
    background: none;
    border: none;
    color: #1f6f3a;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}

.header-feedback-link:hover,
.header-feedback-link.active {
    color: #195e31;
}

/* Menu Hamburger - Mobile */
.hamburger-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 5px;
}

.hamburger-btn span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
    background-color: #4aa866;
}



.btn-secondary:hover {
    background-color: #8a95a3;
    color: white;
}

.btn-danger:hover {
    background-color: #ff5252;
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

/* Authentification */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.auth-form-wrapper {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.auth-header p {
    color: var(--gray-color);
    margin-bottom: 20px;
}

.auth-logo {
    max-width: 100px;
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(90, 189, 125, 0.1);
    background-color: white;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row > div {
    flex: 1;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 500;
}

/* Alertes */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #fadbd8;
    color: #8b0000;
    border: 1px solid #e74c3c;
}

.alert-success {
    background-color: #d5f4e6;
    color: #27ae60;
    border: 1px solid #27ae60;
}

/* Page Headers */
.page-header {
    margin: 30px 0 40px 0;
    text-align: center;
}

.page-header h2 {
    margin-bottom: 10px;
}

.page-header p {
    color: var(--gray-color);
    font-size: 1.1rem;
    background-image: url('../assets/avatar/Jardi-Malin.png');
    background-size: contain;
    background-position: left center;
    background-repeat: no-repeat;
    padding-left: 50px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

/* Recherche */
.search-section {
    margin-bottom: 30px;
    position: relative;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    width: 100%;
    max-width: 500px;
    z-index: 50;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--light-color);
}
/* Filtre par type */
.filter-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.3s ease;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
/* Légende */
.legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

/* Calendrier */
.calendar-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.calendar-table {
    width: 100%;
}

.calendar-table th {
    background-color: var(--dark-color);
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.calendar-table th:first-child {
    text-align: left;
    width: auto;
}

.calendar-table th:not(:first-child) {
    width: 5%;
}

.calendar-table td {
    padding: 20px 10px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.calendar-table tr:hover {
    background-color: #f9f9f9;
    cursor: pointer;
}

.calendar-table tr:last-child td {
    border-bottom: none;
}

.calendar-table td:last-child {
    border-right: none;
}

.plant-name {
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
    white-space: normal;
    padding: 0px 15px !important;
}

.plant-name:hover {
    text-decoration: underline;
    background-color: rgba(46, 204, 113, 0.05);
}

.month-cell {
    height: 45px;
    background-size: 100% 100%;
    position: relative;
}

/* Grille de plantes */
.plants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.plant-card {
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.plant-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.plant-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--light-color);
}

.plant-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.placeholder-text {
    font-size: 2rem;
}

.plant-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.plant-card h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 600;
}

.plant-card .subtitle {
    color: var(--gray-color);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.plant-card-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    flex-wrap: wrap;
}

.plant-card-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.plant-card-actions i {
    font-size: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.plant-card-actions i.btn-small {
    color: var(--secondary-color);
}

.plant-card-actions i.btn-small:hover {
    color: #2a9d8f;
    transform: scale(1.1);
}

.plant-card-actions i.btn-secondary {
    color: var(--gray-color);
}

.plant-card-actions i.btn-secondary:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.plant-card-actions i.btn-danger {
    color: var(--danger-color);
}

.plant-card-actions i.btn-danger:hover {
    color: #ff5252;
    transform: scale(1.1);
}

.plant-card-actions .btn {
    flex: 1;
    min-width: 45px;
}

/* Détails de plante */
.plant-detail {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.plant-header {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: center;
}

.plant-detail-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
}

.plant-info h1 {
    margin-bottom: 10px;
}

.plant-subtitle {
    color: var(--gray-color);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.common-names {
    margin-bottom: 20px;
    color: var(--text-color);
}

.plant-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.plant-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.detail-section {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.detail-section h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 15px;
}

.detail-item label {
    font-weight: 600;
    color: var(--dark-color);
    min-width: 150px;
}

.detail-item span {
    color: var(--text-color);
}

/* Formulaires */
.form-wrapper {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 900px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section h3 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.image-preview {
    margin-bottom: 15px;
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 5px;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 25px 0;
    margin-top: 50px;
    border-top: 2px solid var(--primary-color);
}

.footer p {
    margin: 0;
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background-color: white;
    border-radius: 10px;
    grid-column: 1 / -1;
}

.empty-state p {
    color: var(--gray-color);
    margin-bottom: 20px;
}

/* Formulaires additionnels */
.form-group small {
    color: var(--gray-color);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header */
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .hamburger-btn {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: white;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        max-height: 0;
        opacity: 0;
        pointer-events: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: max-height 0.3s ease;
        z-index: 99;
    }

    .nav.active {
        max-height: calc(100dvh - 80px);
        opacity: 1;
        pointer-events: auto;
    }

    .nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 20px 0 calc(24px + env(safe-area-inset-bottom, 0px));
        min-height: 100%;
    }

    .nav li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav li:last-child {
        border-bottom: none;
    }

    .nav a {
        display: block;
        text-align: left;
        padding: 12px 20px;
        background: none;
    }

    .nav a:hover,
    .nav a.active {
        background-color: var(--light-color);
    }

    /* Typographie */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }

    /* Authentification */
    .auth-form-wrapper {
        padding: 25px;
    }

    /* Calendrier */
    .calendar-table {
        font-size: 0.9rem;
    }

    .calendar-table th,
    .calendar-table td {
        padding: 10px 5px;
    }

    .plant-name {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Grille de plantes */
    .plants-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    /* Détails de plante */
    .plant-header {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .plant-detail-image {
        height: 250px;
    }

    .plant-detail {
        padding: 20px;
    }

    /* Formulaires */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row > div {
        flex: 1;
    }

    /* Légende */
    .legend {
        grid-template-columns: 1fr;
    }

    /* Recherche */
    .search-input {
        font-size: 16px; /* Empêche le zoom sur iOS */
    }

    .page-header {
        margin: 20px 0 25px 0;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 15px;
    }

    /* Header */
    .header {
        padding: 14px 0;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .nav {
        top: 72px;
    }

    .nav.active {
        max-height: calc(100dvh - 72px);
    }

    .nav a {
        font-size: 0.95rem;
        padding: 10px 16px;
    }

    /* Authentification */
    .auth-form-wrapper {
        padding: 20px;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    /* Typographie */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1rem; }

    /* Calendrier */
    .calendar-table {
        font-size: 0.8rem;
    }

    .calendar-table th,
    .calendar-table td {
        padding: 8px 3px;
    }

    /* Grille de plantes */
    .plants-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .plant-card-actions {
        flex-direction: row;
    }

    .plant-card-actions .btn {
        min-width: auto;
    }

    /* Détails */
    .plant-detail {
        padding: 15px;
    }

    .detail-item {
        flex-direction: column;
    }

    .detail-item label {
        min-width: auto;
    }

    /* Formulaires */
    .form-wrapper {
        padding: 15px;
    }

    .form-grid {
        padding: 0;
    }

    .form-grid,
    .form-actions {
        grid-template-columns: 1fr;
    }

    /* Button */
    .btn {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
    }

    .btn-small {
        padding: 6px 8px;
        font-size: 11px;
    }

    /* Footer */
    .footer {
        padding: 15px 0;
    }
}

/* Utilitaires */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
