/* =======================================================
   СТИЛИ ДЛЯ ЛИЧНОГО КАБИНЕТА (МОДУЛЬ CABINET)
   ======================================================= */

.sax-cabinet-wrapper {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    color: #e8e8e8;
    align-items: flex-start;
}

/* ЛЕВАЯ КОЛОНКА (САЙДБАР) */
.sax-cabinet-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #1a1a1a;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    box-sizing: border-box;
}

.sax-cabinet-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.sax-avatar-small img {
    border-radius: 50%;
    border: 2px solid #f5a623;
    width: 60px;
    height: 60px;
    object-fit: cover;
}

.sax-user-meta strong {
    display: block;
    font-size: 16px;
    color: #fff;
    margin-bottom: 3px;
}

.sax-role-badge {
    font-size: 13px;
    color: #f5a623;
    font-weight: 500;
}

/* МЕНЮ */
.sax-cabinet-menu {
    display: flex;
    flex-direction: column;
}

.sax-cabinet-menu a {
    display: block;
    color: #ccc;
    text-decoration: none;
    padding: 12px 10px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.sax-cabinet-menu a:hover {
    color: #f5a623;
    background: rgba(245, 166, 35, 0.05);
    text-decoration: none;
}

.sax-cabinet-menu a.active {
    color: #111;
    background: linear-gradient(180deg, #ffbb3d 0%, #f5a623 100%);
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(245, 166, 35, 0.2);
}

/* Специальная кнопка "Новая заметка" */
.sax-menu-highlight {
    color: #f5a623 !important;
    font-weight: bold !important;
    border: 1px solid rgba(245, 166, 35, 0.3);
}
.sax-menu-highlight:hover {
    background: rgba(245, 166, 35, 0.1) !important;
}

/* Кнопка Выход */
.sax-menu-logout {
    color: #888 !important;
    margin-top: 20px;
    border-top: 1px solid #333;
    border-radius: 0 !important;
    padding-top: 20px !important;
}
.sax-menu-logout:hover {
    background: transparent !important;
    color: #ff4d4d !important;
}

/* ПРАВАЯ КОЛОНКА (КОНТЕНТ) */
.sax-cabinet-content {
    flex-grow: 1;
    background: #1a1a1a;
    padding: 35px;
    border-radius: 10px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    min-height: 500px;
    box-sizing: border-box;
}

.sax-cabinet-content h2 {
    color: #f5a623;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: normal;
}

.sax-cabinet-content p {
    color: #dcdcdc;
    font-size: 16px;
    line-height: 1.6;
}

/* Приветственный блок (заглушка) */
.sax-bio-preview {
    background: #151515;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    margin-top: 20px;
}

/* СООБЩЕНИЕ ДЛЯ ГОСТЕЙ */
.sax-cabinet-guest {
    text-align: center;
    padding: 50px 20px;
    background: #1a1a1a;
    border-radius: 10px;
    border: 1px solid #333;
    margin: 40px auto;
    max-width: 600px;
}
.sax-cabinet-guest h2 {
    color: #f5a623;
    margin-top: 0;
}


/* =========================================
   ШАПКА ПРОФИЛЯ (УНИКАЛЬНЫЕ КЛАССЫ)
   ========================================= */

/* Контейнер шапки - это flex-сетка */
.sax-cab-profile-header {
    display: flex;
    flex-direction: row;
    gap: 30px; /* Отступ как в основной сетке */
    width: 100%;
    box-sizing: border-box;
    margin-top: 40px; /* Отступ от заголовков сверху */
    margin-bottom: 30px; /* Отступ до основной сетки */
}

/* Левая колонка (Аватар) - СТРОГО 280px, как меню */
.sax-cab-profile-avatar {
    width: 280px;
    flex: 0 0 280px; /* Запрещаем сжиматься */
    background: #1a1a1a;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрируем аватар */
    gap: 15px;
    box-sizing: border-box;
}

.sax-cab-upload-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #f5a623;
    background: #222;
}

.sax-cab-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Правая колонка (Баннер) - занимает оставшееся место */
.sax-cab-profile-banner {
    flex: 1 1 auto;
    background: #1a1a1a;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-sizing: border-box;
}

.sax-cab-banner-preview {
    width: 100%;
    height: 120px;
    background: #222;
    border: 1px dashed #555;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    box-sizing: border-box;
}

/* =========================================
   КНОПКИ ЗАГРУЗКИ (Аккуратные, без растягивания)
   ========================================= */

.sax-cab-file-label input[type="file"] {
    display: none;
}

.sax-cab-upload-actions {
    width: auto !important;
    display: flex;
}

.sax-cab-profile-avatar .sax-cab-upload-actions {
    justify-content: center;
}

.sax-cab-profile-banner .sax-cab-upload-actions {
    justify-content: flex-start;
}

.sax-cab-file-label {
    display: inline-block;
    width: auto !important; 
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #444;
}

.sax-cab-file-label:hover {
    background: #f5a623;
    color: #151515;
    border-color: #f5a623;
}

/* =========================================
   ПОЛЯ ВВОДА И КНОПКА СОХРАНЕНИЯ
   ========================================= */

.sax-profile-form {
    width: 100%;
    margin-top: 20px;
}

.sax-form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.sax-form-row label {
    color: #ccc;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: 'Raleway', sans-serif;
}

.sax-input,
.sax-profile-form input[type="text"],
.sax-profile-form input[type="email"],
.sax-profile-form input[type="password"],
.sax-profile-form textarea {
    width: 100%;
    background-color: #151515;
    border: 1px solid #333;
    color: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    font-family: 'Raleway', sans-serif;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sax-input:focus,
.sax-profile-form input:focus,
.sax-profile-form textarea:focus {
    outline: none;
    border-color: #f5a623;
    box-shadow: 0 0 5px rgba(245, 166, 35, 0.3);
}

.sax-profile-form textarea {
    resize: vertical;
    min-height: 120px;
}

.sax-btn-submit {
    background: linear-gradient(180deg, #ffbb3d 0%, #f5a623 100%);
    color: #151515;
    font-weight: 700;
    font-size: 16px;
    padding: 14px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 0 #b87210;
    transition: transform 0.1s, box-shadow 0.1s;
    font-family: 'Raleway', sans-serif;
    display: inline-block;
}

.sax-btn-submit:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #b87210;
}

/* =======================================================
   АДАПТИВ ДЛЯ МОБИЛЬНЫХ (В СТОЛБИК)
   ======================================================= */
@media (max-width: 800px) {
    .sax-cabinet-wrapper {
        flex-direction: column;
        gap: 20px;
        margin-top: 15px;
    }
    
    .sax-cabinet-sidebar {
        width: 100%;
        padding: 20px;
    }
    
    .sax-cabinet-content {
        padding: 20px;
        min-height: auto;
    }
    
    .sax-cabinet-content h2 {
        font-size: 24px;
    }
    
    /* Шапка встает в столбик */
    .sax-cab-profile-header {
        flex-direction: column;
    }
    
    .sax-cab-profile-avatar {
        width: 100%;
        flex: 1 1 auto;
    }
}

/* =======================================================
   ИНДИКАТОР СОХРАНЕНИЯ (ОВЕРЛЕЙ) — v1.5.5
   ======================================================= */

#sax-saving-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(21, 21, 21, 0.85);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    font-family: 'Raleway', sans-serif;
}

#sax-saving-overlay.is-visible {
    opacity: 1;
}

#sax-saving-overlay .sax-saving-box {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 40px 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 90%;
    text-align: center;
}

#sax-saving-overlay .sax-saving-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #333;
    border-top-color: #f5a623;
    border-radius: 50%;
    animation: sax-spin 0.9s linear infinite;
    box-sizing: border-box;
}

#sax-saving-overlay .sax-saving-text {
    color: #f5a623;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

@keyframes sax-spin {
    to { transform: rotate(360deg); }
}

/* =======================================================
   ТОСТ-УВЕДОМЛЕНИЯ — v1.5.6 (по центру экрана)
   ======================================================= */

.sax-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #f5a623;
    border-left: 5px solid #f5a623;
    border-radius: 8px;
    padding: 18px 28px;
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.sax-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
}

@media (max-width: 800px) {
    .sax-toast {
        padding: 14px 18px;
        font-size: 14px;
    }
}