@import './variables.css';

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-top: 90px;
}

/* hide vertical scrollbar while preserving scroll behavior */
body::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  outline: none;
}

input, select, textarea {
  font-family: var(--font);
  outline: none;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.section-subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 40px;
  font-size: 0.95rem;
}

.page-banner {
  background: var(--primary);
  padding: 40px 0;
  color: var(--white);
}

.page-banner h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  opacity: 0.85;
}

.breadcrumb span {
  opacity: 0.6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

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

.btn-accent {
  background: var(--accent);
  color: var(--white);
}

.btn-accent:hover {
  background: var(--accent-light);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--primary);
}

.btn-outline-dark {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-dark:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-whatsapp {
  background: var(--success);
  color: var(--white);
}

.btn-whatsapp:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

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

.text-accent {
  color: var(--accent);
}

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

.loading {
  text-align: center;
  padding: 60px;
  color: var(--gray-500);
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 4px;
}

.success-msg {
  color: #28a745;
  font-size: 0.85rem;
  margin-top: 4px;
}

@media (max-width: 992px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .section {
    padding: 40px 0;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .page-banner h1 {
    font-size: 1.5rem;
  }
}

/* Adjust body offset for fixed navbar at each breakpoint */
@media (max-width: 1024px) {
  body {
    padding-top: 80px;
  }
}

@media (min-width: 992px) and (max-width: 1024px) {
  body {
    padding-top: 66px;
  }
}

@media (max-width: 576px) {
  body {
    padding-top: 70px;
  }
}

/* Responsive Grid Form Rows */
.grid-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.inner-unit-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .grid-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 480px) {
  .inner-unit-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Premium Custom Dropdown Arrow styling */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Responsive Admin Filter Form */
.admin-filter-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

@media (max-width: 576px) {
  .admin-filter-form {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .admin-filter-form .form-control,
  .admin-filter-form select,
  .admin-filter-form button,
  .admin-filter-form a {
    max-width: 100% !important;
    width: 100% !important;
    flex: none !important;
  }
}

