html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #fafafa;
}

a:focus {
  outline: revert;
  outline-offset: revert;
}

.btn.active.focus,
.btn.active:focus,
.btn.focus,
.btn:active.focus,
.btn:active:focus,
.btn:focus {
  outline: revert;
  outline-offset: revert;
  box-shadow: none;
}

input[type=file]:focus,
input[type=checkbox]:focus,
input[type=radio]:focus {
  outline: revert;
  outline-offset: revert;
}

.toast {
    background-color: #333;
    color: white;
    padding: 10px;
    border-radius: 5px;
    opacity: 0.9;
    display: none; 
    position: fixed; 
    bottom: 6px; 
    right: 20px; 
    z-index: 1000;
}

#copyNoteBtn {
    position: relative;
    display: inline-block;
}

#copyNoteBtn .checkmark-icon {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
}

#copyNoteBtn.copied .copy-icon {
    opacity: 0;
}

#copyNoteBtn.copied .checkmark-icon {
    display: block !important;
    opacity: 1;
}

.container {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    height: calc(100% - 200px);
}

.container textarea {
    width: 100%;
    height: 100%;
}

h2 {
    text-align: center;
    color: #4b4a4a;
    font-size: 1.2rem;
    margin: .3rem 0;
    font-weight: bold;
}

.column {
    background-color: white;
    border: 1px solid #ccc;
    width: 30%;
    padding: 10px;
    display: flex;
    flex-direction: column; /* Stack children vertically */
    height: calc(100% - 55px); /* Adjust height to fit within the board */
    border-radius: 10px;
}

input[type="text"] {
    padding: 10px 15px; /* Add padding */
    font-size: 16px; /* Increase font size */
    border: 1px solid #ccc; /* Border color */
    border-radius: 5px; /* Rounded corners */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    transition: border-color 0.3s; /* Smooth transition for focus effect */
}

input[type="text"]:focus {
    border-color: #6c63ff; /* Change border color on focus */
    outline: none; /* Remove default outline */
}

.drop-target {
    background-color: #e0e7ff; /* Light blue background for drop target */
    border: 2px dashed #6c63ff; /* Dashed border to indicate drop area */
}

.navbar-dark .navbar-brand {
    font-weight: bold;
    font-size: 1rem;
}

.brand-title, .brand-title:hover {
    text-decoration: none;
    color: inherit;
}

.flex-navbar {
    display: flex;
    color: white;
    font-weight: bold;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.generic-flex {
    display: flex;
    align-items: center;
}

.select-case-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        gap: 10px;
        padding: 0 20px;
    }

    .search-container .search-input-container {
        width: 100% !important;
        margin: 0;
        min-width: unset;
    }

    .sort-container {
        width: 100%;
        justify-content: center;
    }

    .sort-toggle-btn {
        padding: 10px 16px;
        font-size: 16px;
    }

    #tabbypad {
        padding: 20px 20px 40px 20px !important;
    }

    .custom-modal-content {
        margin: 40% auto !important;
    }

    .custom-modal-content.fullscreen {
        margin: 0 !important;
    }
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Pastel color classes for notes and modals */
.pastel-yellow {
    background-color: #FFF9C4;
    border: 5px solid #ebe07c;
}

.pastel-blue {
    background-color: #E3F2FD;
    border: 5px solid #BBDEFB;
}

.pastel-green {
    background-color: #E8F5E9;
    border: 5px solid #C8E6C9;
}

.pastel-pink {
    background-color: #FCE4EC;
    border: 5px solid #F8BBD0;
}

.pastel-purple {
    background-color: #F3E5F5;
    border: 5px solid #E1BEE7;
}

.default-grid-color {
    background-color: #ffffff;
    border: 5px solid #ccc;
}

/* Modal color classes */
.modal-pastel-yellow {
    background-color: #FFF9C4 !important;
}

.modal-pastel-blue {
    background-color: #E3F2FD !important;
}

.modal-pastel-green {
    background-color: #E8F5E9 !important;
}

.modal-pastel-pink {
    background-color: #FCE4EC !important;
}

.modal-pastel-purple {
    background-color: #F3E5F5 !important;
}

.modal-default-grid-color {
    background-color: #ffffff !important;
}

