/*
 * AgroSync - Stylesheet Principal
 * Design Premium 2026 - Minimalist & Alive
 * Responsive & Mobile-First
 */

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

:root {
    /* Paleta de Culori 2026 */
    --agro-primary: #38b000;      
    --agro-secondary: #454955;    
    --agro-alert: #e11d48;        
    
    --agro-bg: transparent;       
    --agro-card-bg: #ffffff;      
    --agro-text-main: #1F2937;    
    --agro-text-muted: #64748b;   
    --agro-border: #f1f5f9;       

    /* Fonturi */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Figtree', sans-serif;
    
    /* Umbre Moderne "Floating" */
    --agro-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    --agro-shadow-hover: 0 20px 40px -10px rgba(56, 176, 0, 0.15); 
    --agro-shadow-sec-hover: 0 20px 40px -10px rgba(69, 73, 85, 0.2); 
    --agro-radius: 20px;
    --agro-transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Container Principal */
#agrosync-frontend-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: var(--font-body);
    color: var(--agro-text-main);
    background-color: var(--agro-bg);
    padding: 10px 24px;
    box-sizing: border-box;
    font-weight: 400;
}

#agrosync-frontend-container h2, 
#agrosync-frontend-container h3,
#agrosync-frontend-container h4 {
    font-family: var(--font-heading);
    color: var(--agro-text-main);
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 20px;
}

strong {
    font-weight: 600; 
}

/* --- BARA SUPERIOARA (APP HEADER) --- */
.agrosync-app-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: var(--agro-card-bg);
    padding: 20px 24px;
    border-radius: var(--agro-radius);
    box-shadow: var(--agro-shadow);
    border: 1px solid var(--agro-border);
    margin-bottom: 32px;
    gap: 20px;
}

.agrosync-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.agrosync-logo-placeholder {
    width: 48px;
    height: 48px;
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    overflow: hidden;
}

.agrosync-logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.agrosync-brand-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--agro-secondary);
    letter-spacing: -0.02em;
}

.agrosync-user-panel {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.agrosync-app-stats {
    display: flex;
    gap: 16px;
}

.agrosync-stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--agro-border);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--agro-text-muted);
}

.agrosync-stat-badge span {
    color: var(--agro-primary);
    font-weight: 600;
}

.agrosync-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 24px;
    border-left: 1px solid var(--agro-border);
}

.agrosync-avatar {
    width: 40px;
    height: 40px;
    background: rgba(56, 176, 0, 0.1);
    color: var(--agro-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agrosync-user-info {
    display: flex;
    flex-direction: column;
}

.agrosync-user-name {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--agro-text-main);
    font-size: 1rem;
    line-height: 1.2;
}

.agrosync-user-role {
    font-size: 0.8rem;
    color: var(--agro-text-muted);
}

.agrosync-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff0ed;
    color: var(--agro-alert);
    text-decoration: none;
    transition: var(--agro-transition);
    margin-left: 8px;
}

.agrosync-logout-btn:hover {
    background: var(--agro-alert);
    color: #ffffff;
    transform: scale(1.05);
}

/* --- SISTEM TAB-URI --- */
.agrosync-tabs-header {
    display: flex;
    border-bottom: 1px solid var(--agro-border);
    margin-bottom: 30px;
    gap: 16px;
    overflow-x: auto;
}

.agrosync-tab-btn {
    font-family: var(--font-heading);
    background: none;
    border: none;
    padding: 14px 10px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--agro-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--agro-transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    outline: none;
}

.agrosync-tab-btn.active {
    color: var(--agro-primary);
    border-bottom-color: var(--agro-primary);
}

.agrosync-tab-btn:hover:not(.active) {
    color: var(--agro-secondary);
}

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

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

/* Lista Plante */
.agrosync-crop-list {
    list-style-type: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 40px;
}

.agrosync-crop-item {
    background: var(--agro-card-bg);
    padding: 40px;
    border-radius: var(--agro-radius);
    box-shadow: var(--agro-shadow);
    border: 1px solid var(--agro-border);
    transition: var(--agro-transition);
    display: flex;
    flex-direction: column;
    line-height: 1.7;
}

