/* ============================================
   FABRIC CSS — BSDC Utility Framework
   Bangladesh Software Development Community
   ============================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #FFFFFF;
  color: #1E293B;
  line-height: 1.6;
  min-height: 100vh;
}

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

a {
  color: #006A4E;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #004d38;
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}

ul, ol {
  list-style: none;
}

/* ---- CONTAINER ---- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-sm {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-lg {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---- GRID ---- */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }

/* ---- FLEX ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* ---- SPACING ---- */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.p-12 { padding: 3rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

/* ---- TYPOGRAPHY ---- */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

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

.leading-tight { line-height: 1.25; }
.leading-snug { line-height: 1.375; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.625; }
.leading-loose { line-height: 2; }

.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- COLORS ---- */
.text-white { color: #FFFFFF; }
.text-black { color: #000000; }
.text-green { color: #006A4E; }
.text-green-dark { color: #004d38; }
.text-green-light { color: #00a878; }
.text-slate { color: #1E293B; }
.text-slate-500 { color: #64748B; }
.text-slate-400 { color: #94A3B8; }
.text-slate-300 { color: #CBD5E1; }
.text-red { color: #DC2626; }
.text-yellow { color: #D97706; }
.text-blue { color: #2563EB; }

.bg-white { background-color: #FFFFFF; }
.bg-green { background-color: #006A4E; }
.bg-green-dark { background-color: #004d38; }
.bg-green-light { background-color: #e6f4f0; }
.bg-slate { background-color: #1E293B; }
.bg-slate-50 { background-color: #F8FAFC; }
.bg-slate-100 { background-color: #F1F5F9; }
.bg-slate-200 { background-color: #E2E8F0; }
.bg-slate-800 { background-color: #1E293B; }
.bg-slate-900 { background-color: #0F172A; }
.bg-transparent { background-color: transparent; }
.bg-red-light { background-color: #FEE2E2; }
.bg-yellow-light { background-color: #FEF3C7; }
.bg-blue-light { background-color: #DBEAFE; }

/* ---- BORDERS ---- */
.border { border: 1px solid #E2E8F0; }
.border-2 { border: 2px solid #E2E8F0; }
.border-green { border-color: #006A4E; }
.border-slate { border-color: #1E293B; }
.border-t { border-top: 1px solid #E2E8F0; }
.border-b { border-bottom: 1px solid #E2E8F0; }
.border-l { border-left: 1px solid #E2E8F0; }
.border-r { border-right: 1px solid #E2E8F0; }
.border-l-4 { border-left: 4px solid #006A4E; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* ---- SHADOWS ---- */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); }
.shadow-green { box-shadow: 0 4px 14px rgba(0,106,78,0.25); }

/* ---- DISPLAY ---- */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hidden { display: none; }
.flex { display: flex; }
.grid { display: grid; }

/* ---- POSITION ---- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.inset-0 { top: 0; left: 0; right: 0; bottom: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }

/* ---- SIZE ---- */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-half { width: 50%; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-32 { width: 8rem; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.h-32 { height: 8rem; }
.min-h-screen { min-height: 100vh; }

/* ---- OVERFLOW ---- */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ---- OPACITY ---- */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ---- TRANSITION ---- */
.transition { transition: all 0.2s ease; }
.transition-fast { transition: all 0.1s ease; }
.transition-slow { transition: all 0.4s ease; }

/* ---- CURSOR ---- */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: #006A4E;
  color: #FFFFFF;
  border-color: #006A4E;
}

.btn-primary:hover {
  background: #004d38;
  border-color: #004d38;
  color: #FFFFFF;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,106,78,0.35);
}

.btn-secondary {
  background: transparent;
  color: #006A4E;
  border-color: #006A4E;
}

.btn-secondary:hover {
  background: #006A4E;
  color: #FFFFFF;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-slate {
  background: #1E293B;
  color: #FFFFFF;
  border-color: #1E293B;
}

.btn-slate:hover {
  background: #0F172A;
  border-color: #0F172A;
  color: #FFFFFF;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: #1E293B;
  border-color: transparent;
}

.btn-ghost:hover {
  background: #F1F5F9;
  text-decoration: none;
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---- FORM ELEMENTS ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1E293B;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #E2E8F0;
  border-radius: 0.5rem;
  font-size: 1rem;
  color: #1E293B;
  background: #FFFFFF;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: #006A4E;
  box-shadow: 0 0 0 3px rgba(0,106,78,0.1);
}

.form-input::placeholder { color: #94A3B8; }

.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #E2E8F0;
  border-radius: 0.5rem;
  font-size: 1rem;
  color: #1E293B;
  background: #FFFFFF;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
  min-height: 120px;
}

.form-textarea:focus {
  border-color: #006A4E;
  box-shadow: 0 0 0 3px rgba(0,106,78,0.1);
}

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #E2E8F0;
  border-radius: 0.5rem;
  font-size: 1rem;
  color: #1E293B;
  background: #FFFFFF;
  cursor: pointer;
}

.form-select:focus { border-color: #006A4E; }

.form-error {
  font-size: 0.8rem;
  color: #DC2626;
  margin-top: 0.25rem;
}

.form-hint {
  font-size: 0.8rem;
  color: #64748B;
  margin-top: 0.25rem;
}

/* ---- CARDS ---- */
.card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.card-body { padding: 1.5rem; }
.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
}
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #E2E8F0;
  background: #F8FAFC;
}

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-green { background: #e6f4f0; color: #006A4E; }
.badge-slate { background: #E2E8F0; color: #1E293B; }
.badge-red { background: #FEE2E2; color: #DC2626; }
.badge-yellow { background: #FEF3C7; color: #D97706; }
.badge-blue { background: #DBEAFE; color: #2563EB; }

/* ---- ALERTS ---- */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-success { background: #e6f4f0; border-color: #006A4E; color: #004d38; }
.alert-error { background: #FEE2E2; border-color: #DC2626; color: #991B1B; }
.alert-warning { background: #FEF3C7; border-color: #D97706; color: #92400E; }
.alert-info { background: #DBEAFE; border-color: #2563EB; color: #1E40AF; }

/* ---- DIVIDER ---- */
.divider {
  height: 1px;
  background: #E2E8F0;
  margin: 1.5rem 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: #64748B;
  font-size: 0.875rem;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E2E8F0;
}

/* ---- AVATAR ---- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #006A4E;
  flex-shrink: 0;
}

.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; font-size: 0.875rem; }
.avatar-lg { width: 3.5rem; height: 3.5rem; font-size: 1.25rem; }
.avatar-xl { width: 5rem; height: 5rem; font-size: 1.75rem; }
.avatar-2xl { width: 7rem; height: 7rem; font-size: 2.5rem; }

/* ---- TAG/CHIP ---- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: #e6f4f0;
  color: #006A4E;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
}

.tag:hover {
  background: #006A4E;
  color: #FFFFFF;
  text-decoration: none;
}

/* ---- TABS ---- */
.tabs {
  display: flex;
  border-bottom: 2px solid #E2E8F0;
  gap: 0;
  overflow-x: auto;
}

.tab-item {
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: #64748B;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.2s;
}

.tab-item:hover { color: #006A4E; }
.tab-item.active { color: #006A4E; border-bottom-color: #006A4E; }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #FFFFFF;
  border-radius: 1rem;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.25s ease;
  position: relative;
}

.modal-overlay.active .modal { transform: scale(1); }

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #F1F5F9;
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover { background: #E2E8F0; }

/* ---- TOAST ---- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  padding: 0.875rem 1.25rem;
  border-radius: 0.75rem;
  background: #1E293B;
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 360px;
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.toast.show { transform: translateX(0); }
.toast.success { background: #006A4E; }
.toast.error { background: #DC2626; }
.toast.warning { background: #D97706; }

/* ---- DROPDOWN ---- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #1E293B;
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover { background: #F8FAFC; }
.dropdown-item.danger { color: #DC2626; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .text-6xl { font-size: 2.5rem; }
  .text-5xl { font-size: 2rem; }
  .text-4xl { font-size: 1.75rem; }
  .text-3xl { font-size: 1.5rem; }

  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
}

@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}

@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}
