/* ==========================================================================
   Krishi Sahayak - Global Styles
   ========================================================================== */

   :root {
    --primary: #2ecc71;
    --primary-dark: #27ae60;
    --secondary: #0d6b1c;
    --bg-light: #f8f9fa;
    --text-main: #1e1e1e;
    --text-muted: #6c757d;
    --white: #ffffff;
    --border-color: #e5e5e5;
    --bot-msg-bg: #f1f1f1;
    --user-msg-bg: #dcf8c6;
    --suggestion-bg: #f0fdf4;
    --suggestion-border: #22c55e;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
  }

  html {
    scroll-behavior: smooth;
  }
  
  a {
    text-decoration: none;
    color: inherit;
  }
  
  ul {
    list-style: none;
  }
  
  /* ==========================================================================
     Navigation (Home Page)
     ========================================================================== */
  
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  
  .nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
  }

  .nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--white);
    color: var(--secondary);
    cursor: pointer;
    font-size: 1.25rem;
  }
  
  .nav-links a {
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.3s ease;
  }
  
  .nav-links a:hover {
    color: var(--primary);
  }
  
  .btn-launch {
    background: var(--primary);
    color: var(--white) !important;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    transition: background 0.3s ease;
  }
  
  .btn-launch:hover {
    background: var(--primary-dark);
  }
  
  /* ==========================================================================
     Homepage Sections
     ========================================================================== */
  
  /* Hero Section */
  .hero {
    text-align: center;
    padding: 6rem 5% 4rem;
    background: linear-gradient(to bottom, #e8f5e9, var(--bg-light));
  }
  
  .hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--secondary);
  }
  
  .hero .subtext {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-inline: auto;
  }
  
  .hero .btn-hero {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    transition: transform 0.3s ease, background 0.3s;
  }
  
  .hero .btn-hero:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
  }
  
  /* Features Section */
  .features-section {
    padding: 5rem 5%;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 3rem;
  }
  
  .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
  }
  
  .feature-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: transform 0.3s ease;
  }
  
  .feature-card:hover {
    transform: translateY(-5px);
  }
  
  .feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
  }
  
  .feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary);
  }
  
  .feature-card p {
    color: var(--text-muted);
  }
  
  /* How It Works Section */
  .how-it-works {
    background: var(--white);
    padding: 5rem 5%;
  }
  
  .steps-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    text-align: center;
  }
  
  .step {
    flex: 1;
  }
  
  .step-number {
    background: var(--primary);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
  }
  
  .step h3 {
    margin-bottom: 0.5rem;
    color: var(--secondary);
  }
  
  .step p {
    color: var(--text-muted);
  }
  
  /* Footer (Home Page) */
  .site-footer {
    background: #1a1a1a;
    color: #e5e5e5;
    padding: 4rem 5% 2rem;
  }
  
  .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
  }
  
  .footer-section h3 {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
  }
  
  .footer-section p {
    color: #ccc;
    margin-bottom: 0.8rem;
  }
  
  .footer-section a {
    color: var(--primary);
    transition: color 0.3s;
  }
  
  .footer-section a:hover {
    color: var(--white);
    text-decoration: underline;
  }
  
  .footer-section ul li {
    margin-bottom: 0.8rem;
  }
  
  .footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333;
    color: #888;
  }
  
  /* ==========================================================================
     Chatbot UI (ai.html)
     ========================================================================== */
  
  .chat-body {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    background: var(--bg-light);
  }
  
  .app-container {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--white);
    position: relative;
  }
  
  @media (min-width: 769px) {
    .chat-body {
      padding: 0;
    }
    .app-container {
      max-width: 100vw;
      border-radius: 0;
      box-shadow: none;
    }
  }
  
  /* Chat Header */
  .chat-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }
  
  .chat-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
  }
  
  .chat-header-title h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary);
    margin: 0;
  }
  
  .chat-header .badge {
    background: var(--primary);
    color: var(--white);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
  }
  
  /* Language Bar */
  .lang-bar {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: #fafafa;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
  }
  
  .lang-bar select {
    flex: 1;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
    background: var(--white);
    outline: none;
    cursor: pointer;
  }
  
  /* Chat Area Overflow */
  .chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    background: #fdfdfd;
  }
  
  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    text-align: center;
    gap: 8px;
    margin: auto 0;
  }
  
  /* Messages */
  .message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: fadeIn 0.15s ease;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .user-msg {
    align-self: flex-end;
    align-items: flex-end;
  }
  
  .bot-msg {
    align-self: flex-start;
    align-items: flex-start;
  }
  
  .message .bubble {
    padding: 14px 18px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  }
  
  .user-msg .bubble {
    background: var(--user-msg-bg);
    border-bottom-right-radius: 4px;
    color: #111;
  }
  
  .bot-msg .bubble {
    background: var(--bot-msg-bg);
    border-bottom-left-radius: 4px;
    color: #222;
  }
  
  .bot-msg .bubble p {
    margin-bottom: 8px;
  }
  
  .bot-msg .bubble p:last-child {
    margin-bottom: 0;
  }
  
  .bot-msg .bubble ul {
    margin-left: 20px;
    margin-bottom: 8px;
  }
  
  /* Image inside message */
  .msg-image {
    max-width: 250px;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
  }
  
  /* Typing Indicator */
  .typing {
    align-self: flex-start;
    display: none;
    padding: 14px 20px;
    background: var(--bot-msg-bg);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
  }
  
  .typing .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #888;
    border-radius: 50%;
    margin: 0 3px;
    animation: bounce 2s infinite both;
  }
  
  .typing .dot:nth-child(2) { animation-delay: 0.3s; }
  .typing .dot:nth-child(3) { animation-delay: 0.6s; }
  
  @keyframes bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.6; }
    40% { transform: scale(1); opacity: 1; }
  }
  
  /* Suggestion Box */
  .suggestion-box {
    background: var(--suggestion-bg) !important;
    border-left: 4px solid var(--suggestion-border);
    padding: 14px 18px;
  }
  
  /* Input Area (Sticky Bottom) */
  .input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
  }
  
  .input-area input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 14px 20px;
    border-radius: 30px;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    outline: none;
    background: #f9f9f9;
    transition: border-color 0.3s;
  }
  
  .input-area input[type="text"]:focus {
    border-color: var(--primary);
    background: var(--white);
  }
  
  .icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    color: #555;
  }
  
  .icon-btn:hover {
    background: #f0f0f0;
  }
  
  .send-btn {
    background: var(--primary);
    color: var(--white);
  }
  
  .send-btn:hover {
    background: var(--primary-dark);
    color: var(--white);
  }
  
  /* File Input & Preview */
  #image-input {
    display: none;
  }
  
  .image-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    padding: 6px 12px;
    border-radius: 20px;
    margin-right: 5px;
    font-size: 0.9rem;
  }
  
  .image-preview img {
    height: 36px;
    width: 36px;
    object-fit: cover;
    border-radius: 8px;
  }
  
  .image-preview .remove-preview {
    cursor: pointer;
    font-size: 1.1rem;
    color: #999;
    margin-left: 4px;
    font-weight: bold;
  }
  
  /* ==========================================================================
     Mobile Responsiveness
     ========================================================================== */
  
  @media (max-width: 768px) {
    /* Home Page Mobile */
    .hero h1 { font-size: 2.5rem; }
      .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
          position: sticky;
      }

        .nav-toggle {
          display: inline-flex;
          position: absolute;
          right: 5%;
          top: 1rem;
        }

      .nav-links {
            display: flex;
          flex-direction: column;
          align-items: flex-start;
          gap: 0.9rem;
        width: 100%;
          padding-top: 0.5rem;
            max-height: 0;
            overflow: hidden;
            opacity: 0;
            transition: max-height 0.25s ease, opacity 0.15s ease;
      }

        .navbar.is-open .nav-links {
            max-height: 240px;
            opacity: 1;
            transform: translateY(0);
        }

      .nav-links a {
        padding: 0.45rem 0;
      }

      .btn-launch {
        padding: 0.55rem 1rem;
      }
    .steps-container { flex-direction: column; }
    
    /* Chat Mobile */
    .chat-header-title h1 { font-size: 1.1rem; }
    .message { max-width: 90%; }
    .input-area { padding: 12px 15px; gap: 8px; }
    .input-area input[type="text"] { padding: 12px 16px; font-size: 0.95rem; }
    .icon-btn { width: 40px; height: 40px; font-size: 1.3rem; }
  }
/* ==========================================================================
   Standard Page Layouts (About, Privacy, Terms, Contact)
   ========================================================================== */

.page-header {
  background-color: var(--secondary);
  color: var(--white);
  padding: 4rem 20px;
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.page-header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.content-section {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  padding: 40px;
}

.content-section h2 {
  color: var(--secondary);
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 1.8rem;
}

.content-section p {
  margin-bottom: 20px;
  color: var(--text-main);
  line-height: 1.8;
}

.content-section ul {
  list-style: disc;
  margin-left: 20px;
  margin-bottom: 20px;
}

.content-section li {
  margin-bottom: 10px;
  line-height: 1.6;
}

/* Contact Form */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

.contact-info {
  background: var(--secondary);
  color: var(--white);
  padding: 40px;
  border-radius: 12px;
}

.contact-info h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.contact-info p {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.contact-form {
  background: var(--white);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-submit {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.3s;
}

.btn-submit:hover {
  background: var(--primary-dark);
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .contact-container {
    grid-template-columns: 1fr;
  }
  .content-section {
    padding: 20px;
    margin: 20px;
  }

  .page-header {
    padding: 3rem 20px;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .content-section,
  .contact-form,
  .contact-info {
    padding: 24px;
  }
}
