/* Plot My Garden - Styles */
/* Mobile-first responsive design */

:root {
  /* Earthy, natural color palette */
  --primary-color: #4a7c2c;
  --primary-dark: #2d5016;
  --primary-light: #6b9b37;
  --secondary-color: #8b7355;
  --accent-color: #c8a882;
  --danger-color: #c44536;
  --success-color: #5a8a3a;

  /* Backgrounds */
  --background: #f8f4e8;
  --background-alt: #fdfbf3;
  --card-bg: #ffffff;
  --card-bg-hover: #fefefe;

  /* Borders and dividers */
  --border-color: #d4cbb8;
  --border-light: #e8e3d5;
  --border-dark: #b8ad94;

  /* Text colors */
  --text-primary: #2c2416;
  --text-secondary: #5c5445;
  --text-muted: #8a8270;

  /* Shadows - more subtle and natural */
  --shadow-sm: 0 1px 3px rgba(45, 36, 22, 0.08);
  --shadow: 0 2px 8px rgba(45, 36, 22, 0.12);
  --shadow-md: 0 4px 12px rgba(45, 36, 22, 0.15);
  --shadow-lg: 0 8px 24px rgba(45, 36, 22, 0.18);

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout dimensions */
  --top-nav-height: 60px;
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 0;
}

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

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
  padding-top: var(--top-nav-height);
}

/* ============================================
   TOP NAVIGATION BAR
   ============================================ */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-nav-height);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  color: white;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-container {
  width: 100%;
  max-width: 100%;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  min-width: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.brand-name {
  display: none;
}

.current-plot-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Hamburger Menu Button */
.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
  position: relative;
  width: 40px;
  height: 40px;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle:active {
  background: rgba(255, 255, 255, 0.2);
}

.hamburger-icon {
  position: relative;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger-icon::before {
  top: -8px;
}

.hamburger-icon::after {
  top: 8px;
}

.sidebar-toggle.active .hamburger-icon {
  background: transparent;
}

.sidebar-toggle.active .hamburger-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.sidebar-toggle.active .hamburger-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Nav Buttons */
.nav-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

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

.nav-btn:focus {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.nav-btn span:first-child {
  font-size: 1.1rem;
  line-height: 1;
}

.nav-btn-text {
  display: none;
}

/* ============================================
   APP LAYOUT CONTAINER
   ============================================ */

.app-layout {
  display: flex;
  min-height: calc(100vh - var(--top-nav-height));
  position: relative;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  width: var(--sidebar-width);
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  position: fixed;
  left: 0;
  top: var(--top-nav-height);
  bottom: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.main-content {
  flex: 1;
  margin-left: 0;
  padding: 1rem;
  max-width: 100%;
  transition: margin-left 0.3s ease;
}

.sidebar:not(.collapsed) ~ .main-content {
  margin-left: var(--sidebar-width);
}

/* Old Header - Hidden in new layout */
.header {
  display: none;
}


/* Old Container - Deprecated (using app-layout now) */
.container {
  display: none;
}

/* Sections - Updated for new layout */
section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

section:hover {
  box-shadow: var(--shadow);
}

section h2 {
  color: var(--primary-dark);
  margin-bottom: 1.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0.75rem;
}

section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Sidebar Sections */
.sidebar section {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border-light);
  box-shadow: none;
  margin-bottom: 0;
}

.sidebar section:last-child {
  border-bottom: none;
}

.sidebar section:hover {
  box-shadow: none;
  background: var(--background-alt);
}

/* Control Panel */
.control-panel {
  /* No grid positioning needed */
}

.settings-group {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-light);
}

.settings-group:last-child {
  border-bottom: none;
}

.settings-group label {
  display: block;
  margin-top: 0.875rem;
  margin-bottom: 0.375rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.settings-group input,
.settings-group select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--background-alt);
  color: var(--text-primary);
  transition: var(--transition);
  font-family: inherit;
}

.settings-group input:focus,
.settings-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 124, 44, 0.1);
  background: white;
}

.settings-group input:hover,
.settings-group select:hover {
  border-color: var(--border-dark);
}

/* Plot Management */
.current-plot-display {
  background: var(--background-alt);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
  font-size: 0.95rem;
}

.current-plot-display strong {
  color: var(--text-secondary);
}

.current-plot-display span {
  color: var(--primary-color);
  font-weight: 700;
}

.plot-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.plot-buttons .btn {
  flex: 1;
  min-width: 120px;
  margin: 0;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
}

