/**
 * Utility CSS Classes
 * Extracted from inline styles across templates
 * Provides reusable atomic classes for common patterns
 */

/* ========================================
   LAYOUT & SPACING UTILITIES
======================================== */

/* Flex Layouts */
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-align { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-start { display: flex; align-items: flex-start; }
.flex-end { display: flex; align-items: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow-1 { flex-grow: 1; }

/* Gap Utilities */
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

/* Padding Utilities (extends Bootstrap) */
.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.p-28 { padding: 28px; }
.p-32 { padding: 32px; }

.px-8 { padding-left: 8px; padding-right: 8px; }
.px-12 { padding-left: 12px; padding-right: 12px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.px-24 { padding-left: 24px; padding-right: 24px; }

.py-8 { padding-top: 8px; padding-bottom: 8px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }
.py-20 { padding-top: 20px; padding-bottom: 20px; }
.py-24 { padding-top: 24px; padding-bottom: 24px; }

/* Margin Utilities (extends Bootstrap) */
.m-8 { margin: 8px; }
.m-12 { margin: 12px; }
.m-16 { margin: 16px; }
.m-20 { margin: 20px; }
.m-24 { margin: 24px; }

.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }

/* ========================================
   BACKGROUND & BORDER UTILITIES
======================================== */

/* Background Colors (Light Variants) */
.bg-light-blue { background-color: #dbeafe; }
.bg-light-green { background-color: #dcfce7; }
.bg-light-yellow { background-color: #fef3c7; }
.bg-light-red { background-color: #fee2e2; }
.bg-light-purple { background-color: #f3e8ff; }
.bg-light-gray { background-color: #f3f4f6; }
.bg-light-orange { background-color: #ffedd5; }

/* Background Success/Warning/Danger with opacity */
.bg-success-25 { background-color: rgba(34, 197, 94, 0.1); }
.bg-warning-25 { background-color: rgba(245, 158, 11, 0.1); }
.bg-danger-25 { background-color: rgba(239, 68, 68, 0.1); }
.bg-info-25 { background-color: rgba(59, 130, 246, 0.1); }
.bg-primary-25 { background-color: rgba(99, 102, 241, 0.1); }

/* Border Radius */
.rounded-8 { border-radius: 8px; }
.rounded-12 { border-radius: 12px; }
.rounded-16 { border-radius: 16px; }
.rounded-20 { border-radius: 20px; }
.rounded-24 { border-radius: 24px; }

/* Border Colors */
.border-neutral-100 { border-color: #f3f4f6; }
.border-neutral-200 { border-color: #e5e7eb; }
.border-neutral-300 { border-color: #d1d5db; }

/* ========================================
   SHADOW UTILITIES
======================================== */

.shadow-card { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.shadow-card-hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15); }

/* ========================================
   TEXT & TYPOGRAPHY UTILITIES
======================================== */

/* Text Colors (Neutral Scale) */
.text-neutral-700 { color: #374151; }
.text-neutral-800 { color: #1f2937; }
.text-neutral-900 { color: #111827; }
.text-neutral-600 { color: #4b5563; }
.text-neutral-500 { color: #6b7280; }
.text-neutral-400 { color: #9ca3af; }

/* Font Weights */
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }

/* Font Sizes */
.text-xs { font-size: 0.75rem; }  /* 12px */
.text-sm { font-size: 0.875rem; } /* 14px */
.text-base { font-size: 1rem; }   /* 16px */
.text-lg { font-size: 1.125rem; } /* 18px */
.text-xl { font-size: 1.25rem; }  /* 20px */
.text-2xl { font-size: 1.5rem; }  /* 24px */
.text-3xl { font-size: 1.875rem; } /* 30px */

/* Line Height */
.leading-tight { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.75; }

/* Text Decoration */
.text-decoration-none { text-decoration: none; }
.link-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ========================================
   ICON UTILITIES
======================================== */

.icon-sm { font-size: 16px; }
.icon-md { font-size: 20px; }
.icon-lg { font-size: 24px; }
.icon-xl { font-size: 32px; }
.icon-2xl { font-size: 48px; }

/* Circular Icon Container */
.icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.icon-circle-sm {
    width: 32px;
    height: 32px;
}

.icon-circle-md {
    width: 40px;
    height: 40px;
}

.icon-circle-lg {
    width: 48px;
    height: 48px;
}

.icon-circle-xl {
    width: 64px;
    height: 64px;
}

/* ========================================
   SIZING UTILITIES
======================================== */

/* Width */
.w-32 { width: 32px; }
.w-40 { width: 40px; }
.w-48 { width: 48px; }
.w-56 { width: 56px; }
.w-64 { width: 64px; }
.w-80 { width: 80px; }

/* Height */
.h-32 { height: 32px; }
.h-40 { height: 40px; }
.h-48 { height: 48px; }
.h-56 { height: 56px; }
.h-64 { height: 64px; }
.h-80 { height: 80px; }

/* Min/Max Width */
.min-w-0 { min-width: 0; }
.max-w-full { max-width: 100%; }

/* ========================================
   TRANSITION & ANIMATION UTILITIES
======================================== */

.transition-all { transition: all 0.3s ease; }
.transition-fast { transition: all 0.2s ease; }
.transition-slow { transition: all 0.4s ease; }

/* Hover Effects */
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-shadow:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ========================================
   DISPLAY & OVERFLOW UTILITIES
======================================== */

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* ========================================
   POSITION UTILITIES
======================================== */

.position-relative { position: relative; }
.position-absolute { position: absolute; }

/* ========================================
   CARD UTILITIES
======================================== */

.card-clean {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
}

.card-shadow {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-hover {
    transition: all 0.3s ease;
}

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

/* ========================================
   RESPONSIVE GRID PATTERNS
======================================== */

/* Standard 3-column card grid */
.grid-3-col > * {
    width: 100%;
}

@media (min-width: 768px) {
    .grid-3-col > * {
        width: calc(50% - 12px);
    }
}

@media (min-width: 992px) {
    .grid-3-col > * {
        width: calc(33.333% - 16px);
    }
}

/* Standard 4-column card grid */
.grid-4-col > * {
    width: 100%;
}

@media (min-width: 768px) {
    .grid-4-col > * {
        width: calc(50% - 12px);
    }
}

@media (min-width: 992px) {
    .grid-4-col > * {
        width: calc(33.333% - 16px);
    }
}

@media (min-width: 1200px) {
    .grid-4-col > * {
        width: calc(25% - 18px);
    }
}

/* ========================================
   MISC UTILITIES
======================================== */

.cursor-pointer { cursor: pointer; }
.user-select-none { user-select: none; }
.pointer-events-none { pointer-events: none; }

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

/* Clamp text to lines */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.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;
}

/* Aspect ratio */
.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

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

.object-contain {
    object-fit: contain;
}
