/**
 * shesterenka-safety-settings.css - Стили для раздела "Безопасность" в шестерёнке
 * 
 * 📌 НАЗНАЧЕНИЕ:
 * Обеспечивает стилизацию раздела "Безопасность" в боковой панели настроек (шестерёнка).
 * Содержит стили для всех элементов безопасности: уведомления о входе, смена пароля,
 * активные сессии, история входов, лог активности.
 * 
 * 🔧 ОСНОВНЫЕ КОМПОНЕНТЫ:
 * - .security-item – карточка каждой функции безопасности
 * - .security-item-header – заголовок с переключателем
 * - .security-item-title – название функции с иконкой
 * - .security-item-desc – описание функции
 * - .security-item-options – дополнительные опции (радиокнопки)
 * - .security-form – форма смены пароля
 * - .btn-change-password – кнопка смены пароля
 * - .btn-revoke-all – кнопка завершения всех сессий
 * - .sessions-list, .login-history, .activity-log – списки данных
 * - .session-item, .history-item, .log-item – элементы списков
 * - .password-strength – индикатор сложности пароля
 * - .password-message – сообщение об успехе/ошибке
 * 
 * ⚠️ ОСОБЕННОСТИ:
 * - Единый стиль для всех элементов безопасности
 * - Адаптив под мобильные устройства
 * - Интерактивные состояния (hover, focus)
 * - Цветовое кодирование для разных типов статусов
 * 
 * 📁 СВЯЗАННЫЕ ФАЙЛЫ:
 * - 04_lk_gid.php (ЛК гида)
 * - 03_lk_turist.php (ЛК туриста)
 * - assets/js/gid/part9_shesterenka.js (логика шестерёнки гида)
 * - assets/js/tourist/part9_shesterenka_tourist.js (логика шестерёнки туриста)
 * - assets/js/stop_sess.js (управление сессиями)
 * - assets/css/shesterenka-settings.css (основные стили шестерёнки)
 * 
 * 🏷️ КЛЮЧЕВЫЕ СЛОВА ДЛЯ ПОИСКА:
 * безопасность, настройки, шестерёнка, пароль, сессии, история входов,
 * лог активности, уведомления, security, password, sessions, login history,
 * activity log, notifications, shesterenka, settings
 */

/* ============================================
   БЕЗОПАСНОСТЬ В НАСТРОЙКАХ
   ============================================ */

.security-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.security-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.security-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.security-item-title {
    font-weight: 600;
    color: #0f2c3d;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.security-item-title i {
    margin-right: 8px;
    width: 18px;
    text-align: center;
}

.security-item-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