/* Buttons */
.btn {
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin: 0.375rem 0.25rem;
  transition: var(--transition);
  font-weight: 600;
  font-family: inherit;
  display: inline-block;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #74624a;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background: #a8362a;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* Stats */
.stats {
  background: var(--background-alt);
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.stats p {
  margin: 0.625rem 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.stats span {
  font-weight: 700;
  color: var(--primary-color);
}

/* Plant Panel */
.plant-panel {
  /* No grid positioning needed */
}

.plant-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}

.filter-btn {
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--border-color);
  background: white;
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: inherit;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

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

.plant-search {
  margin-bottom: 1.25rem;
}

.plant-search input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--background-alt);
  transition: var(--transition);
  font-family: inherit;
}

.plant-search input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 124, 44, 0.1);
  background: white;
}

.plant-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.875rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.25rem;
}

.plant-item {
  padding: 0.875rem;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  text-align: center;
  cursor: grab;
  transition: var(--transition);
  user-select: none;
  background: var(--background-alt);
  box-shadow: var(--shadow-sm);
}

.plant-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
  background: white;
}

.plant-item:active {
  cursor: grabbing;
  transform: translateY(-1px);
}

.plant-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.plant-color {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.625rem;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.plant-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.plant-type {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-transform: capitalize;
}

/* Grid Section */
.grid-section {
  /* No grid positioning needed */
}

.grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.grid-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* View Controls (2D/3D Toggle) */
.view-controls {
  margin-bottom: 1rem;
  padding: 0.875rem;
  background: var(--background-alt);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.view-toggle .btn {
  flex: 1;
  margin: 0;
  min-width: 120px;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
}

/* Zoom Controls */
.zoom-controls {
  margin-bottom: 1rem;
  padding: 0.875rem;
  background: var(--background-alt);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.zoom-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.zoom-display {
  min-width: 60px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-color);
  padding: 0.5rem;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.btn-icon {
  padding: 0.625rem 1rem;
  font-size: 1.1rem;
  min-width: auto;
}

.keyboard-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.keyboard-hint small {
  display: inline-block;
}

.grid-container {
  overflow: hidden;
  max-height: 600px;
  width: 100%;
  max-width: 100%;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--background-alt);
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.grid-container.pannable {
  cursor: grab;
}

.grid-container.panning {
  cursor: grabbing;
  user-select: none;
}

.grid-placeholder {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.grid {
  display: inline-grid;
  gap: 3px;
  background: var(--border-color);
  border: 2px solid var(--border-dark);
  border-radius: 4px;
  min-width: min-content;
  box-shadow: var(--shadow);
}

.grid-cell {
  width: 50px;
  height: 50px;
  background: white;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-cell:hover {
  background: var(--background-alt);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.grid-cell.occupied {
  cursor: default;
  border-width: 2px;
}

.grid-cell.occupied:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.grid-cell.drag-over {
  background: var(--primary-light);
  opacity: 0.6;
  border-color: var(--primary-dark);
  border-width: 2px;
}

.grid-cell.companion-good {
  box-shadow: inset 0 0 0 2px var(--success-color);
}

.grid-cell.companion-bad {
  box-shadow: inset 0 0 0 2px var(--danger-color);
}

.cell-plant {
  font-size: 0.7rem;
  text-align: center;
  padding: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  font-weight: 600;
  color: var(--text-primary);
}

/* Tooltip */
.tooltip {
  position: fixed;
  background: rgba(44, 36, 22, 0.95);
  color: white;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  max-width: 300px;
  z-index: 1000;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
}

.tooltip-content h4 {
  margin-bottom: 0.625rem;
  color: var(--accent-color);
  font-size: 1.05rem;
  font-weight: 600;
}

.tooltip-content p {
  margin: 0.375rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tooltip-good {
  color: #7fb85e;
}

.tooltip-bad {
  color: #e57368;
}

/* 3D View Tooltip */
.tooltip-3d {
  position: fixed;
  background: rgba(74, 124, 44, 0.95);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  z-index: 1000;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  border: 2px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  min-width: 150px;
}

.tooltip-3d-content {
  text-align: center;
}

.tooltip-3d-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: white;
}

.tooltip-3d-hint {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  font-style: italic;
}

/* Schedule Section */
.schedule-section {
  /* No grid positioning needed */
}

.schedule-container {
  display: grid;
  gap: 1rem;
}

.schedule-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  font-size: 1.05rem;
}

.schedule-item {
  background: var(--background-alt);
  padding: 1.25rem;
  border-radius: 10px;
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.schedule-item:hover {
  box-shadow: var(--shadow);
  transform: translateX(2px);
}

.schedule-plant-name {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.625rem;
  color: var(--primary-dark);
}

.schedule-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.625rem;
  font-size: 0.9rem;
}

.schedule-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.schedule-detail strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 36, 22, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: var(--transition);
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--danger-color);
  transform: rotate(90deg);
}

.modal-content h3 {
  margin-bottom: 1rem;
  color: var(--primary-dark);
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-content label {
  display: block;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.modal-content input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--background-alt);
  transition: var(--transition);
  font-family: inherit;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 124, 44, 0.1);
  background: white;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.modal-actions .btn {
  flex: 1;
  margin: 0;
}

.modal-affiliate {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, var(--primary-dark), var(--text-primary));
  color: white;
  text-align: center;
  padding: 2.5rem 1rem;
  margin-top: 3rem;
  box-shadow: var(--shadow-lg);
}

.footer p {
  margin: 0.625rem 0;
  opacity: 0.95;
}

.footer-links {
  margin: 1.25rem 0;
}

.affiliate-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.affiliate-link:hover {
  color: white;
  text-decoration: underline;
}

.disclaimer {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 1.25rem;
  font-style: italic;
}

/* ============================================
   RESPONSIVE MEDIA QUERIES
   ============================================ */

/* Mobile First - Sidebar collapsed by default on mobile */
@media (max-width: 767px) {
  /* Sidebar starts collapsed on mobile */
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar:not(.collapsed) {
    transform: translateX(0);
    position: fixed;
    z-index: 999;
    box-shadow: var(--shadow-lg);
  }

  /* Main content takes full width on mobile */
  .main-content {
    margin-left: 0;
  }

  /* Overlay when sidebar is open on mobile */
  .sidebar:not(.collapsed)::after {
    content: '';
    position: fixed;
    top: var(--top-nav-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }

  /* Hide nav button text on mobile */
  .nav-btn-text {
    display: none;
  }

  /* Current plot badge smaller on mobile */
  .current-plot-badge {
    max-width: 150px;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Tablet and Up - Enhanced layout but sidebar still collapsible */
@media (min-width: 768px) {
  /* Show brand name on tablet+ */
  .brand-name {
    display: inline;
  }

  /* Show nav button text on tablet+ */
  .nav-btn-text {
    display: inline;
  }

  /* Grid cells larger on tablet */
  .grid-cell {
    width: 60px;
    height: 60px;
  }

  /* Plant list 2 columns */
  .plant-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop - Enhanced layout */
@media (min-width: 1200px) {
  /* Larger grid cells on desktop */
  .grid-cell {
    width: 65px;
    height: 65px;
  }

  /* Better plant list layout */
  .plant-list {
    grid-template-columns: repeat(2, 1fr);
    max-height: 500px;
  }
}

/* Print Styles */
@media print {
  .top-nav,
  .sidebar,

  body {
    background: white;
    padding-top: 0;
  }

  .app-layout {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .grid-section,
  .schedule-section {
    box-shadow: none;
    page-break-inside: avoid;
    border: none;
    margin-bottom: 1rem;
  }

  .grid-container {
    max-height: none;
    overflow: visible;
    border: 1px solid #000;
  }

  .grid-cell {
    border: 1px solid #333;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading state */
.loading {
  pointer-events: none;
  opacity: 0.6;
  filter: grayscale(50%);
}

/* Success/Error messages */
.message {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.message-success {
  background: #e8f5e0;
  color: #2d5016;
  border: 1px solid #c3e6b8;
}

.message-error {
  background: #fce8e6;
  color: #8b3226;
  border: 1px solid #f5c6c3;
}

.message-info {
  background: #e6f3f7;
  color: #1e4d5e;
  border: 1px solid #bee5ed;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--background-alt);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 5px;
  border: 2px solid var(--background-alt);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* ============================================
   SVG ICON STYLES
   ============================================ */

/* Base icon styling */
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Icon in buttons */
.btn .icon,
.nav-btn .icon {
  margin-right: 0.5rem;
}

.btn-icon .icon {
  margin-right: 0;
}

/* Brand icon sizing */
.brand-icon .icon {
  width: 24px;
  height: 24px;
}

/* Hint icons */
.icon-hint {
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
  opacity: 0.7;
}

/* Pointer icon in placeholder */
.icon-pointer {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  display: block;
  opacity: 0.6;
}

/* Footer link icons */
.footer-links .icon {
  width: 18px;
  height: 18px;
  margin-right: 0.375rem;
  vertical-align: text-bottom;
}

/* Modal affiliate icon */
.modal-affiliate .icon {
  width: 18px;
  height: 18px;
  margin-right: 0.375rem;
  vertical-align: middle;
}

/* ============================================
   SEARCH INPUT WITH ICON
   ============================================ */

.plant-search {
  position: relative;
  margin-bottom: 1.25rem;
}

.plant-search .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.plant-search input {
  padding-left: 3rem;
}

/* ============================================
   COLLAPSIBLE SECTIONS
   ============================================ */

.collapsible {
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0.875rem;
  padding: 0.5rem 0;
  transition: var(--transition);
}

.collapsible-header:hover {
  color: var(--primary-color);
}

.collapsible-header span {
  flex: 1;
}

.collapse-toggle {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
  color: var(--text-secondary);
}

.collapse-toggle:hover {
  background: var(--background-alt);
  color: var(--primary-color);
}

.collapse-toggle .icon-chevron {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

/* Collapsed state */
.collapsible.collapsed .icon-chevron {
  transform: rotate(-90deg);
}

.collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 1000px;
  opacity: 1;
}

.collapsible.collapsed .collapsible-content {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

/* Ensure smooth transitions */
.collapsible .settings-group label,
.collapsible .settings-group input,
.collapsible .settings-group select,
.collapsible .settings-group button,
.collapsible .settings-group .plot-buttons {
  transition: var(--transition);
}

/* ============================================
   ICON ALIGNMENT IN VARIOUS CONTEXTS
   ============================================ */

/* Align icons in keyboard hints */
.keyboard-hint {
  display: flex;
  align-items: center;
  justify-content: center;
}

.keyboard-hint .icon-hint {
  flex-shrink: 0;
}

/* Grid placeholder with icon */
.grid-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Modal actions with icons */
.modal-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal affiliate with icon */
.modal-affiliate {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-affiliate p {
  display: flex;
  align-items: center;
  margin: 0;
}

/* ============================================
   RESPONSIVE ICON ADJUSTMENTS
   ============================================ */

@media (max-width: 767px) {
  /* Slightly smaller icons on mobile */
  .icon {
    width: 18px;
    height: 18px;
  }

  .brand-icon .icon {
    width: 22px;
    height: 22px;
  }

  /* Hide icon text on very small screens if needed */
  .btn .icon {
    margin-right: 0.375rem;
  }
}

/* ===========================================
   FAQ PAGE STYLES
   ============================================ */
.faq-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  min-height: 80vh;
}

.faq-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.faq-header h1 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.faq-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

.faq-content {
  margin-bottom: 3rem;
}

.faq-section {
  margin-bottom: 3rem;
}

.faq-section h2 {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.faq-item {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.faq-item h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.faq-item p {
  margin-bottom: 0.75rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.faq-item ul, .faq-item ol {
  margin: 1rem 0 1rem 1.5rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.faq-item li {
  margin-bottom: 0.5rem;
}

.faq-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.faq-cta {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  border-radius: 12px;
  color: white;
  margin-top: 3rem;
}

.faq-cta h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: white;
}

.faq-cta p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-large .icon {
  width: 24px;
  height: 24px;
}

/* ===========================================
   SIDEBAR TABS
   ============================================ */
.sidebar-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-tab {
  flex: 1;
  padding: 1rem 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.sidebar-tab .icon {
  width: 20px;
  height: 20px;
}

.sidebar-tab:hover {
  background: rgba(115, 138, 91, 0.05);
  color: var(--primary);
}

.sidebar-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: white;
}

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

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

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

.schedule-section-sidebar {
  padding: 1.5rem;
}

.schedule-section-sidebar h2 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* ===========================================
   FLOATING ACTION BUTTON (FAB)
   ============================================ */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  box-shadow: 0 6px 20px rgba(115, 138, 91, 0.4);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: fabPulse 2s infinite;
}

.fab:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 8px 25px rgba(115, 138, 91, 0.5);
  animation: none;
}

.fab:active {
  transform: scale(0.95);
}

.fab-icon {
  width: 32px;
  height: 32px;
  fill: white;
}

@keyframes fabPulse {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(115, 138, 91, 0.4);
  }
  50% {
    box-shadow: 0 6px 25px rgba(115, 138, 91, 0.6), 0 0 0 8px rgba(115, 138, 91, 0.1);
  }
}

/* ===========================================
   MODAL IMPROVEMENTS
   ============================================ */
.modal-large .modal-content {
  max-width: 700px;
  max-height: 85vh;
}

.modal-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1.5rem;
  line-height: 1.5;
}

#plant-browser-modal .plant-list {
  margin-top: 1rem;
}

/* ===========================================
   RESPONSIVE ADJUSTMENTS FOR NEW FEATURES
   ============================================ */
@media (max-width: 767px) {
  .faq-header h1 {
    font-size: 2rem;
  }

  .faq-section h2 {
    font-size: 1.5rem;
  }

  .faq-item {
    padding: 1rem;
  }

  .faq-cta {
    padding: 2rem 1rem;
  }

  .faq-cta h2 {
    font-size: 1.5rem;
  }

  .fab {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
  }

  .fab-icon {
    width: 28px;
    height: 28px;
  }

  .sidebar-tabs {
    position: relative;
  }

  .sidebar-tab {
    font-size: 0.85rem;
    padding: 0.875rem 0.5rem;
  }

  .sidebar-tab .icon {
    width: 18px;
    height: 18px;
  }
}
