/* Основные стили */
:root {
            --primary: #007bff;
            --secondary: #8338ec;
            --success: #06d6a0;
            --danger: #ef476f;
            --warning: #ffd166;
            --dark: #ffffff;
            --light: #f8f9fa;
        }
body, html {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Убираем прокрутку, если это необходимо */
    background-color: #1b2024;
    touch-action: manipulation;
    /* padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); */
}

.container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.header, .footer {
    flex: 0 0 auto; /* Не растягивается */
}

.content {
    flex: 1 1 auto; /* Растягивается и занимает оставшееся место */
    overflow: auto; /* Прокрутка контента, если необходимо */
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}
.profile-info {

    color: white; /* Цвет текста для обычного состояния */
}

.profile-info span {
    color: #ff6600; /* Цвет текста для специфических элементов, например, статуса пользователя */
}

.section {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #1b2024;
}

#menu {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background-color: #333;
    color: #fff;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
}

#menu button {
    background-color: transparent;
    border: none;
    color: white;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px; /* Уменьшенный размер текста */
    cursor: pointer;
    flex: 1;
    padding: 5px; /* Уменьшенные отступы */
}

#menu button i {
    font-size: 24px; /* Уменьшенный размер иконок */
    margin-bottom: 3px; /* Уменьшенный отступ между иконкой и текстом */
}

#menu button span {
    font-size: 12px; /* Уменьшенный размер текста под иконками */
}

#menu button:hover {
    background-color: #555;
    border-radius: 10px;
}

#events-section-btn {
    background-color: #007bff;
}

#profile-section-btn {
    background-color: #28a745;
}

#events-section-btn:hover,
#profile-section-btn:hover {
    background-color: #555;
}

.event {
    background-color: #f9f9f9;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.event::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background-color: #00ff00;
    border-radius: 5px 5px 0 0;
}


.event h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.event p {
    margin: 5px 0;
    color: #666;
}

.event button {
    background-color: #007bff;
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.event button:hover {
    background-color: #007bff;
}

#profile-section img {
    max-width: 100px;
    border-radius: 50%;
    margin-top: 10px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    justify-content: center;
    align-items: center;
    background-color: #1b2024; /* Современный затемнённый фон */
    backdrop-filter: blur(4px); /* Легкий блюр фона */
    -webkit-backdrop-filter: blur(4px);

}

.modal-content {
    background-color: #1b2024; /* Бежево-белый фон для теплоты */
    margin: 15% auto;
    padding: 24px 30px;
    border-radius: 12px;
    width: 90%;                /* Занимает почти всю ширину, но не всё */
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); /* Глубина и аккуратная тень */
    font-family: 'Segoe UI', sans-serif;
    color: black;
    text-align: center;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
}
.modal-content h2 {
    color: #1b2024;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Кнопка закрытия (X) */
.close-btn,
.close-create-event-btn,
.close-view-participants-btn,
.close-edit-event-btn {
    color: #555;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}
.close-btn:hover,
.close-btn:focus,
.close-create-event-btn:hover,
.close-create-event-btn:focus {
    color: #222;
    text-decoration: none;
}

.close-btn:hover, .close-btn:focus, .close-create-event-btn:hover, .close-create-event-btn:focus, .close-view-participants-btn:hover, .close-view-participants-btn:focus, .close-edit-event-btn:hover, .close-edit-event-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Общие стили для сообщений */
.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 89%; /* Ширина сообщения */
    max-width: 600px; /* Максимальная ширина сообщения */
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 1; /* Начальная непрозрачность */
    transition: opacity 1s ease-in-out; /* Плавное изменение прозрачности */
    animation: fadeOut 20s forwards; /* Анимация исчезновения */
}

/* CSS для анимации прозрачности */
.fade-out {
    animation: fadeOut 20s forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}


/* Стили для кнопки закрытия сообщения */
.close-message-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
}

.close-message-btn:hover {
    color: #000;
}

.user-name {
    font-size: 16px;
    font-weight: bold;
}

