@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200..1000&display=swap');

:root {
    --sidebar-width: 280px;
    --header-height: 64px;
    --primary-color: #202124;
    --border-color: #e0e0e0;
    --hover-color: #f1f3f4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Cairo", Arial, sans-serif;
}

body {
    background-color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background-color: #fff;
    padding: 0.8rem 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3);
    display: flex;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    height: var(--header-height);
    z-index: 1000;
}

.menu-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 0.5rem;
    cursor: pointer;
    color: #5f6368;
    margin-right: 1rem;
}

.header h1 {
    color: #5f6368;
    margin-right: 2rem;
    font-size: 1.3rem;
}

.search-container {
    flex-grow: 1;
    max-width: 700px;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: none;
    border-radius: 8px;
    background-color: #f1f3f4;
    font-size: 1rem;
    outline: none;
    transition: background-color 0.3s;
}

.search-container input:focus {
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3);
}

.search-container i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
}

.view-toggle {
    margin-left: 1rem;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #5f6368;
}

.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background-color: #fff;
    padding: 1rem 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 900;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
    margin-right: 1rem;
}

.sidebar-item:hover {
    background-color: var(--hover-color);
}

.sidebar-item.active {
    background-color: #feefc3;
}

.sidebar-item i {
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.main-content {
    margin-left: 0;
    margin-top: var(--header-height);
    padding: 1rem;
    transition: margin-left 0.3s ease;
}

.sidebar-active .main-content {
    margin-left: var(--sidebar-width);
}

.add-note-container {
    max-width: 600px;
    margin: 1rem auto;
    padding: 1rem;
}

.add-note {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3);
    padding: 1rem;
    width: 100%;
}

.add-note input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    margin-bottom: 0.5rem;
}

.quill-editor {
    display: none;
    border: none;
    margin-bottom: 1rem;
}

.add-note.expanded .quill-editor {
    display: block;
}

.ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
}

.ql-container.ql-snow {
    border: none;
}

.note-actions {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.add-note.expanded .note-actions {
    display: flex;
}

.note-tools {
    display: flex;
    gap: 0.5rem;
}

.color-palette {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.color-options {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3);
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.color-option {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-option:hover {
    border-color: #202124;
}

.color-option.selected {
    border-color: #202124;
}

.note-buttons {
    display: flex;
    gap: 0.5rem;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.icon-button {
    padding: 0.5rem;
    background: transparent;
    color: #5f6368;
}

.icon-button:hover {
    background-color: var(--hover-color);
}

.close-btn {
    background-color: var(--hover-color);
    color: var(--primary-color);
}

.add-btn {
    background-color: #feefc3;
    color: var(--primary-color);
}

.notes-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    transition: all 0.3s ease;
}

.notes-container.list-view {
    grid-template-columns: 1fr;
    max-width: 800px;
}

.notes-container.list-view .note {
    display: flex;
    flex-direction: column;
}

.notes-container.list-view .note-content {
    display: flex;
    gap: 1rem;
}

.notes-container.list-view .note-title {
    flex: 1;
}

.pinned-notes {
    margin-bottom: 2rem;
}

.section-title {
    grid-column: 1 / -1;
    color: #5f6368;
    font-size: 0.9rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3);
    transition: box-shadow 0.3s ease;
    position: relative;
    border: 1px solid transparent;
    cursor: pointer;
}

.note:hover {
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
}

.note.selected {
    border-color: #feefc3;
}

.note-title {
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    padding-right: 1.5rem;
    font-weight: 500;
}

.note-text {
    color: #5f6368;
    word-wrap: break-word;
    font-size: 0.9rem;
    line-height: 1.5;
}

.note::after {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.note:hover::after {
    opacity: 1;
}

.note .pin-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.note:hover .pin-button,
.note.pinned .pin-button {
    opacity: 1;
}

.note.pinned .pin-button {
    color: #000;
}

.note-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.note:hover .note-footer {
    opacity: 1;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

.modal-title {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.modal-input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .header {
        padding: 0.5rem;
    }

    .search-container {
        max-width: none;
    }

    .sidebar.active {
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .notes-container {
        grid-template-columns: 1fr;
    }

    
}