/* Общие стили */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    color: #333;
}

/* Переменные для админ-панели */
:root {
    --secondary-bg-color: #ffffff;
    --text-color: #333;
    --border-color: #e0e0e0;
    --button-bg-color: #007bff;
    --button-text-color: #ffffff;
    --chat-bg-color: #f8f9fa;
}

/* Карточка авторизации/регистрации */
.auth-card {
    max-width: 500px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* OAuth кнопка (Яндекс) */
.auth-oauth {
    margin-bottom: 20px;
    text-align: center;
}

.btn-yandex {
    display: inline-block;
    color: #333!important;
    text-decoration: none!important;
    font-weight: 500!important;
    transition: background 0.3s;
    font-size: 16px!important;
    line-height: 15px!important;
    padding: 10px!important;
    border-radius: 20px!important;
    background: #f8604a!important;
    color: #fff!important;
    height: 40px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 4000;
    display: none;
    max-width: 300px;
}

.notification.show {
    display: block !important;
}

.notification .close-btn {
    margin-left: 10px;
    cursor: pointer;
    font-weight: bold;
}

/* Гарантия видимости user-section */
.user-section {
    display: flex !important;
    align-items: center !important;
    min-height: 50px !important;
    padding: 10px !important;
    z-index: 14000 !important; /* Увеличенный z-index для родительского элемента */
    position: relative !important;
}

.user-info {
    align-items: center !important;
    gap: 10px !important;
    position: relative !important;
    cursor: pointer !important;
}

header {
    border-bottom: 1px solid #cecece;
    position: relative;
    z-index: 13000; /* Увеличенный z-index для header */
}

/* Форма авторизации/регистрации */
.auth-form {
    max-width: 100%;
}

.auth-form .form-group {
    margin-bottom: 15px;
}

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

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
}

.auth-form .input-group {
    display: flex;
    gap: 10px;
}

.auth-form .input-group input {
    flex: 1;
}

.auth-form .btn-secondary {
    background: #6c757d;
}

.auth-form .btn-secondary:hover {
    background: #5a6268;
}

.auth-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.auth-form button[type="submit"]:hover {
    background: #0056b3;
}

/* Ссылка под формой */
.auth-link {
    text-align: center;
    margin-top: 15px;
}

.auth-link a {
    color: #007bff;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Вкладки */
.tabs {
    margin-bottom: 20px;
}

.tab-list {
    display: flex;
    list-style: none;
    padding: 0;
    border-bottom: 1px solid #e0e0e0;
}

.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
}

.tab-item.active {
    border-bottom: 2px solid #007bff;
    color: #007bff;
}

.tab-content {
    display: none;
}

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

/* Шапка */
header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.to-site-btn, .logout-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
}

.to-site-btn:hover, .logout-btn:hover {
    background: #0056b3;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Контейнер для бокового меню */
.page-wrapper .sidebar-container {
    display: flex !important;
    min-height: calc(100vh - 120px);
}

.page-wrapper .sidebar-container .sidebar {
    width: 250px !important;
    background: #ffffff !important;
    border-right: 1px solid #e0e0e0 !important;
    padding: 20px !important;
    display: block !important;
}

.page-wrapper .sidebar-container .sidebar h2 {
    margin: 0 0 20px;
    font-size: 1.5rem;
}

.page-wrapper .sidebar-container .sidebar nav ul {
    list-style: none;
    padding: 0;
}

.page-wrapper .sidebar-container .sidebar nav ul li.menu-item {
    margin-bottom: 10px;
}

.page-wrapper .sidebar-container .sidebar nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    display: block;
    padding: 10px;
    border-radius: 5px;
}

.page-wrapper .sidebar-container .sidebar nav ul li a:hover {
    background: #f0f0f0;
}

.page-wrapper .sidebar-container .mobile-menu-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 10px;
}

.page-wrapper .sidebar-container .content {
    flex: 1;
    padding: 10px;
    background: #f5f5f5;
}

/* Формы в профиле */
.profile-form {
    max-width: 400px;
    margin-bottom: 20px;
}

.profile-form label {
    display: block;
    margin-bottom: 5px;
}

.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="password"],
.profile-form input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.profile-form button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.profile-form button:hover {
    background: #0056b3;
}

