/* ============================================
   УТИЛИТНЫЕ КЛАССЫ (замена Tailwind)
   ============================================ */

/* Flexbox */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* 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)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Gap */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Container */
.container { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Spacing - Padding */
.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; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.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; }
.px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }

.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-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-16 { padding-top: 4rem; padding-bottom: 4rem; }

.pt-4 { padding-top: 1rem; }
.pb-4 { padding-bottom: 1rem; }

/* Spacing - Margin */
.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.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: 3rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }

/* Width */
.w-5 { width: 1.25rem; }
.w-8 { width: 2rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-full { width: 100%; }

/* Height */
.h-5 { height: 1.25rem; }
.h-8 { height: 2rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }

/* Max Width */
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }

/* Text Align */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text Size */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.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; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

/* Font Weight */
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Line Height */
.leading-tight { line-height: 1.25; }
.leading-5 { line-height: 1.25rem; }

/* Letter Spacing */
.tracking-wider { letter-spacing: 0.05em; }

/* Text Transform */
.uppercase { text-transform: uppercase; }

/* Text Colors */
.text-white { color: #ffffff; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-red-800 { color: #991b1b; }
.text-green-800 { color: #166534; }
.text-blue-600 { color: #2563eb; }
.text-yellow-600 { color: #ca8a04; }

/* Background Colors */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-500 { background-color: #6b7280; }
.bg-gray-600 { background-color: #4b5563; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-100 { background-color: #dcfce7; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-yellow-100 { background-color: #fef3c7; }
.bg-yellow-600 { background-color: #ca8a04; }
.bg-orange-50 { background-color: #fff7ed; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-red-600 { background-color: #dc2626; }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }

/* Border */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* Whitespace */
.whitespace-nowrap { white-space: nowrap; }

/* Shadow */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* Transform */
.transform { transform: translateX(0) translateY(0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1); }
.scale-105 { transform: scale(1.05); }

/* Transition */
.transition { transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 300ms; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* Spacing utilities - Space Between Y (vertical) */
.space-y-0 > * + * { margin-top: 0; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-y-10 > * + * { margin-top: 2.5rem; }
.space-y-12 > * + * { margin-top: 3rem; }

/* Spacing utilities - Space Between X (horizontal) */
.space-x-0 > * + * { margin-left: 0; }
.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-5 > * + * { margin-left: 1.25rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-x-8 > * + * { margin-left: 2rem; }
.space-x-10 > * + * { margin-left: 2.5rem; }
.space-x-12 > * + * { margin-left: 3rem; }

/* Reverse spacing */
.space-y-reverse > * + * { 
    --tw-space-y-reverse: 1;
    margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
    margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
}

.space-x-reverse > * + * {
    --tw-space-x-reverse: 1;
    margin-right: calc(0.5rem * var(--tw-space-x-reverse));
    margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Hover - Backgrounds */
[class*="hover:bg-gray-700"]:hover { background-color: #374151; }
[class*="hover:bg-blue-100"]:hover { background-color: #dbeafe; }
[class*="hover:bg-blue-700"]:hover { background-color: #1d4ed8; }
[class*="hover:bg-yellow-100"]:hover { background-color: #fef3c7; }
[class*="hover:bg-yellow-700"]:hover { background-color: #a16207; }
[class*="hover:bg-orange-100"]:hover { background-color: #ffedd5; }
[class*="hover:bg-red-100"]:hover { background-color: #fee2e2; }
[class*="hover:bg-red-700"]:hover { background-color: #b91c1c; }

/* Hover - Shadow */
[class*="hover:shadow-md"]:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
[class*="hover:shadow-lg"]:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Small screens (sm) - 640px+ */
@media (min-width: 640px) {
    [class*="sm:flex-row"] { flex-direction: row; }
    [class*="sm:grid-cols-2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    [class*="sm:grid-cols-3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .container { max-width: 640px; }
}

/* Medium screens (md) - 768px+ */
@media (min-width: 768px) {
    [class*="md:flex-row"] { flex-direction: row; }
    [class*="md:grid-cols-1"] { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    [class*="md:grid-cols-2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    [class*="md:grid-cols-3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    [class*="md:grid-cols-4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    [class*="md:text-6xl"] { font-size: 3.75rem; line-height: 1; }
    [class*="md:text-5xl"] { font-size: 3rem; line-height: 1; }
    [class*="md:text-4xl"] { font-size: 2.25rem; line-height: 2.5rem; }
    [class*="md:text-xl"] { font-size: 1.25rem; line-height: 1.75rem; }
    [class*="md:py-24"] { padding-top: 6rem; padding-bottom: 6rem; }
    .container { max-width: 768px; }
}

/* Large screens (lg) - 1024px+ */
@media (min-width: 1024px) {
    [class*="lg:grid-cols-2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    [class*="lg:grid-cols-3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    [class*="lg:grid-cols-4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .container { max-width: 1024px; }
}

/* Extra large screens (xl) - 1280px+ */
@media (min-width: 1280px) {
    .container { max-width: 1280px; }
}

/* Mobile responsive text */
@media (max-width: 767px) {
    .text-3xl { font-size: 1.5rem; line-height: 2rem; }
}
