/* --- NOTES PAGE STYLES --- */
#notes-page-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

#notes-grid {
    flex-grow: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding-right: 1rem;
}

#no-notes-message {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60%;
  text-align: center;
  color: var(--text-secondary);
}

#no-notes-message img {
  width: 120px;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

#no-notes-message p {
  font-size: 1.1rem;
  font-weight: 500;
}

/* --- NOTE CARD STYLES --- */
.note-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 280px;
}

.note-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-card-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: rgba(255,255,255,0.1);
}

.note-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: -0.5rem;
}

.note-card-description {
    font-size: 0.95rem;
    color: var(#FFF);
    line-height: 1.6;
    flex-grow: 1;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
}

.note-card-description p, .note-card-description div {
    margin: 0;
}

.note-card.light-text .note-card-title,
.note-card.light-text .note-card-description {
    color: #111;
}

.note-locked-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #FFF;
}

.note-locked-overlay .fas {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* --- NOTE MODAL STYLES --- */
.note-modal-content {
    width: 90%;
    max-width: 700px;
    height: 80vh;
    padding: 0;
}

.note-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

#note-title-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0.5rem 0;
}

#note-title-input:focus {
    outline: none;
}

.note-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.toolbar-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

.toolbar-btn:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 140%; /* Position it above the button */
    left: 50%;
    transform: translateX(-50%); /* Horizontally center the tooltip */
    
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap; /* Prevent the tooltip text from wrapping */
    z-index: 20;

    /* Fade-in animation */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s, visibility 0.2s;
}

/* Hide the tooltip by default */
.toolbar-btn::before {
    opacity: 0;
    visibility: hidden;
}
.toolbar-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}
.toolbar-btn.danger:hover {
    color: var(--danger-red);
}

.color-picker-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.color-palette {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}
.color-picker-wrapper:hover .color-palette,
.color-palette.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}
.color-swatch:hover {
    border-color: var(--text-primary);
}

.note-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

#note-description-input {
    height: 100%;
    outline: none;
    line-height: 1.7;
}

#note-description-input:empty::before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    cursor: text;
}

.note-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

#lock-btn {
  margin-left: auto;
}

/* Fix for the 'X' (close) button hover effect */
.modal-close-btn {
  background: none;
  border: none;
  padding: 0;
  width: 32px;
  height: 32px;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%; /* Make the button area circular */
  transition: background-color 0.2s, color 0.2s;
}

.modal-close-btn:hover {
  background-color: var(--bg-tertiary); /* Add a subtle circular background on hover */
  color: var(--text-primary);
}

/* Improved styling for the delete button in the toolbar */
.toolbar-btn.danger .fa-trash-alt {
  color: var(--text-secondary); /* Make the icon grey by default */
  transition: color 0.2s ease-in-out;
}

.toolbar-btn.danger:hover .fa-trash-alt {
  color: var(--danger-red); /* Turn the icon red on hover */
}

/* Optional: remove the background highlight to focus only on the icon color change */
.toolbar-btn.danger:hover {
  background-color: transparent;
}

#delete-note-btn {
  /* Use the SVG file as a mask (stencil) */
  -webkit-mask-image: url('icons/delete.svg');
  mask-image: url('icons/delete.svg');
  
  /* Ensure the mask covers the button area */
  -webkit-mask-size: 20px;
  mask-size: 20px;
  
  /* Ensure the mask is centered and does not repeat */
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;

  /* Use background-color to color the icon */
  background-color: var(--text-secondary);
  
  transition: background-color 0.2s;
}

#delete-note-btn:hover {
  background-color: var(--danger-red); /* This is the icon color on hover */
}

#password-prompt-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
}

#password-prompt-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
}

.sidebar.collapsed{
  width:84px !important;
  min-width:84px !important;
  transition:width .2s ease;
}

/* hide only labels when collapsed */
/* Completely hide nav labels when collapsed */
.sidebar.collapsed .nav-label{
  display:none !important;
  visibility:hidden !important;
}


/* center icon rows when collapsed (keeps your separator) */
.sidebar.collapsed .nav a{
  justify-content:center !important;
  padding-left:0 !important;
  padding-right:0 !important;
}

/* dual logos */
.sidebar .logo-expanded,
.sidebar .logo-collapsed{
  height:40px;
  width:auto;
  object-fit:contain;
  display:block;
}
.sidebar .logo-collapsed{ display:none; }
.sidebar.collapsed .logo-expanded{ display:none !important; }
.sidebar.collapsed .logo-collapsed{ display:block !important; }

/* minimal toggle hit-area (you'll place your own SVG inside) */
.sidebar-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border:0;
  background:transparent;
  cursor:pointer;
}

/* === FIX: remove all nav text when collapsed and shrink grid column === */

/* Hide every text <span> inside .nav-link (keeps only the icon) */
.sidebar.collapsed .nav-link span {
  display: none !important;
  visibility: hidden !important;
}

/* Keep icons centered when collapsed */
.sidebar.collapsed .nav-link {
  justify-content: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* When container says sidebar is collapsed, shrink first column */
.app-container.sidebar-collapsed {
  grid-template-columns: 84px 1fr !important;
}