/**
 * Основные стили для панели администратора
 */

/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.admin-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* Основной контейнер */
.admin-container {
    display: flex;
    height: 100vh;
    overflow: clip;
}

/* Стили для свернутой боковой панели */
.sidebar-collapsed .admin-sidebar {
    width: 60px;
}

.sidebar-collapsed .admin-logo span,
.sidebar-collapsed .admin-nav a span,
.sidebar-collapsed .btn-return-site span {
    display: none;
}

.sidebar-collapsed .admin-content {
    margin-left: 60px;
}

@media (max-width: 992px) {
    .sidebar-collapsed .admin-sidebar {
        transform: translateX(-100%);
    }
}

/* Боковая панель */
.admin-sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 100;
}

.admin-sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-logo {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-weight: 500;
    overflow: hidden;
}

.admin-logo img {
    margin-right: 10px;
    flex-shrink: 0;
}

.admin-sidebar.collapsed .admin-logo span {
    display: none;
}

.toggle-sidebar-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.toggle-sidebar-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.toggle-sidebar-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: currentColor;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-sidebar-btn span::before,
.toggle-sidebar-btn span::after {
    content: '';
    width: 18px;
    height: 2px;
    background-color: currentColor;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.toggle-sidebar-btn span::before {
    top: -5px;
}

.toggle-sidebar-btn span::after {
    bottom: -5px;
}

.admin-nav {
    flex: 1;
    padding: 15px 0;
}

.admin-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.admin-nav li {
    margin-bottom: 5px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.admin-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-nav li.active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left-color: #3498db;
}

.admin-nav a svg {
    margin-right: 10px;
    flex-shrink: 0;
}

.admin-sidebar.collapsed .admin-nav a span {
    display: none;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-return-site {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-return-site:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-return-site svg {
    margin-right: 10px;
}

.admin-sidebar.collapsed .btn-return-site span {
    display: none;
}

/* Основное содержимое */
.admin-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background-color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.admin-header-title h1 {
    font-size: 1.5rem;
    margin: 0;
    color: #2c3e50;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Переключатель языков */
.admin-language-selector {
    position: relative;
}

/* Отображение user-dropdown при активном состоянии */
.admin-user-menu.active .user-dropdown {
    display: block;
}

/* Отображение language-dropdown при активном состоянии */
.admin-language-selector.active .language-dropdown {
    display: block;
}

.language-selector-toggle {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector-toggle:hover {
    background-color: #f8f9fa;
}

.language-selector-toggle img {
    margin-right: 8px;
}

.language-dropdown.show {
    display: block;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    min-width: 200px;
    display: none;
    z-index: 1000;
    margin-top: 4px;
}

.language-dropdown a {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.language-dropdown a:hover {
    background-color: #f8f9fa;
}

.language-dropdown a.active {
    background-color: #e9ecef;
    font-weight: 500;
}

.language-dropdown a img {
    margin-right: 8px;
}

/* Меню пользователя */
.admin-user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-info:hover {
    background-color: #f8f9fa;
}

.user-name {
    margin-right: 10px;
    font-weight: 500;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    min-width: 150px;
    display: none;
    z-index: 1000;
}

.user-dropdown a {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.user-dropdown a:hover {
    background-color: #f8f9fa;
}

/* Основной контейнер контента */
.admin-content-wrapper {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Стили для страницы курсов */
.courses-section {
    padding: 20px;
}

.admin-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.admin-card-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

.admin-card-actions {
    display: flex;
    gap: 10px;
}

.admin-search-form {
    padding: 15px 20px;
}

.admin-search-input {
    display: flex;
    gap: 10px;
}

.admin-search-input .admin-form-control {
    flex-grow: 1;
}

.admin-search-input .admin-btn {
    min-width: 100px;
}

/* Таблица */
.admin-table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #555;
}

.admin-table tbody tr {
    transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Статусы */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.active {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.status-badge.inactive {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Действия в таблице */
.admin-table-actions {
    display: flex;
    gap: 5px;
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.action-icon.goto {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.action-icon.goto:hover {
    background-color: #3498db;
    color: white;
}

.action-icon.edit {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.action-icon.edit:hover {
    background-color: #3498db;
    color: white;
}

.action-icon.view {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.action-icon.view:hover {
    background-color: #6c757d;
    color: white;
}

.action-icon.delete {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.action-icon.delete:hover {
    background-color: #e74c3c;
    color: white;
}

/* Пагинация */
.admin-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.pagination {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination .page-item {
    margin: 0 2px;
}

.pagination .page-link {
    color: #007bff;
    background-color: white;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Модальное окно */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.admin-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.admin-modal {
    background-color: white;
    border-radius: 5px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.admin-modal-overlay.active .admin-modal {
    transform: translateY(0);
}

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.admin-modal-title {
    font-size: 1.2rem;
    font-weight: 500;
}

.admin-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
    transition: all 0.3s ease;
}

.admin-modal-close:hover {
    color: #e74c3c;
}

.admin-modal-body {
    padding: 20px;
}

.admin-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Формы */
.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.admin-form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.admin-form-control:focus {
    outline: none;
    border-color: #73a3de;
    box-shadow: 0 0 0 3px rgba(115, 163, 222, 0.2);
}

.admin-form-text {
    margin-top: 5px;
    font-size: 0.85rem;
    color: #777;
}

.admin-form-check {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.admin-form-check input[type="checkbox"] {
    margin-right: 10px;
}

/* Кнопки */
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    color: #333;
}

.admin-btn:hover {
    background-color: #e9ecef;
}

.admin-btn-primary {
    background-color: #007bff;
    color: white;
}

.admin-btn-primary:hover {
    background-color: #0069d9;
}

.admin-btn-success {
    background-color: #28a745;
    color: white;
}

.admin-btn-success:hover {
    background-color: #218838;
}

.admin-btn-danger {
    background-color: #dc3545;
    color: white;
}

.admin-btn-danger:hover {
    background-color: #c82333;
}

.admin-btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.admin-btn-warning:hover {
    background-color: #e0a800;
}

.admin-btn-outline {
    background-color: transparent;
    border: 1px solid #dee2e6;
}

.admin-btn-outline:hover {
    background-color: #f8f9fa;
}

.admin-btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

/* Уведомления */
.admin-notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 350px;
}

.admin-notification {
    display: flex;
    align-items: flex-start;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 12px 15px;
    animation: slideIn 0.3s ease-in-out;
    transition: all 0.3s ease;
}

.admin-notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

.admin-notification .notification-icon {
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-notification .notification-content {
    flex: 1;
    padding-right: 10px;
}

.admin-notification .notification-close {
    background: transparent;
    border: none;
    color: #777;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.admin-notification .notification-close:hover {
    color: #333;
}

.admin-notification.success {
    border-left: 3px solid #28a745;
}

.admin-notification.success .notification-icon {
    color: #28a745;
}

.admin-notification.error {
    border-left: 3px solid #dc3545;
}

.admin-notification.error .notification-icon {
    color: #dc3545;
}

.admin-notification.warning {
    border-left: 3px solid #ffc107;
}

.admin-notification.warning .notification-icon {
    color: #ffc107;
}

.admin-notification.info {
    border-left: 3px solid #17a2b8;
}

.admin-notification.info .notification-icon {
    color: #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Мобильная кнопка возврата на сайт */
.mobile-return-site {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 900;
}

/* Адаптивность */
@media (max-width: 992px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-sidebar.collapsed {
        transform: translateX(-100%);
    }

    .admin-content {
        margin-left: 0;
    }

    .mobile-return-site {
        display: flex;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-header-title h1 {
        margin-bottom: 10px;
    }

    .admin-header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .admin-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .admin-card-actions {
        width: 100%;
    }

    .admin-search-input {
        flex-direction: column;
    }

    .admin-pagination {
        flex-direction: column;
        gap: 10px;
    }

    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3),
    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4),
    .admin-table th:nth-child(5),
    .admin-table td:nth-child(5) {
        display: none;
    }

    .action-icon {
        width: 40px;
        height: 40px;
    }
}
