/**
 * ════════════════════════════════════════════════════════════════════════════════
 * 📁 СТИЛИ ДЛЯ ФУТЕРА (FOOTER.PHP)
 * ════════════════════════════════════════════════════════════════════════════════
 * 
 * Этот файл содержит стили для футера админ-панели:
 * - Раскладка блока выхода (.footer-logout, form); внешний вид кнопки — styles/buttons.css
 * - Копирайт и информация
 * - Переключатель языков
 * - Toast уведомления
 * 
 * ⚠️ ВАЖНО: Использует CSS переменные из base.css
 */

/* ═══════════════════════════════════════════════════════════════════════════════
 * КНОПКА ВЫХОДА
 * ═══════════════════════════════════════════════════════════════════════════════ */

/* По умолчанию справа; на ≤767px mobile.css задаёт text-align: center и form/button на всю ширину */
.footer-logout {
    margin: var(--space-6) 0;
    text-align: right;
}

.footer-logout form {
    display: inline-block;
    margin: 0;
}

/* ≥768px: форма и кнопка не на всю ширину (text-align: right задано выше для .footer-logout) */
@media (min-width: 768px) {
    .footer-logout form {
        display: inline-block;
        width: auto;
        max-width: none;
    }

    .footer-logout button.btn.btn-danger.footer-logout-btn {
        width: auto;
        max-width: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
 * КОПИРАЙТ И ИНФОРМАЦИЯ
 * ═══════════════════════════════════════════════════════════════════════════════ */

.footer-copyright {
    text-align: center;
    padding: var(--space-3) 0;
    margin: var(--space-6) 0;
    color: var(--text-dark);
    font-size: var(--text-sm);
    border-top: 1px solid var(--border);
}

.footer-copyright i {
    color: var(--primary);
    margin-right: var(--space-1);
}

.footer-copyright a {
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-base);
    margin-left: var(--space-1);
}

.footer-copyright a:hover {
    color: var(--success);
    text-decoration: underline;
}

.footer-version {
    color: var(--text-light);
    font-size: var(--text-xs);
}

/* Ссылка на политику конфиденциальности */
.footer-privacy-link {
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-base);
    font-weight: 500;
}

.footer-privacy-link:hover {
    color: var(--success);
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════════
 * TOAST КОПИРОВАНИЯ: футер (#copy-toast.footer-copy-toast) и страницы (#copyNotification.copy-toast)
 * j-script/ui/copy-text.js: copyNotification | #copy-toast | .footer-copy-toast
 * ═══════════════════════════════════════════════════════════════════════════════ */

.footer-copy-toast,
.copy-toast {
    position: fixed;
    display: none;
    align-items: center;
    font-weight: 500;
    color: var(--text-white);
    line-height: 1.5;
    box-sizing: border-box;
}

.footer-copy-toast {
    bottom: var(--space-6);
    right: var(--space-6);
    padding: var(--space-3) var(--space-5);
    gap: var(--space-2);
    background: linear-gradient(135deg, var(--success), #059669);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-tooltip);
    animation: footer-toast-slide-in 0.3s ease-out;
    /* ⚠️ ВАЖНО: Фиксированные размеры (min-width) определены в адаптивных файлах:
     * - desktop.css (≥1024px): 200px
     * - tablet.css (768px-1023px): 180px
     * - mobile.css (≤767px): 160px
     * - mobile-small.css (≤480px): 140px
     */
}

.footer-copy-toast.show {
    display: flex;
}

.copy-toast {
    bottom: var(--space-xl);
    right: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background-color: var(--success);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-family: var(--font-primary);
    font-size: var(--text-base);
    justify-content: center;
    min-width: 200px;
    white-space: nowrap;
    animation: copy-toast-slide-in 0.3s ease-out;
    transition: opacity var(--transition-base);
}

.copy-toast.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.copy-toast.show.hidden,
.copy-toast.hidden.show,
#copyNotification.copy-toast.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* admin/curator_list.php: Bootstrap .d-none — .show должен перебить */
#copyNotification.copy-toast.show.d-none {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes footer-toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes copy-toast-slide-in {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
 * ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ (ТАБЛИЦА)
 * ═══════════════════════════════════════════════════════════════════════════════ */

.footer-lang-table {
    border-collapse: collapse;
    background: none;
    padding: 0;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.footer-lang-cell {
    padding: var(--space-1);
    width: 25%;
    text-align: center;
}

.footer-lang-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all var(--transition-base);
    border-radius: var(--radius-full);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* ⚠️ ВАЖНО: Фиксированные размеры (width, height) определены в адаптивных файлах:
     * - desktop.css (≥1024px): 50px
     * - tablet.css (768px-1023px): 45px
     * - mobile.css (≤767px): 40px
     * - mobile-small.css (≤480px): 35px
     */
}

.footer-lang-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    background: rgba(59, 130, 246, 0.1);
    opacity: 0;
    transition: all var(--transition-base);
    z-index: 0;
}

.footer-lang-btn:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

.footer-lang-btn img {
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    object-fit: cover;
    border-radius: var(--radius-full);
    position: relative;
    z-index: 1;
    transition: transform var(--transition-base);
}

.footer-lang-btn:hover img {
    transform: scale(1.1);
}

.footer-lang-btn:focus {
    outline: none;
}

.footer-lang-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.footer-lang-btn:active {
    transform: scale(0.95);
}

.footer-lang-btn:active img {
    transform: scale(1.05);
}

/* Модификатор для флагов без теней */
.footer-lang-no-shadow {
    box-shadow: none !important;
}

.footer-lang-no-shadow,
.footer-lang-no-shadow * {
    box-shadow: none !important;
    filter: none !important;
    border: 0 !important;
}

.footer-lang-no-shadow:hover,
.footer-lang-no-shadow:hover * {
    box-shadow: none !important;
    border: 0 !important;
}

.footer-lang-no-shadow:active,
.footer-lang-no-shadow:active * {
    box-shadow: none !important;
    border: 0 !important;
}

.footer-lang-no-shadow:focus,
.footer-lang-no-shadow:focus * {
    box-shadow: none !important;
    border: 0 !important;
}

.footer-lang-no-shadow.active,
.footer-lang-no-shadow.active * {
    box-shadow: none !important;
    border: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
 * СОВРЕМЕННЫЙ ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ (КАРТОЧКА)
 * ═══════════════════════════════════════════════════════════════════════════════ */

.footer-lang-switcher {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    margin: var(--space-6) 0;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.footer-lang-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--space-4);
    font-size: var(--text-base);
    text-align: center;
    justify-content: center;
}

.footer-lang-title i {
    color: var(--accent-blue);
    font-size: var(--text-xl);
}

.footer-lang-container {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    align-items: center;
}

.footer-lang-form {
    margin: 0;
}

/* Стили для современного варианта кнопок флагов */
.footer-lang-switcher .footer-lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
    /* ⚠️ ВАЖНО: Фиксированные размеры (width, height) определены в адаптивных файлах:
     * - desktop.css (≥1024px): 70px
     * - tablet.css (768px-1023px): 65px
     * - mobile.css (≤767px): 60px
     * - mobile-small.css (≤480px): 55px
     */
}

.footer-lang-switcher .footer-lang-btn img {
    border: 2px solid var(--border);
    /* ⚠️ ВАЖНО: Фиксированные размеры (width, height) определены в адаптивных файлах:
     * - desktop.css (≥1024px): 40px
     * - tablet.css (768px-1023px): 36px
     * - mobile.css (≤767px): 32px
     * - mobile-small.css (≤480px): 28px
     */
}

.footer-lang-switcher .footer-lang-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: all var(--transition-base);
}

