/* ============================================
   CUSTOM CSS - RestoSocialAI Specific Overrides
   ============================================
   This file contains all customizations that differ 
   from the original index.css and tailwind-build.css
   ============================================

   BACKUP & CHANGELOG:
   -------------------
   2025-04-22 20:30 UTC — tw-icon-center: left 0.75rem → 0.3rem
   (иконки в полях ввода теперь расположены идеально)
   ============================================ */

/* ============================================
   CSS VARIABLES OVERRIDES (from :root)
   ============================================ */
:root {
    /* Button variables - not in original */
    --btn-bg-hover: #1f2937;
    --btn-border-color: #111827;
    --btn-secondary-color: #111827;
    --btn-secondary-bg: transparent;
    --btn-secondary-border: #d1d5db;
}

.tw-dark {
    /* Dark mode button variables - not in original */
    --btn-bg-hover: #e5e7eb;
    --btn-border-color: #f9fafb;
    --btn-secondary-color: #f9fafb;
    --btn-secondary-bg: transparent;
    --btn-secondary-border: #4b5563;
}

/* ============================================
   BUTTON OVERRIDES
   ============================================ */
.btn {
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid var(--btn-border-color);
    display: inline-flex;
    gap: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: var(--btn-bg-hover);
    transform: translateY(-1px);
}

.btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.btn-secondary {
    color: var(--btn-secondary-color);
    background-color: var(--btn-secondary-bg);
    border-color: var(--btn-secondary-border);
}

.btn-secondary:hover {
    background-color: rgba(127, 127, 127, 0.08);
}

/* ============================================
   HEADER OVERRIDES
   ============================================ */
header > .collapsible-header {
    overflow: visible;
}

/* ============================================
   SOCIAL CAROUSEL (added feature)
   ============================================ */

/* Обёртка карусели — на полную ширину страницы */
.social-carousel-wrapper {
    width: 80%;
    overflow: hidden;
    position: relative;
    float: left;
}

/* Трек карусели — бесшовная анимация */
.social-carousel-track {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    width: max-content;
    animation: social-carousel-scroll 25s linear infinite;
}

/* Пауза анимации при наведении */
.social-carousel-track:hover {
    animation-play-state: paused;
}

/* Элемент карусели — каждый значок */
.social-carousel-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 80px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.social-carousel-item:hover {
    transform: scale(1.15);
}

/* Бесшовная анимация прокрутки */
@keyframes social-carousel-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ============================================
   MOBILE MENU OVERRIDES (max-width: 1024px)
   ============================================ */
@media not all and (min-width: 1024px) {
    header .collapsible-header {
        max-height: calc(100vh - 70px);
        justify-content: flex-start;
        width: 100%;
    }
}

/* ============================================
   TAILWIND EXTENSIONS
   Classes present on server but not in original
   ============================================ */

/* Margin utilities */
.tw-mt-22 {
    margin-top: 6rem;
}

.tw-mt-24 {
    margin-top: 6rem;
}

/* Width utilities */
.tw-w-\[40\%\] {
    width: 40%;
}

.tw-w-\[60\%\] {
    width: 60%;
}

/* Ширина для двухколоночного layout профильных страниц */
.tw-w-\[20\%\] {
    width: 20%;
}

.tw-w-\[80\%\] {
    width: 80%;
}

/* Responsive ширина на md breakpoint и выше */
@media (min-width: 768px) {
    .md\:tw-w-\[20\%\] {
        width: 20%;
    }
    .md\:tw-w-\[30\%\] {
        width: 30%;
    }
    .md\:tw-w-\[40\%\] {
        width: 40%;
    }
    .md\:tw-w-\[80\%\] {
        width: 80%;
    }
    .md\:tw-flex-row {
        flex-direction: row;
    }
    .md\:tw-border-r {
        border-right-width: 1px;
    }
    /* Grid 2 колонки на md breakpoint для карточек ресторанов на profile */
    .md\:tw-grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    /* Gap 1.5rem на md breakpoint */
    .md\:tw-gap-6 {
        gap: 1.5rem;
    }
}

