/* notes/static/css/style.css */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: #1e1e1e;
    padding: 15px 0;
    border-bottom: 1px solid #333;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #bb86fc;
}

a {
    color: inherit;
    text-decoration: none;
}

.btn-small {
    background: #333;
    padding: 5px 10px;
    border-radius: 4px;
    margin-left: 10px;
    font-size: 14px;
}

/* Grid для карточек */
.notes-grid {
    display: grid;
    /* Создает колонки, которые заполняют все место, мин. ширина 280px */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Карточка */
.card {
    background-color: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, border-color 0.2s;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Растягиваем карточку внутри ссылки */
    box-sizing: border-box;
}


.card:hover {
    transform: translateY(-5px);
    border-color: #bb86fc;
}

/* Статусы (цветной бордюр слева) */
.card.status-plan {
    border-left: 4px solid #f39c12;
}

.card.status-process {
    border-left: 4px solid #3498db;
}

.card.status-done {
    border-left: 4px solid #2ecc71;
    text-decoration: line-through;
    opacity: 0.7;
}

.card h2 {
    margin: 10px 0;
    font-size: 1.2rem;
}

.desc {
    flex-grow: 1;
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #777;
    margin-top: auto;
}

/* Бейджи */
.badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.badge.category {
    background: #3700b3;
    color: white;
}

.badge.public {
    background: #03dac6;
    color: black;
}

.badge.private {
    background: #cf6679;
    color: black;
}

/* Кнопка добавления на главной */
.actions {
    margin-bottom: 20px;
}

.btn-add {
    display: inline-block;
    background: #bb86fc;
    color: #000;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    text-align: center;
}

.btn-add:hover {
    background: #995dd8;
}

/* Форма добавления */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: #1e1e1e;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #bb86fc;
    font-size: 0.9rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px;
    background: #2c2c2c;
    border: 1px solid #444;
    color: white;
    border-radius: 6px;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #bb86fc;
}

.form-group-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group-row div {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #bb86fc;
}

.btn-save {
    background: #03dac6;
    color: black;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
}

.btn-cancel {
    margin-left: 15px;
    color: #aaa;
    font-size: 0.9rem;
}

/* Фильтры */
.filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    /* Чтобы на телефоне переносилось */
    gap: 15px;
}

.divider {
    border: 0;
    border-top: 1px solid #333;
    margin-bottom: 25px;
}

/* Табы (Кнопки) */
.tabs {
    background: #1e1e1e;
    padding: 5px;
    border-radius: 8px;
    display: inline-flex;
    border: 1px solid #333;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 6px;
    color: #aaa;
    transition: 0.3s;
    font-size: 0.9rem;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: #bb86fc;
    color: #000;
    font-weight: bold;
}

/* Категории (Текст справа) */
.categories-list {
    display: flex;
    gap: 15px;
}

.cat-link {
    color: #777;
    font-size: 0.9rem;
    position: relative;
    padding-bottom: 2px;
}

.cat-link:hover {
    color: #fff;
}

.cat-link.active {
    color: #03dac6;
    border-bottom: 2px solid #03dac6;
}

/* Детальная страница */
.detail-container {
    max-width: 800px;
    margin: 0 auto;
    background: #1e1e1e;
    padding: 30px;
    border-radius: 12px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.meta-info {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}

.full-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ddd;
    margin-bottom: 30px;
    white-space: pre-wrap;
}

/* Комментарии (Чат-стайл) */
.comments-list {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment {
    background: #2c2c2c;
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 80%;
    align-self: flex-start;
    /* Чужие слева */
}

.comment.my-comment {
    background: #3700b3;
    align-self: flex-end;
    /* Мои справа */
    text-align: right;
}

.comment-author {
    font-size: 0.75rem;
    color: #bb86fc;
    font-weight: bold;
    margin-bottom: 4px;
}

.my-comment .comment-author {
    color: #03dac6;
}

.comment-date {
    font-size: 0.7rem;
    color: #888;
    margin-top: 5px;
    text-align: right;
}

/* Форма комментария */
.comment-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-send {
    background: #bb86fc;
    border: none;
    padding: 0 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    /* Растягиваем ссылку на всю высоту ячейки сетки */
}

/* --- Стильная Авторизация и Регистрация --- */

/* Обертка на весь экран для центрирования */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    /* Почти на всю высоту окна */
}

/* Карточка входа */
.auth-card {
    background: #1e1e1e;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    /* Чтобы не растягивалась слишком сильно */
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    /* Красивая тень */
    border: 1px solid #333;
    text-align: center;
}

.auth-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #bb86fc;
    /* Фиолетовый акцент */
}

/* Стилизация полей ввода внутри карточки */
.auth-card p {
    margin-bottom: 15px;
    text-align: left;
    /* Подписи полей слева */
    color: #bbb;
    font-size: 0.9rem;
}

.auth-card label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Магия: обращаемся ко всем инпутам внутри карточки */
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
    width: 100%;
    padding: 12px;
    background: #2c2c2c;
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
    /* Чтобы padding не ломал ширину */
    transition: 0.3s;
}

.auth-card input:focus {
    outline: none;
    border-color: #bb86fc;
    background: #333;
}

/* Текст подсказок Django (например "Пароль должен быть...") */
.helptext {
    display: block;
    font-size: 0.75rem;
    color: #777;
    margin-top: 4px;
}

/* Список ошибок (если пароль неверный) */
.errorlist {
    color: #cf6679;
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    text-align: left;
}

/* Кнопка на всю ширину */
.btn-block {
    width: 100%;
    display: block;
    margin-top: 20px;
    padding: 12px;
    font-size: 1.1rem;
    background: #bb86fc;
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-block:hover {
    background: #995dd8;
}

/* Ссылка внизу */
.auth-footer {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #888;
}

.auth-footer a {
    color: #03dac6;
    font-weight: bold;
}

/* Стили для списка требований к паролю */
.auth-card ul {
    text-align: left;
    padding-left: 20px;
    margin: 10px 0;
    color: #bbb;
    font-size: 0.85rem;
}

.auth-card ul li {
    margin-bottom: 5px;
}

/* Убираем стандартные маркеры списка и делаем свои (опционально) */
.helptext {
    color: #888;
    font-size: 0.8rem;
    display: block;
    margin-top: 5px;
    text-align: left;
}

/* --- РУЛЕТКА --- */

/* Кнопка "Мне повезет" */
.btn-roulette {
    background: linear-gradient(45deg, #ff00cc, #333399);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px;
    font-size: 1rem;
    transition: transform 0.2s;
}
.btn-roulette:hover { transform: scale(1.05); }

/* Фон модального окна */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* Скрыто */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px); /* Размытие фона */
}

/* Само окно */
.modal-content {
    background: #1e1e1e;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    border: 2px solid #bb86fc;
    box-shadow: 0 0 30px rgba(187, 134, 252, 0.3);
    min-width: 300px;
    animation: popIn 0.3s ease;
}

/* Анимация появления */
@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Кнопка "Открыть" в окне */
.btn-go {
    margin-top: 20px;
    background: #03dac6;
    color: black;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
}

/* Крутилка (Loader) */
.loader {
    border: 4px solid #333;
    border-top: 4px solid #bb86fc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