.footer-lang-switcher .footer-lang-btn:hover::before {
    left: 100%;
}

.footer-lang-switcher .footer-lang-btn:hover {
    border-color: var(--accent-blue);
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, var(--bg-primary), var(--info-light));
}

.footer-lang-switcher .footer-lang-btn:hover img {
    transform: scale(1.1);
    border-color: var(--accent-blue);
}

.footer-lang-switcher .footer-lang-btn.active {
    border-color: var(--accent-blue);
    background: var(--bg-primary);
    transform: scale(1.05);
}

.footer-lang-switcher .footer-lang-btn.active img {
    border-color: var(--accent-blue);
}

.footer-lang-switcher .footer-lang-btn.active::after {
    content: '✓';
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--success);
    color: var(--text-white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: bold;
    border: 2px solid var(--bg-primary);
    /* ⚠️ ВАЖНО: Фиксированные размеры (width, height) определены в адаптивных файлах:
     * - desktop.css (≥1024px): 18px
     * - tablet.css (768px-1023px): 16px
     * - mobile.css (≤767px): 14px
     * - mobile-small.css (≤480px): 12px
     */
}

.footer-lang-switcher .footer-lang-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.footer-lang-switcher .footer-lang-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent-blue);
    border-radius: var(--radius-full);
    animation: footer-lang-spin 1s linear infinite;
    /* ⚠️ ВАЖНО: Фиксированные размеры (width, height) определены в адаптивных файлах:
     * - desktop.css (≥1024px): 16px
     * - tablet.css (768px-1023px): 14px
     * - mobile.css (≤767px): 12px
     * - mobile-small.css (≤480px): 10px
     */
}

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

/* Специальные стили для флагов */
.footer-lang-btn img[alt*="Ukraine"],
.footer-lang-btn img[alt*="Україна"] {
    border: 2px solid #0057B7;
}

.footer-lang-btn img[alt*="Azerbaijan"],
.footer-lang-btn img[alt*="Азербайджан"] {
    border: 2px solid #009639;
}

.footer-lang-btn img[alt*="United Kingdom"],
.footer-lang-btn img[alt*="Великобритания"] {
    border: 2px solid #012169;
}

.footer-lang-btn img[alt*="Russia"],
.footer-lang-btn img[alt*="Россия"] {
    border: 2px solid #0039A6;
}

/* Улучшенные hover эффекты для флагов */
.footer-lang-btn:hover img[alt*="Ukraine"] {
    border-color: #FFD700;
}

.footer-lang-btn:hover img[alt*="Azerbaijan"] {
    border-color: #F00;
}

.footer-lang-btn:hover img[alt*="United Kingdom"] {
    border-color: #C8102E;
}

.footer-lang-btn:hover img[alt*="Russia"] {
    border-color: #FFF;
}