.grid-item {
    padding: 20px;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    height: 215px;
    overflow: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    transition: filter .2s ease-out;
    box-shadow: 0 50px 40px #00000003,0 50px 40px #00000005,0 20px 40px #0000000d,0 3px 10px #00000014;
    position: relative;
}

.note-content {
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
}

.note-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgb(255 235 55 / 96%);
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    transform: translateY(100%);
    transition: transform 0.2s ease-out;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.note-date {
    font-size: 11px;
    color: #3c3c3c;
    font-weight: 500;
    padding: 2px 8px;
    cursor: help;
    white-space: nowrap;
    flex-shrink: 0;
    order: 1;
}

.action-buttons {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    order: 2;
}

.grid-item:hover .note-actions {
    transform: translateY(0);
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    position: relative;
}

.action-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.action-btn svg {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.action-btn .action-icon {
    display: inline-block;
    transition: opacity 0.2s;
}

.action-btn .checkmark-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
}

.action-btn.copied .action-icon {
    opacity: 0;
}

.action-btn.copied .checkmark-icon {
    display: block !important;
    opacity: 1;
}

/* Ensure that the text is wrapped correctly */
.grid-item > div {
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Show ellipsis */
    display: -webkit-box; /* Use box layout for ellipsis */
    -webkit-box-orient: vertical; /* Vertical orientation */
    -webkit-line-clamp: 8; /* Limit to 8 lines */
}

.grid-item:hover {
    filter: sepia(1);
}

.custom-modal {
    z-index: 100;
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.5); /* Background with transparency */
}

.top-container{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.color-picker {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.color-option {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #333;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #333;
}

.custom-modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* Center the modal */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Default width */
    transition: all 0.3s ease; /* Smooth transition for all properties */
    border-radius: 8px;
}

/* Style for the textarea to be transparent and inherit background */
#fullscreenNote {
    background-color: transparent;
    border: none;
    width: 100%;
    min-height: 200px;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.5;
    padding: 20px;
    margin: 10px 0;
    border-radius: 4px;
    border: 2px solid #767676;
}

#fullscreenNote:focus {
    border-color: #484848;
    outline: none;
}

.custom-modal-content.fullscreen {
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    margin: 0; /* Remove margin */
    padding: 20px; /* Remove padding */
    border-radius: 0; /* Remove border radius */
}

#tabbypad {
    margin-top: 15px;
    padding: 20px 10% 40px;
}

#deleteNoteBtn {
    float: right;
}

textarea {
    padding: 20px;
    margin: 10px 0;
    border-radius: 6px;
    height: calc(100% - 92px);
    resize: none;
}

.add-note {
    background-color: #e0e0e0; /* Light background for the add note item */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    height: 215px; /* Same height as other grid items */
    font-size: 1.3em;
    border: 5px dashed #878686;
    color: #6a6a6a;
    font-weight: bold;
    flex-direction: column;
}

.keyboard-shortcut-container {
    font-size: 0.6em;
    color: #5c5b5b;
    font-weight: normal;
}

.search-container {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 35px;
    flex-wrap: wrap;
}

.search-container .search-input-container {
    width: 40%;
    position: relative;
    min-width: 250px;
}

.sort-container {
    display: flex;
    align-items: center;
}

.sort-toggle-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #495057;
    white-space: nowrap;
}

.sort-toggle-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sort-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sort-toggle-btn.descending svg {
    transform: rotate(180deg);
}

.sort-text {
    font-weight: 500;
}

.esc-to-cancel {
    display: none;
    position: absolute;
    top: 11px;
    right: 9px;
    font-size: 8px;
    padding: 2px 8px;
    background-color: #e8e8e8;
    border-radius: 5px; 
    cursor: pointer;
}

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