.agrosync-crop-item:hover {
    box-shadow: var(--agro-shadow-hover);
    transform: translateY(-2px);
    border-color: #e2e8f0;
}

.agrosync-crop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--agro-primary);
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.agrosync-crop-item-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--agro-text-main);
    margin: 0;
}

/* Buton Stergere Parcela */
.agrosync-btn-delete-crop {
    background: transparent;
    border: none;
    color: var(--agro-text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--agro-transition);
}

.agrosync-btn-delete-crop:hover {
    background: #fff0ed;
    color: var(--agro-alert);
}

/* Butoane Jurnal (Stergere si Editare) */
.agrosync-btn-delete-log, .agrosync-btn-edit-log {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--agro-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
}

.agrosync-btn-delete-log {
    color: var(--agro-text-muted);
}
.agrosync-btn-delete-log:hover {
    color: var(--agro-alert);
    background: #fff0ed;
}

.agrosync-btn-edit-log {
    color: var(--agro-text-muted);
}
.agrosync-btn-edit-log:hover {
    color: #3b82f6; 
    background: #eff6ff;
}

/* --- META INFO GRID --- */
.agrosync-crop-meta-grid {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .agrosync-crop-meta-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .agrosync-crop-meta-grid { grid-template-columns: repeat(4, 1fr); }
}

.agrosync-meta-item {
    background-color: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: var(--agro-transition);
}

.agrosync-meta-item:hover {
    background-color: #ffffff; border-color: #cbd5e1; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.agrosync-meta-label {
    font-size: 0.85rem; color: var(--agro-text-muted); display: flex; align-items: center; gap: 6px; font-weight: 500;
}

.agrosync-meta-value {
    font-size: 1.05rem; color: var(--agro-text-main); font-weight: 600;
}

.agrosync-meta-highlight {
    background-color: rgba(56, 176, 0, 0.05); border-color: rgba(56, 176, 0, 0.2);
    grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; padding: 20px 24px; 
}

.agrosync-meta-highlight .agrosync-meta-label { font-size: 1rem; }
.agrosync-meta-highlight .agrosync-meta-value { font-size: 1.15rem; }

/* --- ACCORDION JURNAL --- */
.agrosync-btn-toggle-data {
    font-family: var(--font-heading) !important; background-color: #f8fafc !important;
    color: var(--agro-secondary) !important; border: 1px solid var(--agro-border) !important;
    text-shadow: none !important; padding: 14px 20px; font-size: 1.05rem; font-weight: 500;
    border-radius: 12px; cursor: pointer; width: 100%; display: flex; align-items: center;
    justify-content: center; gap: 10px; margin-top: 24px; margin-bottom: 10px; transition: var(--agro-transition);
}

