/* =================================================================== */
/* ================== style.css (Base Styles) ====================== */
/* =================================================================== */

body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

.gradient-text { 
    background: -webkit-linear-gradient(45deg, #22c55e, #15803d); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

.hidden { display: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.nav-btn.active { color: #16a34a; }

#main-header { padding-top: env(safe-area-inset-top); }
#mobile-bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
#add-trailer-btn-mobile { bottom: calc(5rem + env(safe-area-inset-bottom)); }

@media (max-width: 1023px) {
    #app-view {
        --header-height: calc(68px + env(safe-area-inset-top));
        --footer-height: calc(64px + env(safe-area-inset-bottom));
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    #app-view main.flex-1 {
        padding-top: var(--header-height);
        padding-bottom: var(--footer-height);
        -webkit-overflow-scrolling: touch;
    }
    #app-view main header.sticky { top: 0 !important; }
}

#field-list-container:has(> .col-span-full) {
    display: flex;
    justify-content: center;
    align-items: center;
}

details > summary::-webkit-details-marker { display: none; }
details[open] .details-arrow { transform: rotate(180deg); }

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
.animate-shake { animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both; }

.tour-recoltiq .shepherd-element{background:#fff;border-radius:.75rem;box-shadow:0 10px 15px -3px #00000012,0 4px 6px -4px #00000012;border:1px solid #f1f5f9;max-width:350px}.tour-recoltiq .shepherd-header{background-color:transparent;padding:1rem 1rem .5rem;border-bottom:none}.tour-recoltiq .shepherd-title{color:#0f172a;font-weight:600;font-size:1rem;display:flex;align-items:center;gap:.5rem}.tour-recoltiq .shepherd-cancel-icon{color:#94a3b8}.tour-recoltiq .shepherd-cancel-icon:hover{color:#1e293b}.tour-recoltiq .shepherd-text{padding:.5rem 1rem 1rem;color:#475569;font-size:.875rem;line-height:1.5}.tour-recoltiq .shepherd-footer{padding:0 1rem 1rem;display:flex;justify-content:space-between;align-items:center}.tour-recoltiq .shepherd-button{background:transparent;color:#475569;border:1px solid #cbd5e1;padding:.5rem 1rem;border-radius:.5rem;font-weight:600;transition:all .2s;box-shadow:none}.tour-recoltiq .shepherd-button:not(:disabled):hover{background:#f8fafc;border-color:#94a3b8;color:#1e293b}.tour-recoltiq .shepherd-button-primary{background:#16a34a;color:#fff;border-color:#16a34a}.tour-recoltiq .shepherd-button-primary:not(:disabled):hover{background:#15803d;border-color:#15803d}.shepherd-progress-bar{height:3px;background:#16a34a;transition:width .3s ease}

/* Animations Mobiles */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInUpBounce { 0% { opacity: 0; transform: translateY(100%); } 80% { opacity: 1; transform: translateY(-8px); } 100% { transform: translateY(0); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInDown { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: translateY(0); } }
@keyframes iconBounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(0.95); } 100% { transform: scale(1); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); } 70% { box-shadow: 0 0 0 15px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

#main-header.lg\:hidden { animation: slideInDown 0.5s ease-out; }
#mobile-bottom-nav { animation: slideInUp 0.5s ease-out; }
#modal-content { animation: slideInUpBounce 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.page-content-mobile-full, #page-field-details, #page-crop-exports { animation: fadeIn 0.4s ease-in-out; }
#field-list-container > div:not(.col-span-full), #shared-field-list-container > div, #my-shares-list-container > div, #storage-summary-container > div, #trailers-list > div { animation: slideInUp 0.5s ease-out forwards; opacity: 0; }
#field-list-container > div:nth-child(1), #trailers-list > div:nth-child(1) { animation-delay: 0.05s; }
#field-list-container > div:nth-child(2), #trailers-list > div:nth-child(2) { animation-delay: 0.1s; }
#field-list-container > div:nth-child(3), #trailers-list > div:nth-child(3) { animation-delay: 0.15s; }
#mobile-bottom-nav .nav-btn.active i { animation: iconBounce 0.4s ease-in-out; }
button:active, .nav-btn:active { animation: pop 0.2s ease-in-out; }
#add-trailer-btn-mobile { animation: pulse 2.5s infinite cubic-bezier(0.66, 0, 0, 1); }
.filter-btn { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
input:focus, select:focus { transition: border-color 0.3s ease, box-shadow 0.3s ease; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2); }

@media (max-width: 1023px) {
    .field-card-content:active, .crop-storage-card:active, #trailers-list > div:active { transform: scale(0.97); transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
    #modal-container { align-items: flex-end; padding: 0; }
    #modal-content { width: 100%; border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-top: 0; padding-bottom: 3rem; }
}

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; background-color: #cbd5e1; border-radius: 9999px; transition: background-color 0.2s; cursor: pointer; -webkit-appearance: none; appearance: none; flex-shrink: 0; }
.toggle-switch::before { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; background-color: white; top: 2px; left: 2px; transition: transform 0.2s; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.toggle-switch:checked { background-color: #16a34a; }
.toggle-switch:checked::before { transform: translateX(20px); }

/* Nouveaux styles pour la page "Mes Parcelles" */
.primary-action-btn { background-color: #16a34a; color: white; padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-weight: 600; transition: background-color 0.2s; display: flex; align-items: center; gap: 0.5rem; box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); }
.primary-action-btn:hover { background-color: #15803d; }
.secondary-action-btn { background-color: #f1f5f9; color: #475569; padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-weight: 600; transition: background-color 0.2s, color 0.2s; display: flex; align-items: center; gap: 0.5rem; border: 1px solid #e2e8f0; }
.secondary-action-btn:hover { background-color: #e2e8f0; color: #1e293b; }

/* Styles pour la page "Mes Heures" (refonte) */
.hours-page-header { background-color: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.action-btn-group { display: flex; gap: 0.5rem; }
.action-btn { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; padding: 0.5rem 0.75rem; border-radius: 0.5rem; transition: background-color 0.2s; }
.action-btn.share { background-color: #eff6ff; color: #2563eb; }
.action-btn.export { background-color: #fee2e2; color: #dc2626; }
.action-btn.add { background-color: #14b8a6; color: white; }
.period-selector { background-color: #f1f5f9; border-radius: 9999px; padding: 0.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; }
.period-selector button { padding: 0.5rem; border-radius: 9999px; font-weight: 600; color: #475569; transition: all 0.2s; }
.period-selector button.active { background-color: white; color: #0f172a; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.date-navigator { background-color: white; border-radius: 0.75rem; padding: 1rem; box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); border: 1px solid #e2e8f0; }
.hours-entry-card { background-color: white; border-radius: 0.75rem; padding: 1rem; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); border: 1px solid #e2e8f0; display: flex; align-items: center; gap: 1rem; }
.date-badge { flex-shrink: 0; width: 3.5rem; text-align: center; border-right: 1px solid #f1f5f9; padding-right: 1rem; }
.date-badge .day-number { font-weight: 800; font-size: 1.5rem; color: #0d9488; }
.date-badge .day-name { font-size: 0.875rem; color: #64748b; }
.entry-periods { flex-grow: 1; font-weight: 600; color: #1e293b; }
.entry-description { font-size: 0.875rem; color: #64748b; margin-top: 0.25rem; }
.entry-duration { font-weight: 800; font-size: 1.25rem; color: #0d9488; }
.entry-controls { display: flex; flex-direction: column; gap: 0.25rem; }
.entry-controls button { color: #94a3b8; padding: 0.25rem; border-radius: 9999px; }
.entry-controls button:hover { background-color: #f1f5f9; color: #1e293b; }
.report-summary-card { background-color: white; padding: 1rem; border-radius: 0.75rem; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.report-summary-card:hover { border-color: #93c5fd; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }

/* Styles pour la page de Synthèse Financière */
.summary-card { background-color: white; border-radius: 0.75rem; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05); transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; padding: 1rem; }
.summary-card.clickable:hover { transform: translateY(-4px); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); border-color: #93c5fd; }
.summary-card-header { text-align: center; padding-bottom: 0.75rem; border-bottom: 1px solid #f1f5f9; }
.summary-card-body { padding-top: 0.75rem; padding-bottom: 0.75rem; flex-grow: 1; min-height: 5rem; }
.summary-card-footer { display: flex; justify-content: space-between; font-weight: 700; padding-top: 0.75rem; border-top: 1px solid #f1f5f9; margin-top: auto; }

/* Styles pour les Charges de Structure */
.structural-charges-container { background-color: white; border-radius: 0.75rem; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05); padding: 1rem 1.5rem; margin-bottom: 1.5rem; }
.structural-charges-list { display: flex; flex-direction: column; gap: 1rem; }
.charge-item { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 0.5rem; }
.charge-item label { font-weight: 500; color: #475569; }
.charge-item input { border: none; border-bottom: 1px dashed #cbd5e1; background-color: transparent; text-align: right; font-weight: 600; color: #1e293b; width: 8rem; outline: none; padding-bottom: 2px; }
.charge-item input:focus { border-bottom: 1px solid #2563eb; }
.charge-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; color: #1e293b; border-top: 1px solid #e2e8f0; padding-top: 1rem; margin-top: 1rem; }

/* ▼▼▼ DÉBUT DE LA MODIFICATION : Nouveaux styles pour la saisie des heures ▼▼▼ */
.time-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f1f5f9; /* slate-100 */
    border: 1px solid #e2e8f0; /* slate-200 */
    border-radius: 0.5rem; /* rounded-lg */
}
.time-input-label {
    padding-left: 0.75rem; /* px-3 */
    font-weight: 500; /* font-medium */
    color: #475569; /* slate-600 */
    pointer-events: none; /* Empêche le label de bloquer le clic sur l'input */
}
.time-input-wrapper input[type="time"] {
    width: 100%;
    padding: 0.75rem; /* p-3 */
    padding-left: 0.5rem; /* pl-2 */
    background: transparent;
    border: none;
    outline: none;
    color: #1e293b; /* slate-800 */
    font-weight: 600; /* font-semibold */
    text-align: right;
    /* On laisse le navigateur (surtout iOS) gérer l'apparence pour assurer la compatibilité */
    -moz-appearance: textfield; /* Pour Firefox */
}
/* Sur les navigateurs Webkit (Chrome, Safari), on rend le sélecteur natif invisible */
/* et on l'étend sur toute la zone pour le rendre cliquable partout */
.time-input-wrapper input[type="time"]::-webkit-calendar-picker-indicator {
    background: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
/* ▲▲▲ FIN DE LA MODIFICATION ▲▲▲ */