/* General Body & Container */
html {
  height: 100%;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: "Open Sans", sans-serif;
  margin: 0;
  background-color: #ffffff;
  color: #333;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header */
.main-header-wrapper {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.top-bar {
  background-color: #008444; /* Darker green */
  height: 10px;
}
.main-header {
  padding: 20px 0;
}
.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
}
.logo {
  height: 60px;
}
.site-identity {
  display: flex;
  flex-direction: column;
}
.sup-title {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
.main-title {
  font-size: 20px;
  font-weight: 700;
  color: #006334;
}
.sub-title {
  font-size: 13px;
  color: #666;
}
.login-button {
  background-color: #f9b233; /* Yellow */
  color: #fff;
  padding: 10px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 700;
  transition: background-color 0.3s;
}
.login-button:hover {
  background-color: #e4a12d;
}
.header-menu-bar {
  background-color: #00a651; /* Main green */
}
.header-menu-bar .container {
  display: flex;
}
.header-menu-bar a {
  color: #fff;
  padding: 15px 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.header-menu-bar a:hover,
.header-menu-bar a.active {
  background-color: #008444;
}

/* Main Content - Dashboard */
.page-dashboard {
  padding: 40px 0;
}

.category-section {
  margin-bottom: 40px;
}

.category-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
  color: #006334;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 25px;
}

.app-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
  padding: 25px;
  text-align: center;
  text-decoration: none;
  color: #2d3748;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-card:hover {
  transform: translateY(-5px);
  border-color: #00a651;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.app-icon {
  font-size: 48px;
  color: #00a651;
  margin-bottom: 15px;
  display: block;
}

.app-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.empty-message {
  text-align: center;
  color: #718096;
  background-color: #fff;
  padding: 40px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

/* Home Page Hero Section */
.home-hero-section {
  display: flex;
  align-items: center;
  gap: 50px;
  padding: 40px 20px;
  background-color: #f8f9fa;
  border-radius: 12px;
  margin-top: 20px;
}

.home-hero-section .hero-text {
  flex: 1;
}

.home-hero-section .hero-text h1 {
  font-size: 32px;
  font-weight: 700;
  color: #006334;
  margin-top: 0;
  margin-bottom: 15px;
}

.home-hero-section .hero-text p {
  font-size: 16px;
  color: #555;
  line-height: 1.7;
}

.home-hero-section .hero-image {
  flex: 1;
  text-align: center;
}

.home-hero-section .hero-image img {
  max-width: 100%;
  height: auto;
  max-height: 300px;
}

/* Responsive styles for hero section */
@media (max-width: 768px) {
  .home-hero-section {
    flex-direction: column;
    text-align: center;
    gap: 30px;
    padding: 30px;
  }

  .home-hero-section .hero-text h1 {
    font-size: 28px;
  }
}

/* General Responsive Styles for Mobile */
@media (max-width: 768px) {
  /* Header */
  .main-header .container {
    flex-direction: column;
    gap: 20px;
  }
  .logo-area {
    flex-direction: column;
    text-align: center;
  }
  .header-menu-bar .container {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling for iOS */
  }
  .header-menu-bar .container::-webkit-scrollbar {
    height: 3px; /* Thin scrollbar */
  }
  .header-menu-bar .container::-webkit-scrollbar-thumb {
    background: #f9b233; /* Scrollbar color */
  }
  .header-menu-bar a {
    white-space: nowrap; /* Prevent menu items from wrapping */
  }

  /* App Grid */
  .app-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
  }

  /* Footer */
  .footer-bottom .container {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 15px;
  }
}

/* Footer */
.main-footer {
  color: #fff;
}
.footer-top {
  background-color: #00a651;
  padding: 40px 0;
}
.footer-logo-area {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-logo {
  height: 60px;
}
.footer-bottom {
  background-color: #008444;
  padding: 20px 0;
  font-size: 14px;
}
.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-info span {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.contact-info a {
  color: inherit;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .footer-bottom .container {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 15px;
  }

  .contact-info {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .contact-info span {
    display: block;
    text-align: center;
    max-width: 95%;
  }

  .contact-info span i {
    display: block;
    margin: 0 auto 8px auto;
    font-size: 22px;
  }
}

/* Add this to the end of the file */
.settings-fab {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background-color: #f9b233; /* Yellow, matching login button */
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* Made shadow more prominent */
  text-decoration: none;
  font-size: 28px; /* Slightly larger icon */
  transition: all 0.3s ease;
  z-index: 1000; /* Ensure it's on top of other content */
}

.settings-fab:hover {
  background-color: #e4a12d;
  transform: translateY(-4px) scale(1.05); /* Enhanced hover effect */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

@media (max-width: 768px) {
  .settings-fab {
    width: 50px;
    height: 50px;
    font-size: 20px;
    bottom: 20px;
    right: 20px;
  }
}

.page-content {
  flex-grow: 1;
}

/* --- Settings Page Styles --- */
.settings-container-main {
  padding: 20px 0;
}

.settings-page-header {
  margin-bottom: 30px;
  text-align: center;
}

.settings-page-header h1 {
  font-size: 32px;
  margin-bottom: 5px;
  color: #006334;
}

.settings-page-header p {
  font-size: 16px;
  color: #555;
}

.settings-card {
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  padding: 30px;
  margin-bottom: 30px;
}

.settings-card h2 {
  font-size: 22px;
  margin-top: 0;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e2e8f0;
  color: #006334;
}

/* Two-column grid layout */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

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

.settings-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2d3748;
}

.settings-form input[type="text"],
.settings-form input[type="file"],
.settings-form select {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  box-sizing: border-box; /* Important for padding and width */
}

.settings-form button,
.edit-btn,
.delete-btn {
  background-color: #00a651;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s;
}

.settings-form button:hover {
  background-color: #008444;
}

.current-logo-preview {
  max-height: 40px;
  vertical-align: middle;
  margin-left: 10px;
  border-radius: 4px;
}

/* Category Management specific styles */
.category-management {
  display: flex;
  gap: 30px;
}

.category-list-container {
  flex: 1;
}

.category-add-form {
  flex: 1;
}

.category-list-container h3,
.category-add-form h3 {
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 15px;
}

#sortable-categories .category-item {
  display: flex;
  align-items: center;
  background-color: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.drag-handle {
  cursor: grab;
  margin-right: 10px;
  color: #a0aec0;
}

.category-item span {
  flex-grow: 1;
}

.delete-btn-small {
  background: none;
  border: none;
  color: #e53e3e;
  font-size: 20px;
  cursor: pointer;
  padding: 0 5px;
}

/* Menu List Styles */
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #e2e8f0;
}
.menu-item:last-child {
  border-bottom: none;
}
.menu-info {
  display: flex;
  align-items: center;
  gap: 15px;
}
.menu-info i {
  font-size: 24px;
  color: #00a651;
}
.menu-info small {
  display: block;
  color: #718096;
}
.menu-actions {
  display: flex;
  gap: 10px;
}
.edit-btn {
  background-color: #f9b233;
  padding: 8px 15px;
}
.edit-btn:hover {
  background-color: #e4a12d;
}
.delete-btn {
  background-color: #e53e3e;
  padding: 8px 15px;
}
.delete-btn:hover {
  background-color: #c53030;
}

.message-box {
  padding: 15px;
  background-color: #e6fffa;
  border: 1px solid #38c1a1;
  color: #237665;
  border-radius: 6px;
  margin-bottom: 20px;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: #00a651;
  text-decoration: none;
  font-weight: 600;
}
.back-link:hover {
  text-decoration: underline;
}

/* Responsive adjustments for settings page */
@media (max-width: 992px) {
  .settings-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .footer-bottom .container,
  .contact-info {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 10px;
  }
}
@media (max-width: 768px) {
  .category-management {
    flex-direction: column;
  }
}

.logout-link {
  color: #e53e3e;
  text-decoration: none;
  font-weight: 600;
}
.logout-link:hover {
  text-decoration: underline;
}
.back-link-container {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

/* --- Login Page Styles --- */
.login-body {
  background-color: #f0f2f5;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
.login-card {
  background-color: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-card h2 {
  margin-top: 0;
  color: #006334;
}
.login-card .form-group {
  text-align: left;
  margin-bottom: 15px;
}
.login-card label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}
.login-card input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}
.login-card button {
  width: 100%;
  padding: 12px;
  background-color: #00a651;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}
.login-card button:hover {
  background-color: #008444;
}
.login-error {
  color: #e53e3e;
  background-color: #fff5f5;
  border: 1px solid #fc8181;
  padding: 10px;
  border-radius: 6px;
}
.back-to-portal-link {
  display: block;
  margin-top: 20px;
  color: #718096;
  font-size: 14px;
}