.security-item-options {
    margin-top: 10px;
    padding-left: 28px;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.security-item-options label {
    display: flex;
    align-items: center;
    color: #475569;
    cursor: pointer;
    gap: 8px;
    font-size: 0.85rem;
}

.security-item-options label input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #1f6392;
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================
   ФОРМА СМЕНЫ ПАРОЛЯ
   ============================================ */

.security-form {
    margin-top: 12px;
}

.security-form .form-group {
    margin-bottom: 12px;
}

.security-form .form-group label {
    display: block;
    font-weight: 500;
    color: #334155;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.security-form .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dce2ec;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.security-form .form-group input:focus {
    outline: none;
    border-color: #1f6392;
    box-shadow: 0 0 0 3px rgba(31, 99, 146, 0.1);
}

.security-form .form-group input::placeholder {
    color: #94a3b8;
    font-size: 0.85rem;
}

.btn-change-password {
    padding: 10px 24px;
    background: #1f6392;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    font-size: 0.9rem;
}

.btn-change-password:hover {
    background: #0e4a6e;
    transform: translateY(-1px);
}

.btn-change-password:active {
    transform: translateY(0);
}

.btn-change-password:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   КНОПКА ЗАВЕРШЕНИЯ СЕССИЙ
   ============================================ */

.btn-revoke-all {
    padding: 8px 18px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    font-size: 0.85rem;
    margin-top: 10px;
}

.btn-revoke-all:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-revoke-all:active {
    transform: translateY(0);
}

/* ============================================
   СПИСКИ (СЕССИИ, ИСТОРИЯ, ЛОГ)
   ============================================ */

.sessions-list,
.login-history,
.activity-log {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 10px;
    padding-right: 4px;
}

/* Стилизация скроллбара */
.sessions-list::-webkit-scrollbar,
.login-history::-webkit-scrollbar,
.activity-log::-webkit-scrollbar {
    width: 4px;
}

.sessions-list::-webkit-scrollbar-track,
.login-history::-webkit-scrollbar-track,
.activity-log::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.sessions-list::-webkit-scrollbar-thumb,
.login-history::-webkit-scrollbar-thumb,
.activity-log::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.sessions-list::-webkit-scrollbar-thumb:hover,
.login-history::-webkit-scrollbar-thumb:hover,
.activity-log::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   ЭЛЕМЕНТЫ СПИСКОВ
   ============================================ */

.session-item,
.history-item,
.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid #eef2f6;
    font-size: 0.85rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.session-item:hover,
.history-item:hover,
.log-item:hover {
    border-color: #dce2ec;
    background: #fafcfd;
}

.session-item.current {
    border-left: 3px solid #10b981;
    background: #f0fdf4;
}

.session-item .device {
    font-weight: 500;
    color: #0f2c3d;
}

.session-item .ip {
    color: #64748b;
    font-size: 0.75rem;
}

.session-item .time {
    color: #94a3b8;
    font-size: 0.7rem;
    line-height: 1.4;
}

.badge-current {
    background: #10b981;
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================
   ИСТОРИЯ ВХОДОВ
   ============================================ */

.history-item .status-success {
    color: #10b981;
    font-weight: 600;
}

.history-item .status-failed {
    color: #ef4444;
    font-weight: 600;
}

/* ============================================
   ЛОГ АКТИВНОСТИ
   ============================================ */

.log-item .action {
    font-weight: 500;
    color: #0f2c3d;
}

.log-item .time {
    color: #94a3b8;
    font-size: 0.7rem;
}

.log-item .badge-action {
    background: #eef2ff;
    color: #1f6392;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}

.log-item .badge-action.info {
    background: #dbeafe;
    color: #1e40af;
}

.log-item .badge-action.warning {
    background: #fef3c7;
    color: #92400e;
}

.log-item .badge-action.danger {
    background: #fee2e2;
    color: #991b1b;
}

.log-item .badge-action.success {
    background: #d1fae5;
    color: #065f46;
}

/* ============================================
   ИНДИКАТОР СЛОЖНОСТИ ПАРОЛЯ
   ============================================ */

.password-strength {
    margin-top: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.password-strength.weak {
    color: #ef4444;
}

.password-strength.medium {
    color: #f59e0b;
}

.password-strength.strong {
    color: #10b981;
}

/* ============================================
   СООБЩЕНИЯ ФОРМЫ
   ============================================ */

.password-message {
    display: none;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.password-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.password-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ============================================
   ЗАГРУЗКА
   ============================================ */

.loading-small {
    color: #94a3b8;
    font-size: 0.85rem;
    padding: 10px;
    text-align: center;
}

/* ============================================
   ПЕРЕКЛЮЧАТЕЛЬ (TOGGLE SWITCH)
   ============================================ */

.security-item .switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.security-item .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.security-item .switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 34px;
}

.security-item .switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.security-item .switch input:checked + .slider {
    background-color: #1f6392;
}

.security-item .switch input:checked + .slider:before {
    transform: translateX(20px);
}

.security-item .switch input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    .security-item {
        padding: 14px 14px;
    }
    
    .security-item-header {
        flex-wrap: wrap;
    }
    
    .security-item-header .switch {
        margin-left: auto;
    }
    
    .security-item-title {
        font-size: 0.9rem;
    }
    
    .security-item-desc {
        font-size: 0.75rem;
    }
    
    .security-item-options {
        padding-left: 0;
        font-size: 0.8rem;
    }
    
    .security-form .form-group input {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .btn-change-password {
        width: 100%;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .btn-revoke-all {
        width: 100%;
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .session-item,
    .history-item,
    .log-item {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .session-item .ip,
    .session-item .time {
        font-size: 0.7rem;
    }
    
    .badge-current {
        font-size: 0.6rem;
        padding: 2px 8px;
    }
    
    .log-item .badge-action {
        font-size: 0.55rem;
        padding: 2px 8px;
    }
}

@media (max-width: 480px) {
    .security-item {
        padding: 12px 10px;
    }
    
    .security-item-title {
        font-size: 0.85rem;
    }
    
    .security-item .switch {
        width: 38px;
        height: 20px;
    }
    
    .security-item .switch .slider:before {
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
    }
    
    .security-item .switch input:checked + .slider:before {
        transform: translateX(18px);
    }
    
    .sessions-list,
    .login-history,
    .activity-log {
        max-height: 180px;
    }
    
    .session-item,
    .history-item,
    .log-item {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

/* ============================================
   ТЕМНАЯ ТЕМА (поддержка)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .security-item {
        background: #1e293b;
        border-color: #334155;
    }
    
    .security-item:hover {
        border-color: #475569;
    }
    
    .security-item-title {
        color: #e2e8f0;
    }
    
    .security-item-desc {
        color: #94a3b8;
    }
    
    .security-item-options label {
        color: #94a3b8;
    }
    
    .security-form .form-group label {
        color: #94a3b8;
    }
    
    .security-form .form-group input {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .security-form .form-group input:focus {
        border-color: #1f6392;
        box-shadow: 0 0 0 3px rgba(31, 99, 146, 0.2);
    }
    
    .security-form .form-group input::placeholder {
        color: #64748b;
    }
    
    .session-item,
    .history-item,
    .log-item {
        background: #0f172a;
        border-color: #334155;
    }
    
    .session-item:hover,
    .history-item:hover,
    .log-item:hover {
        border-color: #475569;
        background: #1e293b;
    }
    
    .session-item.current {
        background: #064e3b;
        border-left-color: #10b981;
    }
    
    .session-item .device {
        color: #e2e8f0;
    }
    
    .session-item .ip {
        color: #94a3b8;
    }
    
    .session-item .time {
        color: #64748b;
    }
    
    .badge-current {
        background: #10b981;
        color: white;
    }
    
    .log-item .action {
        color: #e2e8f0;
    }
    
    .log-item .badge-action {
        background: #1e293b;
        color: #60a5fa;
    }
    
    .log-item .badge-action.info {
        background: #1e3a5f;
        color: #60a5fa;
    }
    
    .log-item .badge-action.warning {
        background: #78350f;
        color: #fbbf24;
    }
    
    .log-item .badge-action.danger {
        background: #7f1d1d;
        color: #f87171;
    }
    
    .log-item .badge-action.success {
        background: #064e3b;
        color: #34d399;
    }
    
    .password-strength.weak {
        color: #f87171;
    }
    
    .password-strength.medium {
        color: #fbbf24;
    }
    
    .password-strength.strong {
        color: #34d399;
    }
    
    .password-message.success {
        background: #064e3b;
        color: #34d399;
        border-color: #065f46;
    }
    
    .password-message.error {
        background: #7f1d1d;
        color: #f87171;
        border-color: #991b1b;
    }
    
    .loading-small {
        color: #64748b;
    }
    
    .btn-change-password {
        background: #1f6392;
    }
    
    .btn-change-password:hover {
        background: #1a5276;
    }
    
    .btn-revoke-all {
        background: #b91c1c;
    }
    
    .btn-revoke-all:hover {
        background: #991b1b;
    }
}