* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

button {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 15px;
    border: none;
    outline: none;
}

button:hover {
    background-color: var(--brand-color);
    color: white;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

:root {
    --brand-color: #6366f1;
    --brand-color-light: #818cf8;
    --brand-color-dark: #4f46e5;
    --base-color: #f8fafc;
    --surface-color: #ffffff;
    --text-color: #0f172a;
    --secondary-text-color: #64748b;
    --border-color: #e2e8f0;
    --base-transparent-90: rgba(248, 250, 252, 0.95);
    --base-transparent-100: rgba(248, 250, 252, 1);
    --modal-back: rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --gradient-brand: linear-gradient(135deg, var(--brand-color), var(--brand-color-light));
}

.dark-theme {
    --brand-color: #818cf8;
    --brand-color-light: #a5b4fc;
    --brand-color-dark: #6366f1;
    --base-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --secondary-text-color: #94a3b8;
    --border-color: #334155;
    --base-transparent-90: rgba(15, 23, 42, 0.95);
    --base-transparent-100: rgba(15, 23, 42, 1);
    --modal-back: rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --gradient-brand: linear-gradient(135deg, var(--brand-color), var(--brand-color-light));
}

body {
    background: var(--base-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

.container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px;
}

.hideoverflow {
    overflow-y: hidden;
}

.navbar {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 20px 32px;
    background: var(--surface-color);
    color: var(--text-color);
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .left .logo {
    font-weight: 800;
    font-size: 32px;
    letter-spacing: -0.02em;
}

.navbar .left .logo span {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar .right {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.navbar .right button , .add-note {
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    position: relative;
    overflow: hidden;
}

.navbar .right button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-brand);
    transition: left 0.3s ease;
    z-index: -1;
}

.navbar .right button:hover::before {
    left: 0;
}

.navbar .right .add .add-note , .add-note {
    background: var(--gradient-brand);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
}

.navbar .right .add .add-note:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.navbar .right h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.notes {
    margin-top: 32px;
    padding: 0 32px;
}

.note-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.note-container {
    background: var(--surface-color);
    padding: 24px;
    height: 370px;
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}


.no-notes{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--text-color);
}


.note-container:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.note-container:hover::before {
    transform: scaleX(1);
}

.note-container:hover .toggle-buttons {
    opacity: 1;
    transform: translateY(0);
}

.note-title-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.note-title-nav .note-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.3;
    flex: 1;
    margin-right: 16px;
}

.toggle-buttons {
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.toggle-buttons .update,
.toggle-buttons .delete {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.toggle-buttons .update {
    background: var(--brand-color);
    color: white;
}

.toggle-buttons .update:hover {
    background: var(--brand-color-dark);
    transform: scale(1.05);
}

.toggle-buttons .delete {
    background: #ef4444;
    color: white;
}

.toggle-buttons .delete:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.note-description {
    margin-top: 16px;
    font-weight: 400;
    color: var(--secondary-text-color);
    line-height: 1.3;
    font-size: 15px;
}

.modal {
    height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--modal-back);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.no-modal {
    display: none;
}

.null-msg {
    width: fit-content;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    background: #ef4444;
    color: white;
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.addnote-modal {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: min(500px, 90vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hide-modal {
    display: none;
}

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

.addnote-modal .top h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.addnote-modal .top .close-modal {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    color: var(--secondary-text-color);
    background: var(--base-color);
    border: 1px solid var(--border-color);
    font-size: 18px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.addnote-modal .top .close-modal:hover {
    transform: rotate(90deg);
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

#title,
#note-detail {
    background: var(--base-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 16px;
    color: var(--text-color);
    font-family: inherit;
    transition: all 0.2s ease;
    resize: none;
}

#title {
    height: 56px;
}

#note-detail {
    height: 200px;
    font-family: inherit;
    line-height: 1.6;
}

#title::placeholder,
#note-detail::placeholder {
    color: var(--secondary-text-color);
    font-size: 15px;
}

#title:focus,
#note-detail:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal .addnote-modal .buttons {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    gap: 12px;
    margin-top: auto;
}

.modal .addnote-modal .buttons button {
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.modal .addnote-modal .buttons button:first-child {
    background: var(--base-color);
    color: var(--secondary-text-color);
    border: 1px solid var(--border-color);
}

.modal .addnote-modal .buttons button:first-child:hover {
    background: var(--secondary-text-color);
    color: white;
    border-color: var(--secondary-text-color);
}

.modal .addnote-modal .buttons button:last-child {
    background: var(--gradient-brand);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
}

.modal .addnote-modal .buttons button:last-child:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 16px 20px;
        flex-direction: column;
        gap: 16px;
    }
    
    .navbar .left .logo {
        font-size: 28px;
    }
    
    .notes {
        padding: 0 20px;
        margin-top: 24px;
    }
    
    .note-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .note-container {
        height: 250px;
        padding: 20px;
    }
    
    .addnote-modal {
        width: 95vw;
        padding: 24px;
    }
}