.avatar-preview {
    margin-bottom: 10px;
}

.avatar-preview img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}

/* Стили для списка врачей в кабинете */
#doctors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

.doctor-controls {
    margin-bottom: 20px;
}

.doctor-controls button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
}

.doctor-controls button:hover {
    background: #0056b3;
}

.doctor-item {
    width: 250px;
    display: flex;
    align-items: center;
    padding: 10px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.doctor-visibility {
    margin-right: 10px;
    position: relative;
}

/* Стили для тумблера */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #28a745;
}

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

.doctor-name {
    flex: 1;
}

.doctor-info .info-icon {
    cursor: pointer;
    color: #007bff;
}

/* Стили для запросов */
.request-row {
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.request-header {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.request-details {
    padding: 10px;
    border-top: 1px solid #e0e0e0;
}

.favorite-btn, .remove-favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
}

.favorite-btn.active {
    color: #dc3545;
}

.remove-favorite-btn {
    color: #dc3545;
}

/* Стили из предыдущей версии */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

h1 {
    margin: 0;
    font-size: 26px!important;
}
h2 {
    margin: 0;
    font-size: 24px!important;
}

h3 {
    margin: 0;
    font-size: 22px!important;
}

.header-container h1 a {
    text-decoration: none;
    color: #007bff;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #007bff;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.header-container .user-section .login-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s;
}

.header-container .user-section .login-btn:hover {
    background: #0056b3;
}

.header-container .user-section .user-info {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    position: relative !important;
    cursor: pointer !important;
}

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

.header-container .user-section .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-container .user-section .dropdown-menu.active {
    display: block !important;
    z-index: 15000 !important; /* Увеличенный z-index, чтобы соответствовать sidebar_base.html */
}

.header-container .user-section .dropdown-menu .dropdown-item {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.header-container .user-section .dropdown-menu .dropdown-item:hover {
    background: #f0f0f0;
}

/* Баннер */
.banner-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
}

.banner {
    background: url("/static/img/banfon.jpg") no-repeat center center;
    background-size: cover;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.banner-content {
    text-align: center;
}

.banner-content img {
    max-width: 100%;
    height: auto;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Список докторов */
.doctors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

.doctor-card {
    width: 200px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.doctor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.doctor-image {
    width: 200px;
    height: 200px;
    border-radius: 10px 10px 0 0;
    object-fit: cover;
}

.doctor-card h3 {
    margin: 0 0 15px;
    font-size: 1.2rem;
    color: #333;
}

.doctor-card .btn {
    display: inline-block;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 0 0 10px 10px;
    font-weight: 500;
    transition: background 0.3s;
    width: 100%;
}

.doctor-card .btn:hover {
    background: #0056b3;
    color: white;
}

.doctors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.doctor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}


.doctor-card h2 {
    font-size: 18px !important;
    color: #333;
    font-weight: 500;
    height: 50px;
    display: flex;
    align-items: center;
    margin: 0px!important;
}

#doctor-filter {
    transition: all 0.2s ease;
    margin: 10px 0 20px 0;
    border-radius: 10px;
    width: 270px;
    padding: 5px;
    border: 1px solid #cecece;
}
#doctor-filter:focus {
    border: 1px solid #007bff!important;
}

/* Адаптация таблицы под мобильные устройства */
@media screen and (max-width: 768px) {
.doctor-card {
    width: 160px;
}
.container {
    padding: 10px;
}
    }

/* Чат */
.chat-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.menu-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s;
}

.menu-btn:hover {
    background: #0056b3;
}

