/* =============================================================================
   КОМПОНЕНТЫ И УТИЛИТЫ - SlotReviews.ru
   Toast уведомления, анимации, вспомогательные классы
============================================================================= */

/* =============================================================================
   TOAST УВЕДОМЛЕНИЯ
============================================================================= */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 500px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast--show {
    opacity: 1;
    transform: translateX(0);
}

.toast--success {
    border-left: 4px solid #10b981;
}

.toast--error {
    border-left: 4px solid #ef4444;
}

.toast--warning {
    border-left: 4px solid #f59e0b;
}

.toast--info {
    border-left: 4px solid var(--secondary-blue);
}

.toast__content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.toast__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast__message {
    font-weight: 500;
    color: var(--gray-800);
    word-break: break-word;
}

.toast__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.toast__close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* =============================================================================
   СПИННЕРЫ И ЗАГРУЗЧИКИ
============================================================================= */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--secondary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.spinner--small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner--large {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Пульсирующая загрузка */
.pulse-loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--secondary-blue);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* =============================================================================
   АНИМАЦИИ
============================================================================= */

/* Появление снизу */
.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Появление слева */
.slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Появление справа */
.slide-in-right {
    animation: slideInRight 0.5s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Масштабирование */
.scale-in {
    animation: scaleIn 0.3s ease forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =============================================================================
   МОДАЛЬНЫЕ ОКНА
============================================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay--active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.modal__header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal__close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal__body {
    padding: 1.5rem;
}

.modal__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* =============================================================================
   УТИЛИТАРНЫЕ КЛАССЫ
============================================================================= */

/* Скрытие элементов */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Выравнивание текста */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Отступы */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Padding */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* Ширина */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Flexbox утилиты */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* =============================================================================
   УВЕДОМЛЕНИЯ И АЛЕРТЫ
============================================================================= */

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert--info {
    background: #dbeafe;
    border-color: var(--secondary-blue);
    color: #1e40af;
}

.alert--success {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.alert--warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.alert--error {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.alert__title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* =============================================================================
   RESPONSIVE UTILITIES
============================================================================= */

@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        top: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .modal {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }

    .modal__header,
    .modal__body,
    .modal__footer {
        padding: 1rem;
    }
}

/* =============================================================================
   HOVER И FOCUS ЭФФЕКТЫ
============================================================================= */

.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.focus-ring {
    transition: box-shadow 0.2s ease;
}

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* =============================================================================
   КАСТОМНЫЕ СКРОЛЛБАРЫ
============================================================================= */

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) var(--gray-100);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}