/* Global Styles */
:root {
    --primary-color: #002856ff;
    --primary-light: #a29bfe;
    --secondary-color: #00b894;
    --danger-color: #d63031;
    --warning-color: #fdcb6e;
    --light-color: #f5f6fa;
    --dark-color: #2d3436;
    --text-color: #2d3436;
    --text-light: #636e72;
    --bg-color: #ffffff;
    --sidebar-color: #f8f9fa;
    --editor-bg: #ffffff;
    --border-color: #dfe6e9;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary-color: #a29bfe;
    --primary-light: #6c5ce7;
    --secondary-color: #55efc4;
    --danger-color: #ff7675;
    --light-color: #2d3436;
    --dark-color: #f5f6fa;
    --text-color: #f5f6fa;
    --text-light: #b2bec3;
    --bg-color: #1e272e;
    --sidebar-color: #2d3436;
    --editor-bg: #1e272e;
    --border-color: #636e72;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.app-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.app-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main Content Styles */
.main-content {
    display: flex;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem;
    gap: 1.5rem;
}

.editor-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    background-color: var(--editor-bg);
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    overflow: hidden;
}

.editor-header {
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.title-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--dark-color);
}

.title-input:focus {
    outline: 2px solid var(--primary-light);
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    color: white;
}

.btn-secondary {
    background-color: var(--light-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-icon {
    padding: 0.5rem;
    background: none;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-icon:hover {
    color: var(--primary-color);
}

.toolbar {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--sidebar-color);
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-btn {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 32px;
    height: 32px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background-color: var(--primary-light);
    color: white;
}

.color-picker {
    position: relative;
    display: flex;
    align-items: center;
}

.color-picker input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.font-select {
    padding: 0.3rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
}

.font-select:focus {
    outline: 2px solid var(--primary-light);
}

.rich-text-editor {
    flex: 1;
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    border: none;
    resize: none;
    background-color: var(--editor-bg);
    color: var(--text-color);
    min-height: 400px;
    overflow-y: auto;
}

.rich-text-editor:empty:before {
    content: attr(placeholder);
    color: var(--text-light);
    pointer-events: none;
    display: block;
}

.rich-text-editor:focus {
    outline: none;
}

.editor-footer {
    padding: 0.5rem 1rem;
    background-color: var(--sidebar-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Sidebar Styles */
.sidebar {
    flex: 1;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    background-color: var(--sidebar-color);
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    overflow: hidden;
}

.sidebar-header {
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 10px;
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.search-box input:focus {
    outline: 2px solid var(--primary-light);
}

.sort-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
}

.sort-select:focus {
    outline: 2px solid var(--primary-light);
}

.notes-list-container {
    flex: 1;
    overflow-y: auto;
}

.notes-list {
    list-style: none;
    padding: 0;
}

.note-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.note-item:hover {
    background-color: rgba(108, 92, 231, 0.1);
}

.note-item.active {
    background-color: rgba(108, 92, 231, 0.2);
    border-left: 3px solid var(--primary-color);
}

.note-title {
    font-weight: 500;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-preview {
    font-size: 0.8rem;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-date {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Footer Styles */
.app-footer {
    text-align: center;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.9rem;
}

.app-footer i {
    color: var(--danger-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.modal h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        padding: 1rem;
    }
    
    .sidebar {
        max-width: 100%;
        order: -1;
        margin-bottom: 1rem;
    }
    
    .editor-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .editor-actions {
        margin-top: 0.5rem;
        justify-content: flex-end;
    }
    
    .toolbar {
        justify-content: center;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.note-item {
    animation: fadeIn 0.3s ease forwards;
}

/* dark mode  */
/* Tambahkan ini di bagian dark theme */
[data-theme="dark"] .title-input {
    background-color: rgba(7, 7, 7, 0.1);
    color: white;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .title-input::placeholder {
    color: var(--text-light);
}

/* Perbaikan contrast untuk judul di sidebar */
[data-theme="dark"] .note-title {
    color: var(--primary-light);
}

/* Tambahkan juga ini untuk memastikan visibility */
.title-input {
    transition: all 0.3s ease;
}