:root {
    --primary: #e11d48;
    --primary-hover: #be123c;
    --bg-main: #ffffff;
    --bg-sidebar: #f8fafc;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 320px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-logo i {
    color: var(--primary);
}

.btn-icon-primary {
    background: var(--primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.search-box {
    padding: 0 24px 16px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: -8px;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 24px;
}

.note-item {
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.note-item:hover {
    background: var(--gray-100);
}

.note-item.active {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.note-item .note-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gray-900);
}

.note-item .note-item-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.note-item .note-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    text-align: center;
}

.sidebar-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.sidebar-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.sidebar-footer a:hover {
    text-decoration: underline;
}

.sidebar-footer .creator-tag {
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: 0.5px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* Mobile Utilities */
.mobile-only {
    display: none;
}

.btn-icon-ghost {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
}

/* Responsive Styling */
@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }

    .sidebar {
        width: 100%;
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 10;
        transition: transform 0.3s ease;
    }

    body.note-open .sidebar {
        transform: translateX(-100%);
    }

    .editor-area {
        width: 100%;
    }

    .editor-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .title-input {
        font-size: 1.15rem;
        flex: 1;
        min-width: 150px;
        order: 2;
    }

    #mobile-back-btn {
        order: 1;
        margin-right: 4px;
    }

    .editor-actions {
        order: 3;
        width: 100%;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px dashed var(--border-color);
    }

    .status-text {
        font-size: 0.75rem;
    }

    .editor-body {
        padding: 20px;
    }

    .editor-footer {
        padding: 12px 20px;
    }

    .sidebar-header {
        padding: 16px 20px;
    }

    .search-box {
        padding: 0 20px 12px;
    }

    .notes-list {
        padding: 0 10px 20px;
    }
}

/* Editor Area Styling */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-content i {
    font-size: 4rem;
    color: var(--gray-100);
    margin-bottom: 24px;
}

.empty-content h2 {
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.empty-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

.editor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-header {
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    gap: 20px;
}

.title-input {
    font-size: 1.75rem;
    font-weight: 800;
    border: none;
    outline: none;
    flex: 1;
    min-width: 0;
    color: var(--gray-900);
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.status-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-icon-danger {
    background: transparent;
    color: var(--text-muted);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-danger:hover {
    background: #fee2e2;
    color: var(--danger);
}

.editor-body {
    flex: 1;
    padding: 40px;
}

.editor-body textarea {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--gray-800);
    resize: none;
    font-family: inherit;
}

.editor-footer {
    padding: 16px 40px;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
}

.note-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Utils */
.loading-state {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    background: var(--gray-900);
    color: white;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(100px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}
