/* BookShare Community - Tailwind v4 CSS Classes */
/* This file contains all the specific Tailwind classes used in the BookShare marketplace */

@tailwind base;
@tailwind components;
@tailwind utilities;

/* Layout & Structure */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-grow { flex-grow: 1; }
.flex-1 { flex: 1 1 0%; }
.min-h-screen { min-height: 100vh; }

/* Container & Spacing */
.container { 
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-xs { max-width: 20rem; }

/* Padding & Margins */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.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-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pr-10 { padding-right: 2.5rem; }

.m-1 { margin: 0.25rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 2.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 2.5rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.ml-6 { margin-left: 1.5rem; }
.ml-8 { margin-left: 2rem; }

/* Colors - Emerald (Primary) */
.bg-emerald-50 { background-color: rgb(236 253 245); }
.bg-emerald-100 { background-color: rgb(209 250 229); }
.bg-emerald-200 { background-color: rgb(167 243 208); }
.bg-emerald-600 { background-color: rgb(5 150 105); }
.bg-emerald-700 { background-color: rgb(4 120 87); }
.text-emerald-100 { color: rgb(209 250 229); }
.text-emerald-600 { color: rgb(5 150 105); }
.text-emerald-800 { color: rgb(6 95 70); }
.hover\:bg-emerald-200:hover { background-color: rgb(167 243 208); }
.hover\:bg-emerald-700:hover { background-color: rgb(4 120 87); }

/* Colors - Blue */
.bg-blue-50 { background-color: rgb(239 246 255); }
.bg-blue-600 { background-color: rgb(37 99 235); }
.bg-blue-700 { background-color: rgb(29 78 216); }
.text-blue-800 { color: rgb(30 64 175); }
.text-blue-500 { color: rgb(59 130 246); }
.border-blue-200 { border-color: rgb(191 219 254); }
.hover\:bg-blue-700:hover { background-color: rgb(29 78 216); }

/* Colors - Gray */
.bg-gray-50 { background-color: rgb(249 250 251); }
.bg-gray-100 { background-color: rgb(243 244 246); }
.bg-gray-200 { background-color: rgb(229 231 235); }
.bg-gray-300 { background-color: rgb(209 213 219); }
.bg-gray-800 { background-color: rgb(31 41 55); }
.text-gray-400 { color: rgb(156 163 175); }
.text-gray-500 { color: rgb(107 114 128); }
.text-gray-600 { color: rgb(75 85 99); }
.text-gray-700 { color: rgb(55 65 81); }
.text-gray-800 { color: rgb(31 41 55); }
.border-gray-200 { border-color: rgb(229 231 235); }
.border-gray-300 { border-color: rgb(209 213 219); }
.border-gray-700 { border-color: rgb(55 65 81); }
.hover\:bg-gray-50:hover { background-color: rgb(249 250 251); }
.hover\:bg-gray-200:hover { background-color: rgb(229 231 235); }
.hover\:bg-gray-300:hover { background-color: rgb(209 213 219); }
.hover\:text-white:hover { color: rgb(255 255 255); }

/* Colors - Red */
.bg-red-100 { background-color: rgb(254 226 226); }
.bg-red-200 { background-color: rgb(254 202 202); }
.bg-red-600 { background-color: rgb(220 38 38); }
.bg-red-700 { background-color: rgb(185 28 28); }
.text-red-700 { color: rgb(185 28 28); }
.hover\:bg-red-200:hover { background-color: rgb(254 202 202); }
.hover\:bg-red-700:hover { background-color: rgb(185 28 28); }

/* Colors - Basic */
.bg-white { background-color: rgb(255 255 255); }
.text-white { color: rgb(255 255 255); }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

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

/* Borders */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-t { border-top-width: 1px; }
.border-r { border-right-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-dashed { border-style: dashed; }
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow-md { 
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.shadow-lg { 
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
.hover\:shadow-lg:hover { 
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.right-3 { right: 0.75rem; }
.top-3 { top: 0.75rem; }

/* Z-Index */
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }
.z-\[9999\] { z-index: 9999; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Responsive Grid Classes */
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:w-1\/4 { width: 25%; }
  .lg\:w-3\/4 { width: 75%; }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Spacing */
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }
.space-x-6 > :not([hidden]) ~ :not([hidden]) { margin-left: 1.5rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }

/* Width & Height */
.w-4 { width: 1rem; }
.w-8 { width: 2rem; }
.w-12 { width: 3rem; }
.w-24 { width: 6rem; }
.w-32 { width: 8rem; }
.w-48 { width: 12rem; }
.w-64 { width: 16rem; }
.w-96 { width: 24rem; }
.w-full { width: 100%; }
.h-4 { height: 1rem; }
.h-8 { height: 2rem; }
.h-12 { height: 3rem; }
.h-24 { height: 6rem; }
.h-32 { height: 8rem; }
.h-48 { height: 12rem; }
.h-64 { height: 16rem; }
.h-96 { height: 24rem; }
.h-full { height: 100%; }

.img-box {
  height: 200px;
  width: auto;
  object-fit: cover;
}

/* Sizing Responsive */
@media (min-width: 768px) {
  .md\:w-1\/3 { width: 33.333333%; }
  .md\:w-2\/3 { width: 66.666667%; }
  .md\:w-1\/4 { width: 25%; }
  .md\:w-auto { width: auto; }
  .md\:flex-row { flex-direction: row; }
  .md\:mb-0 { margin-bottom: 0px; }
  .md\:p-8 { padding: 2rem; }
}

/* Interactions */
.cursor-pointer { cursor: pointer; }
.hover\:underline:hover { text-decoration-line: underline; }

/* Transitions */
.transition-shadow { 
  transition-property: box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

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

/* Object Fit */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

/* Special Height Classes */
.h-\[600px\] { height: 600px; }
.h-\[calc\(600px-56px\)\] { height: calc(600px - 56px); }

/* Form Elements */
input, textarea, select {
  appearance: none;
  background-color: #fff;
  border-color: #d1d5db;
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

button {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Custom Utilities for Special Cases */
.stroke-2 { stroke-width: 2; }
.fill-none { fill: none; }
.stroke-current { stroke: currentColor; }

/* SVG specific styles */
svg {
  display: block;
  vertical-align: middle;
}