.flex-note-footer {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-confirmation-container .modal.show {
    display: block; /* Show the modal */
    opacity: 1; /* Ensure full opacity */
}

.delete-confirmation-container .modal-dialog {
    margin: auto; /* Center the modal */
    top: 40%; /* Position it in the middle of the screen */
    transform: translateY(-50%); /* Adjust for vertical centering */
}

.note-content {
    white-space: pre-wrap; /* Preserve whitespace and newlines */
    word-wrap: break-word; /* Allow long words to break */
}

.btn-container {
    gap: 13px;
}

.btn-container button {
    padding: 0;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-icon {
    width: 22px;
    height: 22px;
}

.theme-icon-sun {
    display: none;
}

body.dark .theme-icon-moon {
    display: none;
}

body.dark .theme-icon-sun {
    display: block;
}

.bg-dark {
    background-color: #1b222d !important;
}

/* Floating Add Note Button */
.floating-add-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-add-btn:hover {
    background-color: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.floating-add-btn:active {
    transform: scale(0.95);
}

.floating-add-btn svg {
    width: 24px;
    height: 24px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    grid-column: 1 / -1;
    height: calc(100dvh - 200px);
}

.empty-state svg {
    margin-bottom: 20px;
    color: #adb5bd;
}

.empty-state p {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.empty-state .empty-state-subtitle {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #adb5bd;
    font-weight: normal;
}

body.dark {
    background-color: #0f131a;
    color: #e6edf3;
}

body.dark h2 {
    color: #d9e2ec;
}

body.dark input[type="text"] {
    background-color: #141a22;
    border-color: #2c3645;
    color: #e6edf3;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

body.dark input[type="text"]::placeholder {
    color: #8b98a7;
}

body.dark input[type="text"]:focus {
    border-color: #4d6b91;
}

body.dark .esc-to-cancel {
    background-color: #202a37;
    color: #cbd5e1;
}

body.dark .sort-toggle-btn {
    background-color: #1b2330;
    border-color: #2c3645;
    color: #e6edf3;
}

body.dark .sort-toggle-btn:hover {
    background-color: #232d3d;
    border-color: #3b475c;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

body.dark .grid-item {
    box-shadow: 0 50px 40px rgba(0, 0, 0, 0.25), 0 20px 40px rgba(0, 0, 0, 0.25), 0 3px 10px rgba(0, 0, 0, 0.25);
}

body.dark .default-grid-color {
    background-color: #1c2330;
    border-color: #2f3a4b;
}

body.dark .grid-item.default-grid-color {
    color: #e6edf3;
}

body.dark .grid-item.pastel-yellow,
body.dark .grid-item.pastel-blue,
body.dark .grid-item.pastel-green,
body.dark .grid-item.pastel-pink,
body.dark .grid-item.pastel-purple {
    color: #e6edf3;
}

body.dark .note-actions {
    background: rgba(11, 14, 20, 0.9);
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.4);
    color: #e6edf3;
}

body.dark .note-actions .action-btn {
    color: #ffffff;
}

body.dark .note-date {
    color: #cbd5e1;
}

body.dark .action-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark .add-note {
    background-color: #151c26;
    border-color: #3b4658;
    color: #a9b4c7;
}

body.dark .keyboard-shortcut-container {
    color: #8b98a7;
}

body.dark .empty-state {
    color: #9aa5b1;
}

body.dark .empty-state svg {
    color: #4b5563;
}

body.dark .empty-state .empty-state-subtitle {
    color: #6b7280;
}

body.dark .toast {
    background-color: #1f2933;
}

body.dark .custom-modal-content {
    border-color: #2e394c;
}

body.dark .custom-modal-content.modal-default-grid-color {
    background-color: #161f2b !important;
    color: #e6edf3;
}

body.dark .custom-modal-content.modal-default-grid-color #fullscreenNote {
    border-color: #475569;
    color: #e6edf3;
}

body.dark .custom-modal-content.modal-default-grid-color #fullscreenNote:focus {
    border-color: #6b7c90;
}

body.dark .custom-modal-content.modal-default-grid-color svg path,
body.dark .custom-modal-content.modal-default-grid-color svg line {
    stroke: #e6edf3 !important;
}

body.dark .custom-modal-content.modal-pastel-yellow,
body.dark .custom-modal-content.modal-pastel-blue,
body.dark .custom-modal-content.modal-pastel-green,
body.dark .custom-modal-content.modal-pastel-pink,
body.dark .custom-modal-content.modal-pastel-purple {
    color: #e6edf3;
}

body.dark .custom-modal-content.modal-pastel-yellow #fullscreenNote,
body.dark .custom-modal-content.modal-pastel-blue #fullscreenNote,
body.dark .custom-modal-content.modal-pastel-green #fullscreenNote,
body.dark .custom-modal-content.modal-pastel-pink #fullscreenNote,
body.dark .custom-modal-content.modal-pastel-purple #fullscreenNote {
    color: #e6edf3;
}

body.dark .custom-modal-content.modal-pastel-yellow svg path,
body.dark .custom-modal-content.modal-pastel-yellow svg line,
body.dark .custom-modal-content.modal-pastel-blue svg path,
body.dark .custom-modal-content.modal-pastel-blue svg line,
body.dark .custom-modal-content.modal-pastel-green svg path,
body.dark .custom-modal-content.modal-pastel-green svg line,
body.dark .custom-modal-content.modal-pastel-pink svg path,
body.dark .custom-modal-content.modal-pastel-pink svg line,
body.dark .custom-modal-content.modal-pastel-purple svg path,
body.dark .custom-modal-content.modal-pastel-purple svg line {
    stroke: #e6edf3 !important;
}

body.dark .custom-modal-content.modal-pastel-yellow #fullscreenNote,
body.dark .custom-modal-content.modal-pastel-blue #fullscreenNote,
body.dark .custom-modal-content.modal-pastel-green #fullscreenNote,
body.dark .custom-modal-content.modal-pastel-pink #fullscreenNote,
body.dark .custom-modal-content.modal-pastel-purple #fullscreenNote {
    border-color: #475569;
}

body.dark .custom-modal-content.modal-pastel-yellow #fullscreenNote:focus,
body.dark .custom-modal-content.modal-pastel-blue #fullscreenNote:focus,
body.dark .custom-modal-content.modal-pastel-green #fullscreenNote:focus,
body.dark .custom-modal-content.modal-pastel-pink #fullscreenNote:focus,
body.dark .custom-modal-content.modal-pastel-purple #fullscreenNote:focus {
    border-color: #6b7c90;
}