.doctor-title {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.chat-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.quick-btn {
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
    text-align: left;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-btn:hover {
    background: #0056b3;
}

.chat-container {
    border: 1px solid #e0e0e0;
    background: #ffffff;
    padding: 15px;
    height: 400px;
    overflow-y: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.chat-message {
    margin: 10px 0;
    padding: 12px;
    border-radius: 8px;
    max-width: 70%;
}

.chat-message.user {
    background: #e6f3ff;
    margin-left: auto;
    margin-right: 10px;
}

.chat-message.assistant {
    background: #f0f0f0;
    margin-right: auto;
    margin-left: 10px;
}

.chat-message.thinking .message-content {
    font-size: 1.2rem;
    color: #007bff;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.chat-message p {
    margin: 0;
}

.chat-message .timestamp {
    font-size: 0.8rem;
    color: #666;
    display: block;
    margin-top: 5px;
}

.chat-message .bold {
    font-weight: 700;
}

.chat-message .italic {
    font-style: italic;
}

.chat-input {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.chat-input textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    resize: none;
    font-family: 'Roboto', sans-serif;
}

.chat-input button {
    padding: 12px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.chat-input button:hover {
    background: #0056b3;
}

.doctor-description {
    margin-top: 20px;
}

/* Футер */
footer {
    background: #ffffff;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    margin-top: 40px;
}

.footer-container a {
    color: #007bff;
    text-decoration: none;
    margin-left: 10px;
}

.footer-container a:hover {
    text-decoration: underline;
}

/* Стили для уведомлений */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.notification.show {
    opacity: 1;
}

.notification.success {
    background-color: #28a745; /* Зелёный фон для позитивных сообщений */
}

.notification.error {
    background-color: #dc3545; /* Красный фон для ошибок */
}

/* Адаптивность */
@media (max-width: 768px) {
    h1 {
    margin: 0;
    font-size: 22px!important;
    }
    h2 {
        margin: 0;
        font-size: 20px!important;
    }
    
    h3 {
        margin: 0;
        font-size: 18px!important;
    }
    .auth-card {
        margin: 20px auto;
        padding: 20px;
    }
    .h1, h1 {
        font-size: 1.5rem;
    }
    .auth-form .input-group {
        flex-direction: column;
    }

    .auth-form .input-group input,
    .auth-form .input-group button {
        width: 100%;
    }
    
    .footer-container {
        float: left;
    }

    footer {
        text-align: left;
    }

    .tab-list {
        flex-direction: column;
        border-bottom: none;
    }

    .tab-item {
        padding: 10px;
        border-bottom: 1px solid #e0e0e0;
    }

    .tab-item.active {
        border-bottom: 2px solid #007bff;
    }

    .page-wrapper .sidebar-container {
        flex-direction: column;
    }

    .page-wrapper .sidebar-container .sidebar {
        width: 100% !important;
        display: none !important;
    }

    .page-wrapper .sidebar-container .sidebar.active {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 5000;
    }

    .page-wrapper .sidebar-container .mobile-menu-toggle,
    .page-wrapper .sidebar-container .mobile-menu-close {
        display: block !important;
    }

    .header-container {
        flex-wrap: wrap;
    }

    .doctors-list {
        justify-content: center;
    }

    #doctors-list {
        justify-content: center;
    }

    .chat-nav {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .doctor-image {
        margin: 0;
    }

    .quick-actions {
        width: 100%;
    }
    
    .quick-btn {
        white-space: normal;
        word-wrap: break-word;
    }


    .chat-message.user,
    .chat-message.assistant {
        max-width: 85%;
    }

    .header-container .user-section .dropdown-menu {
        right: -10px;
        z-index: 15000 !important; /* Увеличенный z-index для мобильной версии */
    }
    .header-container {
    flex-direction: column;
    }

    .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .auth-card {
        padding: 15px;
    }

    .auth-form button[type="submit"] {
        padding: 10px;
    }

    .btn-yandex {
        padding: 8px 16px;
    }

    .doctor-card {
        width: 100%;
        max-width: 250px;
    }

    .doctor-item {
        width: 100%;
        max-width: 250px;
    }

    .doctor-image {
        width: 100%;
        height: 100%;
    }

    .btn {
        padding: 8px 16px;
    }


    .header-container .user-section .user-info {
        gap: 5px;
    }

    .header-container .user-section .user-avatar {
        width: 24px;
        height: 24px;
    }

    .header-container .user-section .user-name {
        font-size: 0.9rem;
    }
}

.social a {
    text-align: center;
    width: 38px;
    height: 38px;
    float: left;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15), inset 0 0 50px rgba(0,0,0,0.1);
    border-radius: 24px;
    margin: 0 10px 10px 0;
    padding: 6px;
    color: #000;
}
.social .fa-2x {
    font-size: 22px;
}
.vk a:hover {background: #5d84ae; color: #fff;}
.odnoklassniki a:hover {background: #f93; color: #fff;}
.telegram a:hover {background: #249bd7; color: #fff;}