/* AgriSense CSS Styles */

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main App Container */
.app-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 95vw;
  max-width: 1400px;
  height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.header {
  background: linear-gradient(135deg, #2d5016 0%, #5cb85c 100%);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Main Layout */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 300px;
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Sidebar Navigation */
.nav-section {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.nav-section h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  color: #6c757d;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  color: #495057;
  text-decoration: none;
  border-radius: 6px;
  margin-bottom: 0.25rem;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: #e9ecef;
  color: #2d5016;
}

/* Dashboard Grid */
.dashboard {
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Card Styles */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.card-header {
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  color: #2d5016;
}

.card-content {
  padding: 1.5rem;
}

/* Weather Card Styles */
.weather-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.weather-metric {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.weather-metric .value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2d5016;
}

.weather-metric .label {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* Risk Indicators */
.risk-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.risk-low {
  background: #d4edda;
  color: #155724;
}

.risk-medium {
  background: #fff3cd;
  color: #856404;
}

.risk-high {
  background: #f8d7da;
  color: #721c24;
}

/* Map Container */
.map-container {
  height: 400px;
  border-radius: 8px;
  overflow: hidden;
}

/* Chat Interface */
.chat-interface {
  height: 300px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: #f8f9fa;
}

.chat-input-container {
  padding: 1rem;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  outline: none;
}

.chat-input:focus {
  border-color: #5cb85c;
  box-shadow: 0 0 0 2px rgba(92, 184, 92, 0.1);
}

.send-btn {
  background: #5cb85c;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.send-btn:hover {
  background: #4cae4c;
}

/* Message Styles */
.message {
  margin-bottom: 1rem;
  max-width: 80%;
}

.message.user {
  margin-left: auto;
  background: #007bff;
  color: white;
  padding: 0.75rem;
  border-radius: 12px 12px 4px 12px;
}

.message.ai {
  background: white;
  border: 1px solid #e9ecef;
  padding: 0.75rem;
  border-radius: 12px 12px 12px 4px;
}

/* Login Form Styles */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-form {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  width: 400px;
  max-width: 90vw;
}

.login-form h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #2d5016;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #495057;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #5cb85c;
  box-shadow: 0 0 0 2px rgba(92, 184, 92, 0.1);
}

.login-btn {
  width: 100%;
  background: #5cb85c;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: background 0.2s;
}

.login-btn:hover {
  background: #4cae4c;
}

.forgot-password {
  text-align: center;
  color: #007bff;
  text-decoration: none;
  font-size: 0.875rem;
  display: block;
  text-align: center;
}

.forgot-password:hover {
  text-decoration: underline;
}

/* Message Styles */
.error-message {
  color: #dc3545;
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.5rem;
}

.success-message {
  color: #28a745;
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.5rem;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e9ecef;
  border-radius: 50%;
  border-top-color: #5cb85c;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

.text-center {
  text-align: center;
}

.text-success {
  color: #28a745;
}

.text-warning {
  color: #ffc107;
}

.text-danger {
  color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
  .app-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .main-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    order: 2;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .weather-summary {
    grid-template-columns: 1fr;
  }

  .header {
    padding: 1rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .dashboard {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .weather-summary {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .weather-metric {
    padding: 0.5rem;
  }

  .weather-metric .value {
    font-size: 1.25rem;
  }

  .card-content {
    padding: 1rem;
  }

  .dashboard-grid {
    gap: 1rem;
  }
}

/* Print Styles */
@media print {

  .login-overlay,
  .sidebar,
  .chat-interface {
    display: none;
  }

  .app-container {
    width: 100%;
    height: auto;
    box-shadow: none;
    border-radius: 0;
  }

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}