/* admin.css */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

#admin-nav button, #main-nav button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    margin-left: 10px;
}


/* Стили для строки деталей в списке пользователей (PC) */
.user-detail-accordion-row td {
    padding: 0; /* Убираем стандартный padding */
    border-bottom: none;
}

.user-detail-panel {
    max-height: 0; /* Изначально скрыто */
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out; /* Плавный переход */
    padding: 0 15px; /* Изначально нет padding */
    background-color: #2b2b2b; /* Более темный фон для выделения */
}

/* Класс 'active' добавляется для раскрытия панели */
.user-detail-accordion-row.active .user-detail-panel {
    max-height: 500px; /* Достаточно большое значение для раскрытия контента */
    padding: 15px;
    border-top: 1px solid #444;
}

/* Стили для содержимого деталей */
.detail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 15px;
}

.action-history-list {
    list-style: none;
    padding-left: 0;
    font-size: 0.9em;
}

.action-history-list li {
    margin-bottom: 4px;
    padding-left: 15px;
    position: relative;
}

.action-history-list li::before {
    content: "•";
    color: var(--primary-color); /* Используйте ваш основной цвет */
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Модальное окно/Панель */
.user-detail-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Затемнение фона */
    z-index: 10000;
    visibility: hidden; /* Изначально скрыто */
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.user-detail-modal.active {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.user-detail-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 80%; /* На мобильном занимает 80% */
    max-width: 400px; /* Максимальная ширина */
    height: 100%;
    background-color: #1e1e1e; /* Цвет панели */
    padding: 20px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    
    /* Анимация: Сдвигаем панель за пределы экрана */
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    overflow-y: auto; /* Для прокрутки контента */
}

.user-detail-modal.active .user-detail-content {
    transform: translateX(0); /* Сдвигаем обратно на экран */
}

/* Кнопка закрытия */
.close-button {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
}

#admin-nav button:hover, #main-nav button:hover {
    background-color: #0056b3;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 18px;
    color: #555;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

.tab-button.active {
    color: #007bff;
    border-bottom: 3px solid #007bff;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    margin-top: 0;
    color: #333;
}

.stat-card p {
    font-size: 2em;
    font-weight: bold;
    color: #007bff;
    margin: 0;
}

.chart-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.image-generator {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: 20px;
}

.image-preview-container {
    position: relative;
    width: 300px;
    height: 400px;
    margin: 20px auto;
    border: 2px dashed #ccc;
    border-radius: 8px;
}

#mannequin-preview, #image-upload-preview, #generated-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Auth forms */
.auth-form {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

.auth-form input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}



#admin-user-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    /* Очень высокий Z-index, чтобы перекрыть все кнопки и навигацию */
    z-index: 10000; 
    background-color: rgba(0, 0, 0, 0.7); /* Затемнение фона */
    visibility: hidden; /* Изначально скрыто */
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

#admin-user-detail-panel.active {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Контент панели (Сам выдвигающийся блок) */
#admin-user-detail-panel .user-detail-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 400px;
    height: 100%;
    background-color: #1e1e1e;
    padding: 20px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    overflow-y: auto; /* Для прокрутки контента, чтобы он не уходил под панель */
    
    /* Анимация: Изначально за экраном */
    transform: translateX(100%); 
    transition: transform 0.3s ease-out;
}

#admin-user-detail-panel.active .user-detail-content {
    /* Выезжает на экран */
    transform: translateX(0); 
}

/* Кнопка закрытия */
.close-button {
    /* ... (оставляем как есть, так как z-index уже высокий) ... */
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001; 
}

.full-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Используем полупрозрачный фон, чтобы "просвечивал" основной фон страницы */
    background-color: rgba(0, 0, 0, 0.8); 
    display: none; /* Изначально скрыт */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Поверх всего контента */
}

.details-content-wrapper {
    background-color: #2a2a2a; 
    padding: 30px;
    border-radius: 8px;
    max-width: 90%; /* Почти на весь экран */
    width: 900px; /* Фиксированная максимальная ширина для читаемости */
    max-height: 90%;
    overflow: hidden; /* Контейнер сам по себе не скроллится */
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
}

.close-overlay-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #333;
    transition: color 0.2s;
}

.close-overlay-btn:hover {
    color: red;
}

.user-info-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.full-activity-log-container {
    max-height: calc(100vh - 200px); /* Высота контейнера лога, зависит от размера модалки */
    overflow-y: auto; /* Вся прокрутка происходит здесь */
    padding-right: 15px; /* Зазор для скроллбара */
}

/* Стили для кнопки "Подробнее" */
.btn-more-details {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    background-color: #0157b3; /* Зеленый цвет */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9em;
}

.btn-more-details:hover {
    background-color: #007bff;
}