/* ===== Base Styles ===== */
body {
  font-family: 'Poppins', sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 100%;
  padding: 20px;
  margin: 0 auto;
}

/* ===== Home Page ===== */
header {
  text-align: center;
  margin: 30px 0;
  padding: 20px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
  color: #ff6b6b;
  font-size: 2.5rem;
  margin-bottom: 10px;
}

header p {
  color: #666;
  font-size: 1.1rem;
}

.role-selector {
  margin: 40px 0;
  text-align: center;
}

.role-selector h2 {
  color: #555;
  margin-bottom: 20px;
}

.buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 300px;
  margin: 0 auto;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.vendor-btn {
  background-color: #4CAF50;
  color: white;
}

.supplier-btn {
  background-color: #2196F3;
  color: white;
}

/* ===== Vendor Page ===== */
.vendor-container {
  max-width: 100%;
  padding: 15px;
}

.vendor-container header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.vendor-container h1 {
  color: #4CAF50;
  font-size: 1.8rem;
  margin: 0;
}

#refresh-btn {
  background-color: #f0f0f0;
  color: #333;
  padding: 8px 15px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.filters {
  background-color: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.search-box {
  display: flex;
  margin-bottom: 15px;
}

#search-items {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px 0 0 6px;
  font-size: 1rem;
}

#search-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 0 6px 6px 0;
  padding: 0 15px;
  cursor: pointer;
}

.filter-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

#sort-by {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 0.9rem;
}

.suppliers-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 20px;
}

.supplier-card {
  background-color: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.supplier-card h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.2rem;
}

.supplier-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.status-open {
  background-color: #4CAF50;
  color: white;
}

.status-closed {
  background-color: #f44336;
  color: white;
}

.supplier-distance, .supplier-items {
  color: #666;
  margin: 5px 0;
  font-size: 0.9rem;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background-color: #25D366;
  color: white;
  padding: 8px 15px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  margin-top: 10px;
  font-size: 0.9rem;
}

.rating-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.rating-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
}

.thumbs-up {
  color: #4CAF50;
}

.thumbs-down {
  color: #f44336;
}

.location-status {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

#change-location {
  background: none;
  border: none;
  color: #2196F3;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ===== Modal ===== */
/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 25px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn.primary {
  background-color: #4CAF50;
  color: white;
}

.btn.secondary {
  background-color: #f44336;
  color: white;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  color: #666;
  font-size: 0.9rem;
}

/* ===== Supplier Dashboard Styles ===== */
.supplier-container {
  max-width: 100%;
  padding: 15px;
  margin: 0 auto;
}

.supplier-container header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.supplier-container header h1 {
  color: #2196F3;
  font-size: 1.8rem;
  margin: 0;
}

#logout-btn {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Tabs */
.supplier-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: #666;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.tab-btn.active {
  color: #2196F3;
  border-bottom: 3px solid #2196F3;
}

/* Tab Content */
.tab-content {
  display: none;
  padding: 15px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.tab-content.active {
  display: block;
}

/* Stock Tab */
.status-toggle {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.status-toggle label {
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 500;
}

#status-text {
  font-weight: bold;
  margin-left: 10px;
}

.stock-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stock-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.stock-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.save-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 20px;
  transition: background-color 0.3s;
}

.save-btn:hover {
  background-color: #3e8e41;
}

/* Profile Tab */
.profile-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.info-label {
  font-weight: 600;
  color: #555;
}

.info-value {
  color: #333;
}

/* Ratings Tab */
.rating-summary {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px 0;
}

.rating-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.rating-item i {
  font-size: 2rem;
}

.rating-item.positive {
  color: #4CAF50;
}

.rating-item.negative {
  color: #f44336;
}

.rating-item span {
  font-size: 1.2rem;
  font-weight: bold;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #4CAF50;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .supplier-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .stock-items {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .supplier-container header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stock-items {
    grid-template-columns: 1fr 1fr;
  }
  
  .tab-btn {
    padding: 10px 15px;
    font-size: 0.85rem;
  }
}

/* ===== Authentication Page Styles ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f5f7fa;
  padding: 20px;
}

.auth-box {
  background: white;
  width: 100%;
  max-width: 420px;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.5s ease;
}

.auth-box h1 {
  color: #2196F3;
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.8rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus {
  border-color: #2196F3;
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.btn {
  width: 100%;
  padding: 12px;
  background-color: #2196F3;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.btn:hover {
  background-color: #0d8bf2;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.location-btn {
  background-color: #FF9800;
  margin-bottom: 10px;
}

.location-btn:hover {
  background-color: #e68a00;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: #666;
}

.auth-switch a {
  color: #2196F3;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth-switch a:hover {
  text-decoration: underline;
}

#location-status {
  font-size: 0.85rem;
  color: #666;
  margin-top: 5px;
  text-align: center;
  font-style: italic;
}

/* Form toggle animation */
#register-form {
  display: none;
}

#register-form.show {
  display: block;
  animation: slideDown 0.4s ease;
}

/* Error message styling */
.error-message {
  color: #f44336;
  font-size: 0.85rem;
  margin-top: 5px;
  display: none;
}

/* Loading state */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .auth-box {
    padding: 25px 20px;
  }
  
  .auth-box h1 {
    font-size: 1.5rem;
  }
  
  .form-group input {
    padding: 10px 12px;
  }
}

/* ===== Responsive Design ===== */
@media (min-width: 768px) {
  .container {
    max-width: 800px;
  }
  
  .buttons {
    flex-direction: row;
    max-width: none;
    justify-content: center;
  }
  
  .suppliers-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .suppliers-list {
    grid-template-columns: repeat(3, 1fr);
  }
}