.user-ivan {
    color: blue; /* Цвет текста для Ивана Иванова */
}

.gif-icon {
    width: 20px; /* Ширина GIF-иконки */
    height: 20px; /* Высота GIF-иконки */
    margin-left: 10px; /* Отступ слева от имени пользователя */
    vertical-align: middle; /* Выравнивание по середине строки */
}

.message img {
    max-width: 100%; /* Изображение не шире контейнера уведомления */
    height: auto;    /* Сохраняем пропорции изображения */
    display: block;  /* Убираем отступы, которые могут появляться у inline-изображений */
    margin: 10px 0;  /* Добавляем отступы сверху и снизу */
}
.message-image {
    max-width: 100%; /* Ограничиваем ширину */
    height: auto;    /* Сохраняем пропорции */
    display: block;  /* Убираем inline-стили */
    margin: 10px 0;  /* Эстетические отступы */
}

/* Стиль для кнопки "Записаться" */
.register-button {
    background-color: #007bff; /* Синий цвет */
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
}

/* Стиль для кнопки "Отменить запись" */
.unregister-button {
    background-color: #dc3545; /* Красный цвет */
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
}

/* Стиль для отключенной кнопки */
.register-button:disabled,
.unregister-button:disabled{
    background-color: #6c757d; /* Серый цвет */
    cursor: not-allowed;
}

/* Стили для достижений */
/* Стили для сетки достижений */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    padding: 15px;
    position: relative;
}

.achievement-item {
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.achievement-item:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.achievement-tooltip {
    position: absolute;
    display: none;
    width: 100px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transform: translate(-50%, -100%);
    opacity: 0;
    transition: opacity 0.2s ease-out;
    padding: 16px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.achievement-tooltip.visible {
    display: block;
    opacity: 1;
}

.achievement-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: white transparent transparent;
}

.tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

#tooltip-title {
    font-size: 15px;
    color: #222;
    font-weight: 600;
    margin: 0;
}

.tooltip-info-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.tooltip-info-icon:hover {
    background: #007AFF;
    color: white;
}

#tooltip-date {
    font-size: 12px;
    color: #888;
    margin: 0 0 8px 0;
    font-weight: 400;
}

.tooltip-description {
    font-size: 13px;
    color: #444;
    line-height: 1.4;
    display: none;
}

.no-achievements-message {
    grid-column: 1 / -1; /* Занимает все колонки в grid */
    text-align: center;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    color: #666;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
}

.btn:hover {
    background-color: #007bff;
}

.users-list-btn {
    margin: 15px 0;
}

/* Анимации с более высоким приоритетом */
.profile-info.bounce {
    animation: bounce 0.8s infinite ease-in-out !important;
    display: inline-block !important;
}

.profile-info.pulse {
    animation: pulse 1.5s infinite ease-in-out !important;
    display: inline-block !important;
}

.profile-info.rainbow {
    animation: rainbow 3s infinite linear !important;
    display: inline-block !important;
}

.profile-info.shake {
    animation: shake 0.5s infinite ease-in-out !important;
    display: inline-block !important;
}

.profile-info.fade {
    animation: fade 2s infinite ease-in-out !important;
    display: inline-block !important;
}

