/* ========================================
   LANDSCAPE LIBRARY - DESIGN SYSTEM
   Chuẩn UI từ plant.html
   ======================================== */

/* ===== FOUNDATION ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
  color: #2d2d2d;
  line-height: 1.6;
}

/* ===== COLORS ===== */
:root {
  /* Primary Colors */
  --color-primary: #5a7d6f;
  --color-primary-dark: #4a6d5f;
  --color-primary-light: #e8f5e9;
  
  /* Neutral Colors */
  --color-text-primary: #2d2d2d;
  --color-text-secondary: #5d5d5d;
  --color-text-muted: #999;
  --color-border: #e5e5e5;
  --color-background: #f5f5f5;
  --color-background-light: #fafafa;
  
  /* Status Colors */
  --color-success: #5a7d6f;
  --color-error: #c07088;
  --color-warning: #FF9800;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* Transitions */
  --transition-base: all 0.3s;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  background: white;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.breadcrumb-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #ccc;
}

.breadcrumb-current {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: linear-gradient(to bottom, white 0%, var(--color-background-light) 100%);
  padding: 15px 20px;
  border-bottom: 1px solid var(--color-border);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: white;
  color: var(--color-text-primary);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-large {
  padding: 14px 28px;
  font-size: 16px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

/* Plant Card */
.plant-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.plant-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.plant-card-image {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: var(--color-background);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
}

.plant-card-body {
  padding: 14px;
}

.plant-code {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.plant-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 3px;
  line-height: 1.3;
}

.plant-scientific {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-style: italic;
}

.plant-created-by {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: 3px;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-primary);
  font-size: 14px;
}

label .required {
  color: var(--color-error);
  margin-left: 3px;
}

label .hint {
  font-weight: normal;
  color: var(--color-text-muted);
  font-size: 13px;
  margin-left: 5px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.3s;
  background: white;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

input[readonly],
input:disabled {
  background: var(--color-background);
  cursor: not-allowed;
  color: var(--color-text-muted);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  gap: 15px;
}

.form-row-2 {
  grid-template-columns: 1fr 1fr;
}

.form-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ===== SECTION ===== */
.section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal-container {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 25px;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-background-light);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--color-text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
}

.modal-close:hover {
  background: var(--color-border);
  color: var(--color-text-primary);
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 15px 25px;
  border-top: 2px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--color-background-light);
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--color-success);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  font-weight: 500;
  animation: slideInRight 0.3s ease;
}

.toast.show {
  display: flex;
}

.toast.error {
  background: var(--color-error);
}

.toast.warning {
  background: var(--color-warning);
}

.toast-icon {
  font-size: 20px;
}

.toast-message {
  font-size: 15px;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== LOADING STATES ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
  font-size: 15px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-primary {
  background: var(--color-primary);
  color: white;
}

.badge-secondary {
  background: var(--color-border);
  color: var(--color-text-secondary);
}

.badge-success {
  background: #4CAF50;
  color: white;
}

.badge-warning {
  background: var(--color-warning);
  color: white;
}

.badge-error {
  background: var(--color-error);
  color: white;
}

/* ===== UTILITY CLASSES ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-muted);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr;
  }
  
  .modal-container {
    width: 95%;
    max-height: 95vh;
  }
}
