/* ======== Глобальные правки ======== */

/* Уменьшаем общий размер шрифта */
body {
    font-size: 14px;
    line-height: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background-color: #00000000;
}

.container, .container-fluid, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
    width: 90%;
    padding-right: calc(var(--bs-gutter-x) * .5);
    padding-left: calc(var(--bs-gutter-x) * .5);
    margin-right: auto;
    margin-left: auto;
  background-color: #00000000;
  }

/* Navbar */
.navbar-custom {
    background-color: #1f2d3d; /* фон */
 }
.navbar-custom .navbar-brand,
.navbar-custom .nav-link,
.navbar-custom .btn {
    color: #ffffff; 
    background-color: transparent !important; 
}
.navbar-custom .nav-link:hover,
.navbar-custom .btn:hover {
    color: #ffcc00; /* подсветка при наведении */
}

/* Заголовки */
.note-header {
    color: #5582d4 !important; 
    font-weight: 500;  
}
.note-edit-header {
    color: #6784b9 !important;
    font-weight: 400;
}

/* Список заметок */
.note-list .note-item {
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    background-color: transparent;
    color: #3d5a97;
    border: none;
    outline: none;
}
.note-list .note-item:not(.active):hover { 
    background-color: #eef5fd;
    color: #4271b6;
}
.note-list .note-item.active {
    background-color: #e9ecef;
    font-weight: 600;
    color: #1a66d4;
}

/* Контейнер карточек */
.note-card {
    padding: 8px;
    margin-bottom: 12px !important;
    border-radius: 12px;
    min-width: 0; /* критично для flex */
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Заголовки карточек */
.note-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 6px;
    line-height: 1;
    max-height: 300px;
}

/* Заголовки заметок слева */
.note-list .note-item strong {
    font-weight: 500;
    font-size: 15px;
}

/* Контент заметки */
.note-card .card-text {
    font-size: 0.98rem;
    line-height: 1.2;
    margin-bottom: 8px;
}
.note-card .card-text p {
    margin: 0 0 6px 0;
    line-height: 1.25;
}
.note-card .card-text ul,
.note-card .card-text ol {
    margin-top: 0;
    margin-bottom: 6px;
}

/* Кнопки */
.note-card .btn-sm {
    padding: 3px 8px;
    font-size: 0.8rem;
    background-color: #5884c6 !important;
    border-color: #5884c6 !important;
    margin-bottom: 10px;
}

/* Превью */
.note-preview {
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}
.note-preview a {     
    color: #007bff;
    text-decoration: underline;
    word-break: break-word;
    display: inline;
    pointer-events: auto;
}

/* Наследуем форматирование Quill */
.note-preview b, .note-preview strong { font-weight: bold; }
.note-preview i, .note-preview em { font-style: italic; }
.note-preview u { text-decoration: underline; }
.note-preview a { color: #007bff; text-decoration: underline; }
.note-preview ul, .note-preview ol { padding-left: 1.2em; }
.note-preview li { margin-bottom: 0.2em; }

.edit-btn {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #ffffffe0;
    --bs-btn-active-color: #fff; 
    transition: all 0.2s;  
}
.btn-danger {
    --bs-btn-color: #fff;
    --bs-btn-active-color: #fff; 
    --bs-btn-hover-color: #141313b0;
}

/* Время обновления — меньше */
.note-card small {
    font-size: 0.75rem;
}

/* Quill редактор */
.quill-editor,
#quill-editor,
.ql-editor {
    min-width: 0; /* критично для flex */
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
}
.ql-editor p {
    margin: 0 0 6px 0 !important;
    line-height: 1 !important;
}
.quill-editor {
    min-height: 150px;
    overflow-y: hidden;
}

/* Картинки */
.note-card img,
.ql-editor img,
.img-fluid {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.img-fluid {
    max-width: 50% !important;
    height: auto !important;
}
/* ======== Мобильные правки ======== */
@media (max-width: 768px) {
    body { font-size: 14px; }
    .card-body { padding: 0; }
    .note-card { padding: 6px 10px; }
    .note-card .card-title { font-size: 1rem; }
    .note-card .card-body p { line-height: 1.1; }
    .note-card .card-text { font-size: 0.9rem; }
    nav.navbar .navbar-brand { font-size: 1.1rem; }
    nav.navbar .nav-link { font-size: 0.9rem; padding-left: 6px !important; padding-right: 6px !important; }
    .btn { padding: 6px 12px; font-size: 0.9rem; }
}

/* Custom Image Modal Styles for File Manager */
.modal-fm {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 5px;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
}

.modal-content-fm {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  animation-name: zoom;
  animation-duration: 0.6s;
}

@keyframes zoom {
  from {transform:scale(0)}
  to {transform:scale(1)}
}

.close-button-fm {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.close-button-fm:hover,
.close-button-fm:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

#caption-fm {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 150px;
}

@media only screen and (max-width: 700px){
  .modal-content-fm {
    width: 100%;
  }
}