@keyframes fade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Ключевые кадры */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes rainbow {
    0% { color: red; }
    14% { color: orange; }
    28% { color: yellow; }
    42% { color: green; }
    57% { color: blue; }
    71% { color: indigo; }
    85% { color: violet; }
    100% { color: red; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.product-item {
    border: 2px solid transparent;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f5f5f5;
    text-align: center;
    font-size: 1rem;
}

.product-item.selected {
    border-color: #007bff;
    background-color: #e6f0ff;
    transform: translateY(-2px);
}

.product-item:hover {
    background-color: #eee;
}
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.option-item {
    border: 2px solid #ccc;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
    border-radius: 6px;
}

.option-item.selected {
    border-color: #007bff;
    background-color: #e6f0ff;
}

.profile-header {
    display: flex;
    align-items: center;
}

.style-btn {
    width: 36px;
    height: 36px;
    border: none;
    background-color: #f0f0f0;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.style-btn:hover {
    background-color: #e0e0e0;
}

.color-btn {
    background-image: url('palette.svg'); /* Иконка цвета */
    background-size: 24px;
    background-position: center;
    background-repeat: no-repeat;
}

.animation-btn {
    background-image: url('animation.png'); /* Иконка анимации */
    background-size: 24px;
    background-position: center;
    background-repeat: no-repeat;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}
.close-btn:hover {
    color: #333;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.product-item {
    border: 2px solid transparent;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80px;
    background-color: #f9f9f9;
}

.product-item.selected {
    border-color: #007bff;
    background-color: #e6f0ff;
}

.product-item p {
    margin: 0;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}

.user-balance {
    background: rgba(0, 123, 255, 0.2);
    padding: 0.4rem 0.7rem;
    border-radius: 20px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(0, 123, 255, 0.5);
    margin-left: auto;
}

.user-balance i {
            color: var(--warning);
}

.toast {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #333;
    color: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background-color: limegreen;
}

.toast.error {
    background-color: #dc3545;
}

.hidden {
    display: none !important;
}

.light-theme {
    background-color: #f8f9fa;
    color: #212529;
}

.light-theme .section {
    background-color: #f8f9fa;
}

.light-theme .modal-content {
    background-color: #ffffff;
    color: #212529;
}

.light-theme .modal-content h2 {
    color: #212529;
}

.light-theme .profile-info {
    color: #212529;
}

.light-theme .profile-info span {
    color: #fd7e14;
}

.light-theme .event {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    color: #212529;
}

.light-theme .event h3 {
    color: #212529;
}

.light-theme .event p {
    color: #495057;
}

.light-theme #menu {
    background-color: #f1f3f5;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.05);
}

.light-theme #menu button {
    color: #495057;
}

.light-theme #menu button:hover {
    background-color: #e9ecef;
}

.light-theme .achievement-tooltip {
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.light-theme .achievement-tooltip::after {
    border-color: #ffffff transparent transparent;
}

.light-theme #tooltip-title {
    color: #212529;
}

.light-theme .tooltip-description {
    color: #495057;
}

.light-theme .product-item {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
}

.light-theme .product-item:hover {
    background-color: #f1f3f5;
}

.light-theme .product-item.selected {
    background-color: #e7f5ff;
    border-color: #4dabf7;
}

.light-theme .message {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    color: #212529;
}

.light-theme .close-message-btn {
    color: #868e96;
}

.light-theme .close-message-btn:hover {
    color: #212529;
}

.light-theme .user-balance {
    background: rgba(0, 123, 255, 0.1);
    color: #212529;
    border: 1px solid rgba(0, 123, 255, 0.2);
}

.light-theme .no-achievements-message {
    color: #868e96;
}

.light-theme .option-item {
    border-color: #dee2e6;
    background-color: #ffffff;
}

.light-theme .option-item.selected {
    background-color: #e7f5ff;
    border-color: #4dabf7;
}

.light-theme .style-btn {
    background-color: #e9ecef;
}

.light-theme .style-btn:hover {
    background-color: #dee2e6;
}

.light-theme .close-btn,
.light-theme .close-create-event-btn,
.light-theme .close-view-participants-btn,
.light-theme .close-edit-event-btn {
    color: #868e96;
}

.light-theme .close-btn:hover,
.light-theme .close-create-event-btn:hover,
.light-theme .close-view-participants-btn:hover,
.light-theme .close-edit-event-btn:hover {
    color: #212529;
}

.back-button {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            text-decoration: none;
            color: var(--primary);
            font-size: 0.95rem;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            transition: background-color 0.2s;
            background: rgba(0, 123, 255, 0.1);
            border: 1px solid rgba(0, 123, 255, 0.3);
        }

        .back-button:hover {
            background: rgba(0, 123, 255, 0.2);
        }