/* === FONT IMPORTS === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* === CUSTOM FONT (LOCAL) === */
@font-face {
    font-family: 'Ahsing';
    src: url('../fonts/Ahsing-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* === RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === LIGHT THEME VARIABLES (Default) === */
:root {
    /* Backgrounds */
    --bg: #fff;
    --bg-hovr: #000;

    /* Text */
    --txt: #000;
    --txt-hovr: #fff;

    /* Glass Effects */
    --glass: rgba(0, 0, 0, 0.025);
    --glass-hovr: rgba(0, 0, 0, 0.075);

    /* Borders */
    --border: 1px solid rgba(0, 0, 0, 0.1);

    /* Hover States / Accents */
    --hover-bg: #0f0f0f;
    --hover-c: #fff;
}

/* === DARK THEME VARIABLES (Toggle Class) === */
.darkMode {
    /* Backgrounds */
    --bg: #0f0f0f;
    --bg-hovr: #fff;

    /* Text */
    --txt: #fff;
    --txt-hovr: #000;

    /* Glass Effects */
    --glass: rgba(255, 255, 255, 0.025);
    --glass-hovr: rgba(255, 255, 255, 0.075);

    /* Borders */
    --border: 1px solid rgba(255, 255, 255, 0.1);

    /* Hover States / Accents */
    --hover-bg: #fff;
    --hover-c: #000;
}

body {
    width: 95vw;
    margin: auto;
    background: var(--bg);
    color: var(--txt);
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    transition: background 0.3s ease, color 0.3s ease, border 0.3s ease;
}

::-webkit-scrollbar {
    display: none;
}

/* === HEADER === */
header {
    width: 100%;
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    height: 49px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    border: var(--border);
    display: grid;
    place-items: center;
    background: var(--glass);
    color: var(--txt);
    font-family: "Ahsing", sans-serif;
    font-size: 24px;
    padding: 0 0 7px;
    transition: all 0.5s ease;
}

.logo:hover {
    background-color: var(--hover-bg);
    color: var(--hover-c);
}

.title {
    font-size: 14px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === BUTTONS === */
.btn {
    height: 42px;
    background: var(--glass);
    color: var(--txt);
    border: var(--border);
    border-radius: 30px;
    padding: 7px 21px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 550;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s ease;
}

.btn span {
    font-size: 21px;
    font-weight: 600;
}

.btn:hover {
    transform: translateY(-2.5px);
    background: var(--glass-hovr);
}

.btn:active {
    background: var(--glass-hovr);
}

/* === SEARCH === */
.search {
    display: none;
    align-items: center;
    padding: 7px 14px;
    cursor: text;
}

.search input {
    width: 100px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--txt);
}

.search input::-webkit-search-cancel-button {
    display: none;
}

/* === NOTES GRID === */
.notes-grid {
    columns: 250px;
}

.note-card {
    width: 100%;
    display: inline-block;
    background: var(--glass);
    border-radius: 30px;
    padding: 1.5rem;
    margin-bottom: 0.75rem;
    border: var(--border);
    transition: all 0.2s ease;
    position: relative;
}

.note-card:hover {
    transform: scale(1.02);
}

.note-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
}

.note-content {
    line-height: 1.6;
    margin-bottom: 1rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* === NOTE ACTIONS === */
.note-actions {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.note-card:hover .note-actions {
    opacity: 1;
    visibility: visible;
}

.edit-btn,
.delete-btn {
    height: 28px;
    aspect-ratio: 1/1;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--txt);
    transition: all 0.2s ease;
}

.edit-btn:hover {
    transform: translateY(-2.5px);
    color: rgb(0, 255, 0);
}

.delete-btn:hover {
    transform: translateY(-2.5px);
    color: red;
}

/* === DIALOG === */
dialog {
    margin: auto;
    border: none;
    padding: 0;
    background: var(--glass);
    color: var(--txt);
    border: var(--border);
    backdrop-filter: blur(15px);

    border-radius: 30px;
    max-width: 500px;
    width: 95vw;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.dialog-content {
    padding: 2rem;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dialog-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    color: var(--txt);
}

.close-btn span {
    font-size: 28px;
    font-weight: 600;
}

.close-btn:hover {
    color: red;
}

/* === FORM === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--txt);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 1rem;
    border: var(--border);
    border-radius: 30px;
    font-size: 1rem;
    /* background: var(--bg); */
    background-color: transparent;
    color: var(--txt);
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--txt);
}

.form-textarea {
    resize: none;
    min-height: 120px;
    max-height: 250px;
    field-sizing: content;
}

.dialog-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.cancel-btn,
.save-btn {
    padding: 0.75rem 1.5rem;
    border: var(--border);
    border-radius: 30px;
    cursor: pointer;
    font-weight: 550;
    background: transparent;
    color: var(--txt);
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    color: red;
    border-color: red;
}

.save-btn:hover {
    color: rgb(0, 255, 0);
    border-color: rgb(0, 255, 0);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    display: grid;
    place-items: center;
    padding: 4rem 2rem;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* === MEDIA QUERIES === */
@media (max-width: 500px) {
    .logo {
        padding: 0;
    }

    .title {
        display: none;
    }
}

@media (max-width: 400px) {
    .search {
        display: none;
    }
}