.agrosync-btn-toggle-data:hover { background-color: #e2e8f0 !important; color: var(--agro-text-main) !important; }
.agrosync-btn-toggle-data i { transition: transform 0.3s ease; }
.agrosync-btn-toggle-data.expanded i { transform: rotate(180deg); }

.agrosync-accordion-content {
    display: none; margin-top: 15px; padding-top: 20px; border-top: 1px dashed var(--agro-border); animation: fadeIn 0.4s ease;
}
.agrosync-accordion-content.expanded { display: block; }

/* --- STILURI ALERTE INTELIGENTE --- */
.agrosync-alerts-wrapper { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.agrosync-alert-box {
    position: relative; display: flex; gap: 16px; padding: 16px 40px 16px 20px; 
    border-radius: 12px; align-items: flex-start; transition: var(--agro-transition); border: 1px solid transparent;
}
.agrosync-alert-icon { width: 24px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.agrosync-alert-content { display: flex; flex-direction: column; gap: 4px; }
.agrosync-alert-content strong { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; }
.agrosync-alert-content span { font-size: 0.95rem; line-height: 1.4; }

.agrosync-alert-dismiss {
    position: absolute; top: 12px; right: 12px; background: transparent; border: none; cursor: pointer;
    opacity: 0.5; transition: var(--agro-transition); display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 50%;
}
.agrosync-alert-dismiss:hover { opacity: 1; background: rgba(0,0,0,0.05); }
.agrosync-alert-dismiss i { width: 18px; height: 18px; margin: 0; }

.agrosync-alert-warning { background-color: #fef9c3; border-color: #fef08a; }
.agrosync-alert-warning .agrosync-alert-icon, .agrosync-alert-warning strong { color: #ca8a04; }
.agrosync-alert-warning span { color: #854d0e; }

.agrosync-alert-danger { background-color: #fff0ed; border-color: #ffd8d0; }
.agrosync-alert-danger .agrosync-alert-icon, .agrosync-alert-danger strong { color: var(--agro-alert); }
.agrosync-alert-danger span { color: #9f1239; }

.agrosync-alert-info { background-color: #eff6ff; border-color: #bfdbfe; }
.agrosync-alert-info .agrosync-alert-icon, .agrosync-alert-info strong { color: #1d4ed8; }
.agrosync-alert-info span { color: #1e3a8a; }

/* Butoane Actiune */
.agrosync-btn-primary, .agrosync-btn-secondary, .agrosync-water-button, .agrosync-btn-open-modal, .agrosync-btn-export {
    font-family: var(--font-heading) !important; border: none !important; text-shadow: none !important; outline: none;
    padding: 14px 28px; font-size: 1.05rem; font-weight: 500; border-radius: 12px; cursor: pointer; transition: var(--agro-transition);
    width: 100%; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; box-sizing: border-box;
}

.agrosync-btn-primary { background-color: var(--agro-primary) !important; color: #ffffff !important; }
.agrosync-btn-secondary, .agrosync-btn-export { background-color: var(--agro-secondary) !important; color: #ffffff !important; }

.agrosync-btn-primary:hover, .agrosync-btn-open-modal:hover { background-color: #2da100 !important; box-shadow: var(--agro-shadow-hover); transform: scale(1.01); }
.agrosync-btn-secondary:hover, .agrosync-btn-export:hover { background-color: #353842 !important; box-shadow: var(--agro-shadow-sec-hover); transform: scale(1.01); }

/* Formulare Generale */
#agrosync-add-crop-form {
    background: var(--agro-card-bg); padding: 40px; border-radius: var(--agro-radius);
    box-shadow: var(--agro-shadow); border: 1px solid var(--agro-border);
}

label { font-family: var(--font-body); font-weight: 500; color: var(--agro-text-muted); font-size: 0.95rem; display: block; margin-bottom: 8px; text-transform: none; }
input[type="text"], input[type="date"], input[type="number"], select, textarea {
    font-family: var(--font-body); width: 100%; padding: 16px; margin-top: 4px; margin-bottom: 24px; border: 1px solid #e2e8f0; background-color: #f8fafc; border-radius: 12px; font-size: 1rem; transition: var(--agro-transition); box-sizing: border-box; color: var(--agro-text-main);
}
input[type="text"]:focus, input[type="date"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
    outline: none; background-color: #ffffff; border-color: var(--agro-primary); box-shadow: 0 0 0 3px rgba(56, 176, 0, 0.1);
}
hr { border: 0; height: 1px; background: var(--agro-border); margin: 48px 0; }

/* Tabel Jurnal */
.agrosync-table-container {
    width: 100%; overflow-x: auto; margin-top: 10px; margin-bottom: 24px; 
}
.agrosync-log-table {
    width: 100%; min-width: 900px; 
    border-collapse: separate !important; 
    border-spacing: 0 16px !important; 
    background-color: transparent !important;
    font-size: 0.95rem; text-align: left;
}
.agrosync-log-table thead tr { background-color: transparent !important; }
.agrosync-log-table th { 
    font-family: var(--font-heading); font-weight: 600; color: var(--agro-text-muted);
    text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px;
    border-bottom: 2px solid var(--agro-border) !important; padding: 10px 24px;
}
.agrosync-log-table tbody tr {
    background-color: var(--agro-card-bg) !important;
    box-shadow: 0 4px 15px -5px rgba(0,0,0,0.05) !important;
    transition: var(--agro-transition);
}
.agrosync-log-table tbody tr:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -5px rgba(0,0,0,0.08) !important; }
.agrosync-log-table td { 
    padding: 24px !important; vertical-align: top; border-top: 1px solid var(--agro-border);
    border-bottom: 1px solid var(--agro-border); line-height: 1.6;
}
.agrosync-log-table td:first-child { border-left: 1px solid var(--agro-border); border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.agrosync-log-table td:last-child { border-right: 1px solid var(--agro-border); border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

/* --- SISTEM MODAL --- */
.agrosync-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 999999; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box;
}
.agrosync-modal.active { display: flex; }
.agrosync-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(31, 41, 55, 0.85); z-index: 1; animation: fadeIn 0.3s ease;
}
.agrosync-modal-content {
    position: relative; background: var(--agro-card-bg); width: 100%; max-width: 850px; max-height: 85vh; overflow-y: auto; border-radius: var(--agro-radius); padding: 40px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); z-index: 2; box-sizing: border-box;
}

/* --- CUSTOM CONFIRM MODAL --- */
.agrosync-confirm-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999999; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box;
}
.agrosync-confirm-modal.active { display: flex; }
.agrosync-confirm-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(31, 41, 55, 0.7); backdrop-filter: blur(4px); animation: fadeIn 0.3s ease;
}
.agrosync-confirm-box {
    position: relative; background: var(--agro-card-bg); width: 100%; max-width: 420px; border-radius: var(--agro-radius); padding: 35px 30px; text-align: center; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 2;
}
.agrosync-confirm-icon {
    width: 64px; height: 64px; background: #fff0ed; color: var(--agro-alert); border-radius: 50%; display: flex; justify-content: center; align-items: center; margin: 0 auto 20px auto;
}
.agrosync-confirm-title { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 600; color: var(--agro-text-main); margin-bottom: 10px; }
.agrosync-confirm-msg { font-size: 1rem; color: var(--agro-text-muted); margin-bottom: 30px; line-height: 1.5; }
.agrosync-confirm-actions { display: flex; gap: 12px; justify-content: center; }
.agrosync-btn-cancel {
    background: #f1f5f9; color: var(--agro-secondary); border: none; padding: 14px 20px; border-radius: 12px; font-weight: 500; font-family: var(--font-heading); font-size: 1.05rem; cursor: pointer; transition: var(--agro-transition); flex: 1;
}
.agrosync-btn-cancel:hover { background: #e2e8f0; }
.agrosync-btn-danger {
    background: var(--agro-alert); color: #fff; border: none; padding: 14px 20px; border-radius: 12px; font-weight: 500; font-family: var(--font-heading); font-size: 1.05rem; cursor: pointer; transition: var(--agro-transition); flex: 1; display:flex; align-items:center; justify-content:center; gap: 8px;
}
.agrosync-btn-danger:hover { background: #be123c; }

/* TOAST NOTIFICATIONS */
.agrosync-toast {
    position: fixed; bottom: 30px; right: 30px; background: var(--agro-card-bg); border-left: 4px solid var(--agro-primary); padding: 16px 24px; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 12px; font-weight: 500; z-index: 9999999; transform: translateX(150%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.agrosync-toast.show { transform: translateX(0); }
.agrosync-toast.alert { border-left-color: var(--agro-alert); }
.agrosync-toast i { color: var(--agro-primary); }
.agrosync-toast.alert i { color: var(--agro-alert); }

/* Animatii */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 640px) {
    .agrosync-toast { bottom: 20px; right: 20px; left: 20px; }
}
@media (min-width: 768px) {
    .agrosync-water-button, .agrosync-btn-open-modal, .agrosync-btn-export, .agrosync-btn-primary, .agrosync-btn-secondary { width: auto; }
}