/* public/styles.css */

/* Mobile-First Reset */
* { margin: 0; padding: 0; box-sizing: border-box; transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }
body { font-family: Arial, sans-serif; line-height: 1.5; color: var(--text); background: var(--body-bg); padding-bottom: 80px; }


  
  /* Custom Variables (Pet-Themed Palette) */
  :root {
    --primary: #4CAF50; /* Green for CTAs */
    --accent: #FFEB3B; /* Yellow for highlights */
    --text: #333; /* Dark text for contrast */
    --background: #fff; /* White for cards */
    --border: #ddd; /* Subtle borders */
    --body-bg: #f9f9f9; /* Body background */
    --nav-bg: #fff; /* Navigation background */
    --card-bg: #fff; /* Card background */
    --shadow: rgba(0,0,0,0.08); /* Shadow color */
    --text-muted: #64748b; /* Muted text */
}

:root.dark-mode {
    --primary: #66BB6A; /* Lighter green for dark mode */
    --accent: #FFD54F; /* Lighter yellow for dark mode */
    --text: #E0E0E0; /* Light text for contrast */
    --background: #1E1E1E; /* Dark background for cards */
    --border: #404040; /* Darker borders */
    --body-bg: #121212; /* Dark body background */
    --nav-bg: #1E1E1E; /* Dark navigation background */
    --card-bg: #2D2D2D; /* Dark card background */
    --shadow: rgba(0,0,0,0.3); /* Darker shadow */
    --text-muted: #A0A0A0; /* Muted text for dark mode */
}
  
  
  /* Base Mobile Styles (<480px) */

  .container { max-width: 100%; width:100%; margin: 0 auto; padding: 1rem; }
  html {
    font-size: 16px; /* Base font size for rem units */
    font-family: 'Arial', sans-serif;
    line-height: 1.5;
    scroll-behavior: smooth;
  }
  
  /* Header: Logo + Search + Login (flex row on mobile) */
  header { background: var(--card-bg); border-bottom: 1px solid var(--border); padding: 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }  
  .logo { font-size: 1.5rem; font-weight: bold; color: var(--primary); } 
  .back-btn { background: none; border: none; font-size: 1.5rem; color: var(--primary); cursor: pointer; }

  /* Hero Section */
  .hero {
    color: white;
  }
  :root.dark-mode .hero {
    color: white;
  }
  .hero-overlay {
    background: rgba(0,0,0,0.5);
    /* padding: 40px;*/
    border-radius: 10px;
    display: inline-block;
  }
  :root.dark-mode .hero-overlay {
    background: rgba(0,0,0,0.7);
  }

  .search-bar { flex: 1; position: relative; min-width: 200px; }
  
  #loginBtn { background: #4CAF50; color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 25px; cursor: pointer; font-size: 1rem; min-height: 44px; }
  #logoutBtn { background: #4CAF50; color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 25px; cursor: pointer; font-size: 1rem; min-height: 44px; }
  .search-bar { display: flex; align-items: center; position: relative; min-width: 200px; }
  #searchInput { flex: 1; margin: 0;border-right: none; border-radius: 0px 0 0 5px; padding: 0.75rem 1rem; }
  .search-icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }  
  .search-suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 0.5rem); background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 20px var(--shadow); list-style: none; padding: 0.25rem 0; z-index: 50; max-height: 220px; overflow-y: auto; display: none; }  
  .search-suggestions li { padding: 0.65rem 1rem; font-size: 0.95rem; display: flex; flex-direction: column; gap: 0.15rem; cursor: pointer; color: var(--text);}
  .search-suggestions li:hover, .search-suggestions li.active { background: var(--background);}
  .search-suggestions strong { color: #2f855a; }
  .search-suggestions li.inactive { cursor: default; color: #64748b; pointer-events: none; }
  #searchBtn { background: var(--primary); color: white; border: none; border-radius: 0 0px 5px 0;padding: 0.75rem 0.75rem; min-width: auto;width: auto;cursor: pointer;display: flex;align-items: center;justify-content: center;min-height: 44px;}
  #searchBtn:hover {
    background: darken(var(--primary), 10%);
  }
  #searchBtn i {
    font-size: 1rem; /* Adjust icon size if needed */
  }
  h1, h2, h3 {
    color: var(--text);
    margin-bottom: 1rem;
  }
  
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.2rem; }
  
  button, input[type="submit"] {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    min-height: 44px; /* Touch-friendly */
    min-width: 44px;
  }
  
  button:hover, input[type="submit"]:hover {
    background: darken(var(--primary), 10%);
  }
  
  input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    min-height: 44px; /* Touch-friendly */
  }
  
  /* Override for checkboxes to make them appropriately sized */
  input[type="checkbox"] {
    min-height: auto;
    height: 20px;
    width: 20px;
    margin-bottom: 0; /* Remove margin since checkbox has its own spacing */
  }
  
  /* Navigation (Hamburger Menu) */
   /* Bottom Nav: Fixed on mobile */
   nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--nav-bg); display: flex; border-top: 1px solid var(--border); z-index: 1000; }
   nav a { flex: 1; padding: 0.75rem 0.5rem; text-align: center; color: var(--text); text-decoration: none; }
   nav a.active { color: var(--primary); font-weight: bold; }
   nav i { display: block; font-size: 1.25rem; }
   nav ul {display: flex;flex-direction: column;list-style: none;gap: 0.5rem;
  }
  
  /* Trending Feed Snippet: Scrollable list */
  .feed { background: var(--card-bg); border-radius: 10px; padding: 1rem; margin: 2rem 0; box-shadow: 0 2px 5px var(--shadow); }
  .feed h2 { color: var(--primary); margin-bottom: 1rem; }
  .feed-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
  .feed-item:last-child { border-bottom: none; }
  
  /* Card Layout (e.g., Directory, Community) */
   /* Quick Actions: Flex grid (1-col mobile) */
   .quick-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0; }
   .action-card { flex: 1 1 100%; background: var(--card-bg); border-radius: 10px; padding: 1.5rem; text-align: center; box-shadow: 0 2px 5px var(--shadow); min-height: 80px; display: flex; flex-direction: column; justify-content: center; }
   .action-card i { font-size: 2rem; color: var(--primary); margin-bottom: 0.5rem; }
   .action-card h3 { font-size: 1.1rem; }
   .card { background: var(--card-bg); border-radius: 12px; padding: 1.25rem; box-shadow: 0 2px 6px var(--shadow); }  /* Accessibility */
  button:focus, input:focus, a:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  
  [aria-hidden="true"] {
    display: none;
  }
  
  /* Lazy-Load Images */
  img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
  }
  
  img.loaded {
    opacity: 1;
  }
  
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
  }

  .form-group label {
    font-weight: 600;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 1rem;
  }

  .form-group textarea {
    resize: vertical;
    min-height: 80px;
  }

  .form-group.full {
    grid-column: 1 / -1;
  }

  .form-grid {
    display: grid;
    gap: 1rem;
  }

  .hidden {
    display: none !important;
  }

  /* Service section visibility */
  .booking-details,
  .no-service {
    display: none;
  }

  .booking-details.active,
  .no-service.active {
    display: block;
  }

  /* Chatbot Floating Button (Placeholder) */
          /* Chatbot FAB: Floating action button */
          #chatbotBtn { position: fixed; bottom: 80px; right: 1rem; background: var(--primary); color: white; border: none; border-radius: 50%; width: 60px; height: 60px; font-size: 1.5rem; cursor: pointer; box-shadow: 0 2px 10px var(--shadow); z-index: 1100; }
          #chatbotModal { display: none; position: fixed; bottom: 80px; right: 1rem; width: 300px; max-height: 400px; background: var(--card-bg); border-radius: 10px; box-shadow: 0 2px 10px var(--shadow); overflow: hidden; z-index: 1101; }
          .chat-messages { display: flex; flex-direction: column; padding: 1rem; overflow-y: auto; height: 300px; }
          .message.user { background: #DCF8C6; align-self: flex-end; text-align: right; }          .message.ai { background: #E5E5EA; align-self: flex-start; }
          .message { padding: 0.75rem; border-radius: 18px; margin: 0.5rem; max-width: 80%; }

          .user { background: #4CAF50; color: white; text-align: right; }
          .ai { background: #f1f1f1; color: #333; }
          .chat-input { display: flex; gap: 0.5rem; padding: 0.5rem; border-top: 1px solid var(--border); }
          .chat-input input { flex: 1; }
          .chat-input button:disabled { opacity: 0.5; cursor: not-allowed; }
          
          /* Auth Modal (reuse chatbot modal styles) */
          #authModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 100; justify-content: center; align-items: center; }
          #authModal .modal-content { background: var(--card-bg); border-radius: 10px; padding: 2rem; max-width: 90%; max-height: 80%; overflow-y: auto; }          .form-group { margin-bottom: 1rem; }
          .form-group label { display: block; margin-bottom: 0.25rem; font-weight: bold; }
          .form-group input { width: 100%; padding: 0.75rem; border: 1px solid var(--border); border-radius: 5px; }          .close-btn { position: absolute;top: 0.5rem;right: 0.5rem;background: none;border: none;font-size: 1.2rem;cursor: pointer;color: var(--text); }
          .submit-btn { background: var(--primary); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 5px; cursor: pointer; width: 100%;outline: 2px solid var(--accent); }          
          #authToggle { text-align: center; margin-top: 1rem; }
          #authToggle a { color: var(--primary); text-decoration: none; }

   /* Results: Grid of Cards */
   .results { margin-top: 1rem; }
   .results h2 { color: #4CAF50; margin-bottom: 1rem; text-align: center; }
   .service-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
  .service-card { background: var(--card-bg); border-radius: 10px; padding: 1rem; box-shadow: 0 2px 5px var(--shadow); display: flex; flex-direction: column; }
  .service-card i { font-size: 2rem; color: var(--primary); align-self: center; margin-bottom: 0.5rem; }
  .service-name { font-size: 1.2rem; font-weight: bold; margin-bottom: 0.25rem; }
  .service-location { color: var(--text-muted); margin-bottom: 0.5rem; }
  .service-rating { color: var(--accent); margin-bottom: 0.5rem; }
  .service-cta { margin-top: auto; text-align: center; }
  .book-btn { background: var(--primary); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 25px; cursor: pointer; width: 100%; }
  .review-btn { margin-top: 0.5rem; background: var(--card-bg); color: var(--primary); border: 1px solid var(--primary); padding: 0.65rem 1.5rem; border-radius: 25px; cursor: pointer; width: 100%; }
  .review-btn:hover { background: var(--background); }

           /* Autocomplete Dropdown */
   #autocomplete { position: absolute; top: 100%; left: 0; right: 0; background: var(--card-bg); border: 1px solid var(--border); border-top: none; max-height: 200px; overflow-y: auto; display: none; z-index: 10; }
   .suggestion { padding: 0.75rem; cursor: pointer; border-bottom: 1px solid var(--border); }
   .suggestion:hover, .suggestion.active { background: var(--background); }
   .suggestion:last-child { border-bottom: none; }

    /* Reviews Modal */
    .modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; padding: 1rem; z-index: 200; }
    .modal.open { display: flex; }
    .modal-content { background: var(--card-bg); border-radius: 12px; max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 1.5rem; display: grid; gap: 1rem; }
    .modal-header { display: flex; justify-content: space-between; align-items: center; }
    .modal-header h3 { margin: 0; color: var(--primary); }
    .close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); }
    .reviews-list { display: grid; gap: 0.75rem; }
    .review-item { border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem; }
    .review-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.35rem; display: flex; justify-content: space-between; }
    .review-form { display: grid; gap: 0.75rem; }
    .review-form select, .review-form textarea { width: 100%; padding: 0.75rem; border-radius: 8px; border: 1px solid var(--border); font-size: 1rem; }
    .submit-review-btn { background: var(--primary); color: #fff; border: none; padding: 0.75rem 1.5rem; border-radius: 999px; cursor: pointer; }   
    .inline-inputs { display: grid; gap: 0.5rem; }
    .container { max-width: 750px; padding: 2rem; }
   form { background: var(--card-bg); border-radius: 12px; box-shadow: 0 2px 6px var(--shadow); padding: 1.5rem; }
    form h2 { font-size: 1.4rem; margin-bottom: 1rem; color: var(--primary); }
        .form-grid { display: grid; gap: 1rem; }
        .form-group { display: flex; flex-direction: column; gap: 0.35rem; }
        .availability h3 { color: #4CAF50; margin-bottom: 1rem; }
        .slot-list { display: grid; gap: 0.5rem; }
        .slot { display: flex; justify-content: space-between; padding: 0.75rem 1rem; border-radius: 8px; background: #f1f8f4; border: 1px solid #d9eedf; font-size: 0.95rem; }

        .leaflet-control-zoom-in, .leaflet-control-zoom-out {
          font-size: 18px;
          font-weight: bold;
          line-height: 1;
      }
      
      .leaflet-control-zoom-in:before {
          content: "+";
      }
      
      .leaflet-control-zoom-out:before {
          content: "−";
      }

      
    
    /* Post cards spacing */
    .post {
        margin-bottom: 1.5rem;
    }
    
    .delete-alert-btn {
        background: #f44336;
        color: white;
        border: none;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        cursor: pointer;
        font-size: 0.8rem;
        margin-left: 0.5rem;
    }
    
    .delete-alert-btn:hover {
        background: #d32f2f;
    }
    
    .delete-post-btn {
      background: #f44336;
      color: white;
      border: none;
      padding: 0.25rem 0.5rem;
      border-radius: 4px;
      cursor: pointer;
      font-size: 0.8rem;
      margin-left: 0.5rem;
  }
  
  .delete-post-btn:hover {
      background: #d32f2f;
  }

  /* Dark Mode Toggle Button */
  #darkModeToggle {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 10px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
  }
 
  #darkModeToggle:hover {
    background: var(--background);
  }


    /* Media Queries: Tablet (481-768px) */
@media (min-width: 480px) {  /* Tablet */
    .quick-actions .action-card { flex: 1 1 48%; }
    .container { padding: 0.5rem; }
    header { flex-wrap: nowrap; }
    

}

@media (min-width: 769px) {  /* Desktop */
    .service-grid { grid-template-columns: repeat(3, 1fr); max-width: 1200px; margin: 0 auto; }
    .quick-actions { max-width: 1200px; margin: 2rem auto; }
    .quick-actions .action-card { flex: 1 1 22%; }
    nav { position: fixed; justify-content: center; gap: 2rem; padding: 1rem 0; }
    .container { max-width: 800px; padding: 2rem; }
    #chatbotBtn { bottom: 6rem; right: 2rem; }
    #chatbotModal { bottom: calc(6rem + 1.5rem); right: 2rem; width: 400px;max-height: 400px;background: var(--background);border-radius: 10px;box-shadow: 0 2px 10px rgba(0,0,0,0.2);overflow: hidden; z-index: 1101; }
    .hero-overlay { padding: 40px; }
}