/* Responsive стили на lg breakpoint (1024px) и выше */
@media (min-width: 1024px) {
    /* Grid 3 колонки на lg breakpoint для карточек ресторанов на profile */
    .lg\:tw-grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Responsive стили на max-md breakpoint (менее 768px) */
@media (max-width: 767px) {
    .max-md\:tw-max-w-full {
        max-width: 100%;
    }
    .max-md\:tw-flex-col {
        flex-direction: column;
    }
}

/* Responsive стили на sm breakpoint (640px) и выше */
@media (min-width: 640px) {
    .sm\:tw-flex-row {
        flex-direction: row;
    }
    .sm\:tw-flex-col {
        flex-direction: column;
    }
    .sm\:tw-items-start {
        align-items: flex-start;
    }
    .sm\:tw-items-center {
        align-items: center;
    }
    .sm\:tw-text-left {
        text-align: left;
    }
    .sm\:tw-text-center {
        text-align: center;
    }
    .sm\:tw-pl-1 {
        padding-left: 0.25rem;
    }
}

/* ============================================
   PROFILE PAGE STYLES
   ============================================ */

/* Отступ сверху 5rem для контента страниц профиля */
.tw-mt-20 {
    margin-top: 5rem;
}

/* Ширина и высота 5rem (80px) для аватаров и логотипов */
.tw-w-20 {
    width: 5rem;
}

.tw-h-20 {
    height: 5rem;
}

/* ============================================
   MAX-WIDTH UTILITIES — для ограничения ширины контента
   tw-max-w-5xl = 64rem (1024px), tw-max-w-6xl = 72rem (1152px)
   Применяется: profile_page_base.html, navbar.html
   ============================================ */
.tw-max-w-5xl {
    max-width: 64rem;
}

.tw-max-w-6xl {
    max-width: 72rem;
}

@media (min-width: 1024px) {
    .lg\:tw-max-w-5xl {
        max-width: 64rem;
    }
    .lg\:tw-max-w-6xl {
        max-width: 72rem;
    }
}

/* ============================================
   MARGIN AUTO — для центрирования блока по горизонтали
   Применяется: profile_page_base.html (контейнер страницы)
   ============================================ */
.tw-mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   UTILITY CLASSES - Missing from tailwind-build.css
   ============================================ */

/* Min width utilities */
.tw-min-w-0 {
    min-width: 0;
}

/* Text size utilities */
.tw-text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.tw-text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.tw-text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.tw-text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

/* Font weight */
.tw-font-medium {
    font-weight: 500;
}

.tw-font-semibold {
    font-weight: 600;
}

.tw-font-bold {
    font-weight: 700;
}

/* Alignment utilities */
.tw-items-baseline {
    align-items: baseline;
}

.tw-items-start {
    align-items: flex-start;
}

.tw-items-end {
    align-items: flex-end;
}

/* Space between utilities */
.tw-space-y-1 > * + * {
    margin-top: 0.25rem;
}

.tw-space-y-3 > * + * {
    margin-top: 0.75rem;
}

/* Space-y 1rem — gap между карточками в форме create-post */
.tw-space-y-4 > * + * {
    margin-top: 1rem;
}

/* Border utilities */
.tw-border-t {
    border-top-width: 1px;
}

.tw-border-gray-100 {
    border-color: #f3f4f6;
}

.dark .dark\:tw-border-gray-700 {
    border-color: #374151;
}

/* Hover utilities */
.hover\:tw-underline:hover {
    text-decoration: underline;
}

/* Focus utilities */
.focus\:tw-outline-none:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.focus\:tw-ring-2:focus {
    box-shadow: 0 0 0 2px currentColor;
}

.focus\:tw-ring-gray-500:focus {
    box-shadow: 0 0 0 2px #6b7280;
}

/* Padding utilities */
.tw-pl-0 {
    padding-left: 0;
}

/* Margin utilities */
.tw-mt-1\.5 {
    margin-top: 0.375rem;
}

.tw-mt-2 {
    margin-top: 0.5rem;
}

.tw-mt-3 {
    margin-top: 0.75rem;
}

.tw-mt-4 {
    margin-top: 1rem;
}

.tw-mt-6 {
    margin-top: 1.5rem;
}

.tw-mb-1 {
    margin-bottom: 0.25rem;
}

.tw-mb-2 {
    margin-bottom: 0.5rem;
}

.tw-mb-3 {
    margin-bottom: 0.75rem;
}

.tw-mb-4 {
    margin-bottom: 1rem;
}

.tw-mb-6 {
    margin-bottom: 1.5rem;
}

/* Gap utilities */
.tw-gap-1 {
    gap: 0.25rem;
}

.tw-gap-2 {
    gap: 0.5rem;
}

.tw-gap-3 {
    gap: 0.75rem;
}

.tw-gap-4 {
    gap: 1rem;
}

.tw-gap-6 {
    gap: 1.5rem;
}

/* Gap utilities for max-md breakpoint */
@media (max-width: 767px) {
    .max-md\:tw-gap-6 {
        gap: 1.5rem;
    }
}

/* Flex utilities */
.tw-flex-1 {
    flex: 1 1 0%;
}

.tw-flex-wrap {
    flex-wrap: wrap;
}

.tw-justify-between {
    justify-content: space-between;
}

/* Align self utilities */
.tw-self-start {
    align-self: flex-start;
}

/* Grid utilities */
.tw-grid {
    display: grid;
}

.tw-grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* Grid 2 колонки — для кнопок типа контента на create-post */
.tw-grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Padding-top 0.5rem для уменьшения отступа над кнопками в карточке поста */
.tw-pt-2 {
    padding-top: 0.5rem;
}

/* ============================================
   POST LIST STYLES
   ============================================ */

/* Максимальная высота 10rem (160px) для миниатюр в списке постов */
.tw-max-h-40 {
    max-height: 10rem;
}

/* Ограничение текста поста до 6 строк в карточке */
.tw-line-clamp-6 {
    display: -webkit-box;
    line-clamp: 6;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   SIGNUP PAGE STYLES
   ============================================ */

/* Отступ сверху 4rem для основного контейнера формы */
.tw-mt-16 {
    margin-top: 4rem;
}

/* Иконки в полях ввода — вертикальное центрирование */
.tw-icon-center {
    position: absolute;
    left: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Отступ слева для input с иконкой — placeholder не перекрывается */
.tw-input-pl {
    padding-left: 1.5rem;
}

/* Отступ между текстом "Войти или зарегистрироваться через" и соц кнопками */
.tw-social-text-mb {
    margin-bottom: 1rem;
}

/* Центрирование flex-элементов по горизонтали — для соц кнопок */
.tw-justify-center {
    justify-content: center;
}

/* ============================================
   FORM INPUT STYLES (dark mode visibility)
   ============================================ */

/* Поля ввода форм в тёмной теме — тёмный текст на светлом фоне для читаемости */
.dark input,
.dark select,
.dark textarea {
    color: #1f2937 !important;
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
}

/* Конкретно для полей формы create-post — селекты и инпуты */
.dark form input[type="text"],
.dark form input[type="datetime-local"],
.dark form input[type="file"],
.dark form select,
.dark form textarea {
    color: #1f2937 !important;
    background-color: #f3f4f6 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 0.75rem !important;
}

/* Placeholder в тёмной теме */
.dark form input::placeholder,
.dark form textarea::placeholder {
    color: #6b7280 !important;
}

/* Фокус состояние */
.dark form input:focus,
.dark form select:focus,
.dark form textarea:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
}
main { overflow-x: hidden; } body { overflow-x: hidden; }
.tw-max-w-\[40rem\] { max-width: 40rem; }