/* Стили для админ панели */

/* Страница авторизации */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-color) 100%);
    padding: 20px;
}

.login-container {
    background: var(--light-color);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: 600;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(138, 90, 68, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.login-info {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--secondary-color);
    border-radius: 8px;
    font-size: 0.9rem;
}

.login-info code {
    background: var(--light-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Основная админ панель */
.admin-panel {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    background: #f8f9fa;
}

/* Навигация */
.admin-nav {
    background: var(--dark-color);
    color: var(--light-color);
    padding: 0;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.1);
}

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

.nav-header h2 {
    color: var(--light-color);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--light-color);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-menu li {
    padding: 0.8rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.95rem;
}

.nav-menu li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--light-color);
}

.nav-menu li.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-color);
    border-left: 4px solid var(--primary-color);
}

/* Основной контент */
.admin-content {
    padding: 2rem;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.content-header h1 {
    color: var(--dark-color);
    font-size: 1.8rem;
}

.last-update {
    color: var(--text-light);
    font-size: 0.9rem;
}

.last-update span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Вкладки */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tab-header h2 {
    color: var(--dark-color);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-actions {
    display: flex;
    gap: 0.5rem;
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

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

/* Формы */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(138, 90, 68, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Расписание */
.schedule-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.week-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-week {
    background: var(--secondary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--dark-color);
    transition: var(--transition);
}

.btn-week:hover {
    background: var(--primary-color);
    color: white;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-select {
    flex: 1;
    max-width: 200px;
}

.schedule-grid {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.schedule-day {
    border-bottom: 1px solid #eee;
}

.schedule-day:last-child {
    border-bottom: none;
}

.day-header {
    background: var(--secondary-color);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-schedule {
    padding: 1rem 1.5rem;
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    border-radius: 6px;
    background: #f8f9fa;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.schedule-item:hover {
    background: #e9ecef;
}

.schedule-master {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.schedule-time {
    color: var(--text-light);
    font-size: 0.9rem;
}

.schedule-actions {
    display: flex;
    gap: 0.5rem;
}

.schedule-actions button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.schedule-actions button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--dark-color);
}

/* Списки */
.services-list,
.ai-questions-list,
.masters-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.service-item,
.ai-item,
.master-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.service-item:hover,
.ai-item:hover,
.master-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.item-title {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.item-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.item-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.item-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.item-actions button {
    background: none;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.item-actions button:hover {
    background: #f8f9fa;
}

.item-actions .edit-btn {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.item-actions .edit-btn:hover {
    background: var(--primary-color);
    color: white;
}

.item-actions .delete-btn {
    color: #dc3545;
    border-color: #dc3545;
}

.item-actions .delete-btn:hover {
    background: #dc3545;
    color: white;
}

/* Статистика ИИ */
.ai-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin: 0.5rem 0;
}

.stat-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Тестирование ИИ */
.ai-test {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.test-chat {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.test-messages {
    height: 200px;
    padding: 1rem;
    overflow-y: auto;
    background: #f8f9fa;
}

.test-message {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    max-width: 80%;
}

.test-message.bot {
    background: white;
    border: 1px solid #e9ecef;
    margin-right: auto;
}

.test-message.user {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
}

.test-input {
    display: flex;
    padding: 1rem;
    background: white;
    border-top: 1px solid #e9ecef;
}

.test-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.test-input button {
    margin-left: 0.5rem;
    padding: 0 1rem;
}

/* Настройки */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.settings-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.settings-card h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.working-hours .hour-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #f0f0f0;
}

.working-hours label {
    min-width: 120px;
    color: var(--text-color);
    font-size: 0.9rem;
}

.working-hours input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.backup-controls {
    display: grid;
    gap: 1rem;
}

/* Формы редактирования */
.schedule-form,
.service-form,
.ai-form,
.master-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: 2rem;
    animation: slideUp 0.3s ease;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 1024px) {
    .admin-panel {
        grid-template-columns: 1fr;
    }
    
    .admin-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .schedule-controls {
        flex-direction: column;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .filter-select {
        max-width: none;
    }
    
    .item-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .item-actions {
        align-self: flex-start;
    }
    
    .tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .tab-actions {
        align-self: flex-start;
    }
}

@media (max-width: 576px) {
    .login-container {
        padding: 2rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-stats {
        grid-template-columns: 1fr;
    }
}