body.dark .pastel-yellow {
    background-color: #3b2e14;
    border-color: #5b4721;
}

body.dark .pastel-blue {
    background-color: #182a3a;
    border-color: #2a445d;
}

body.dark .pastel-green {
    background-color: #1c2f26;
    border-color: #2e4a3b;
}

body.dark .pastel-pink {
    background-color: #3b1f2b;
    border-color: #5b2d3d;
}

body.dark .pastel-purple {
    background-color: #2d213a;
    border-color: #46305c;
}

body.dark .modal-pastel-yellow {
    background-color: #3b2e14 !important;
}

body.dark .modal-pastel-blue {
    background-color: #182a3a !important;
}

body.dark .modal-pastel-green {
    background-color: #1c2f26 !important;
}

body.dark .modal-pastel-pink {
    background-color: #3b1f2b !important;
}

body.dark .modal-pastel-purple {
    background-color: #2d213a !important;
}

body.dark .color-option[data-color="pastel-yellow"] {
    background-color: #3b2e14 !important;
    border-color: #5b4721 !important;
}

body.dark .color-option[data-color="pastel-blue"] {
    background-color: #182a3a !important;
    border-color: #2a445d !important;
}

body.dark .color-option[data-color="pastel-green"] {
    background-color: #1c2f26 !important;
    border-color: #2e4a3b !important;
}

body.dark .color-option[data-color="pastel-pink"] {
    background-color: #3b1f2b !important;
    border-color: #5b2d3d !important;
}

body.dark .color-option[data-color="pastel-purple"] {
    background-color: #2d213a !important;
    border-color: #46305c !important;
}

body.dark .color-option[data-color="default-grid-color"] {
    background-color: #1c2330 !important;
    border-color: #2f3a4b !important;
}

body.dark .color-option.selected {
    border-color: #e6edf3;
    box-shadow: 0 0 0 2px #0f131a, 0 0 0 3px #e6edf3;
}

body.dark .modal-content {
    background-color: #161f2b;
    color: #e6edf3;
    border-color: #2e394c;
}

body.dark .modal-header,
body.dark .modal-footer {
    border-color: #2e394c;
}

body.dark .modal-content a {
    color: #8bd5ff;
}

body.dark .modal-content a:hover {
    color: #b7e4ff;
}

body.dark .modal-header .close {
    color: #e6edf3;
    text-shadow: none;
    opacity: 0.8;
}

body.dark .modal-header .close:hover,
body.dark .modal-header .close:focus {
    color: #ffffff;
    opacity: 1;
}
