/**
 * Стили виджета авторизации
 */

/* Контейнер социальных кнопок */
.social-buttons {
    display: inline-flex;
    gap: 5px;
}

/* Кнопка авторизации */
.auth-widget-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    height: 3rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 100px;
    vertical-align: middle;
}

.auth-widget-login-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Профиль пользователя */
#auth-widget-profile {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px 0 0;
    height: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    vertical-align: middle;
}

[data-theme=light] #auth-widget-profile {
    background: rgb(217, 241, 167);
}

#auth-widget-profile:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Аватар */
.auth-widget-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Переливающаяся рамка для аватара авторизованного пользователя */
.auth-widget-avatar-authenticated {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 50%;
    background: linear-gradient(45deg, #4ecdc4, #45b7d1, #667eea, #764ba2, #4ecdc4);
    background-size: 300% 300%;
    animation: gradient-shift 4s ease infinite;
    height: 52px;
    width: 55px;
}

@media (max-width: 768px) {
    .auth-widget-avatar-authenticated {
        height: 48px;
        width: 58px;
    }
}

.auth-widget-avatar-authenticated img {
    display: block;
    border-radius: 50%;
    border: 1px solid rgba(30, 30, 30, 0.9);
}

/* Для кнопки профиля */
#auth-widget-profile .auth-widget-avatar-authenticated {
    width: 40px;
    height: 40px;
}

#auth-widget-profile .auth-widget-avatar-authenticated img {
    width: 36px;
    height: 36px;
}

/* Для комментариев */
.comment .auth-widget-avatar-authenticated img {
    width: 44px;
    height: 44px;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Мобильные стили для профиля */
@media (max-width: 768px) {
    #auth-widget-profile {
        padding: 0 3px 0 3px;
    }

    /* На мобилке показываем только аватар, без имени */
    #auth-widget-profile .auth-widget-username {
        display: none;
    }
}

/* (старый мобильный override удалён, ниже единый стиль модалки) */

/* Имя пользователя */
.auth-widget-username {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

[data-theme=light] .auth-widget-username {
    color: #666666;
}

/* Модальное окно */
.auth-widget-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.auth-widget-modal-content {
    position: relative;
    background: #222222;
    color: #f3f3f3;
    border-radius: 16px;
    padding: 24px 24px 28px;
    max-width: 420px;
    width: 100%;
    margin: 0 16px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: modal-appear 0.3s ease;
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Кнопка закрытия */
.auth-widget-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.auth-widget-close:hover {
    color: #333;
}

/* Позиция крестика на мобильных */
@media (max-width: 768px) {
    .auth-widget-close {
        top: 16px;
        right: 30px;
    }
}

/* Светлая тема модалки */
[data-theme=light] .auth-widget-modal-content {
    background: #acba6e;
    color: #353535;
}

[data-theme=light] .auth-widget-close {
    color: #000000;
}

/* Табы */
.auth-widget-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 2px solid #eee;
}

.auth-widget-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #999;
    transition: all 0.3s;
    position: relative;
}

.auth-widget-tab.active {
    color: #667eea;
}

.auth-widget-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Формы */
.auth-widget-form {
    display: none;
}

.auth-widget-form.active {
    display: block;
}

/* Оформление блоков "Вход" и "Регистрация" */
#auth-widget-login-form,
#auth-widget-register-form {
    margin-top: 8px;
}

#auth-widget-login-form h2,
#auth-widget-register-form h2 {
    text-align: center;
    font-size: 20px;
    margin-bottom: 16px;
}

#auth-widget-login-form input,
#auth-widget-register-form input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 2px solid #3a3a3a;
    background: #111;
    color: #f3f3f3;
    font-size: 14px;
}

#auth-widget-login-form input::placeholder,
#auth-widget-register-form input::placeholder {
    color: #777;
}

#auth-widget-login-form input:focus,
#auth-widget-register-form input:focus {
    outline: none;
    border-color: #667eea;
}

#auth-widget-login-form button,
#auth-widget-register-form button {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#auth-widget-login-form button:hover,
#auth-widget-register-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Светлая тема для полей */
[data-theme=light] #auth-widget-login-form input,
[data-theme=light] #auth-widget-register-form input {
    background: #f7f7f7;
    border-color: #d0d0d0;
    color: #333;
}

[data-theme=light] #auth-widget-login-form input::placeholder,
[data-theme=light] #auth-widget-register-form input::placeholder {
    color: #999;
}

.auth-widget-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.auth-widget-input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-widget-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-widget-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Ошибки */
.auth-widget-error {
    display: none;
    padding: 12px;
    margin-bottom: 16px;
    background: #fee;
    color: #c33;
    border-radius: 8px;
    font-size: 14px;
}

.auth-widget-error.show {
    display: block;
}

/* Профиль */
.auth-widget-profile-view {
    display: none;
}

.auth-widget-profile-view.active {
    display: block;
}

.auth-widget-profile-view h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
}

.auth-widget-profile-username {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f3f3f3;
}

[data-theme=light] .auth-widget-profile-username {
    color: #353535;
}

#auth-widget-current-avatar {
    text-align: center;
    margin-bottom: 16px;
}

#auth-widget-current-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #667eea;
}

.auth-widget-avatar-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Сетка аватаров */
#auth-widget-avatar-grid {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.auth-widget-avatar-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    object-fit: cover;
}

.auth-widget-avatar-option:hover {
    transform: scale(1.1);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Кнопка загрузки аватара */
.auth-widget-upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.auth-widget-upload-btn i {
    font-size: 20px;
    margin-bottom: 4px;
}

/* Кнопки действий */
.auth-widget-action-btn {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-widget-action-btn:hover {
    background: #667eea;
    color: white;
}

#auth-widget-logout {
    color: #c33;
    text-align: center;
}

#auth-widget-logout:hover {
    background: #c33;
    color: white;
}
