* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
}

.notes-app {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
    height: 100%;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.app-header p {
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.app-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* New Note Button */
.new-note-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.new-note-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.new-note-btn.large {
    padding: 15px 25px;
    font-size: 1.1rem;
}

/* Search */
.search-container {
    margin-bottom: 25px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: #a0aec0;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    background: white;
}

.search-box input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Categories */
.categories-section {
    margin-bottom: 25px;
}

.categories-section h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-weight: 600;
    font-size: 1rem;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border: none;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #4a5568;
    border: 2px solid transparent;
}

.category-btn:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.category-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.category-btn i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.note-count {
    background: #e2e8f0;
    color: #4a5568;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.category-btn.active .note-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Notes List */
.notes-list-section h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.total-notes {
    color: #718096;
    font-weight: 400;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-left: 4px solid #667eea;
}

.note-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.note-item.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.note-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.note-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-item-category {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #4a5568;
}

.note-item.active .note-item-category {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.note-item-preview {
    font-size: 0.85rem;
    color: #718096;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.note-item.active .note-item-preview {
    color: rgba(255, 255, 255, 0.8);
}

.note-item-date {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 8px;
}

.note-item.active .note-item-date {
    color: rgba(255, 255, 255, 0.6);
}

/* Editor */
.editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.note-title-input {
    flex: 1;
    border: none;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    outline: none;
    background: transparent;
}

.note-title-input::placeholder {
    color: #a0aec0;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.editor-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.delete-btn {
    background: #fed7d7;
    color: #e53e3e;
}

.delete-btn:hover {
    background: #feb2b2;
    transform: translateY(-2px);
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 30px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.toolbar-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #4a5568;
}

.toolbar-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.toolbar-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.category-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #4a5568;
    cursor: pointer;
    outline: none;
}

.category-select:focus {
    border-color: #667eea;
}

/* Editor Area */
.editor-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.editor-content {
    min-height: 300px;
    outline: none;
    font-size: 1rem;
    line-height: 1.6;
    color: #2d3748;
}

.editor-content:empty:before {
    content: attr(placeholder);
    color: #a0aec0;
    font-style: italic;
}

.preview-content {
    min-height: 300px;
    font-size: 1rem;
    line-height: 1.6;
    color: #2d3748;
}

.preview-content h1, .preview-content h2, .preview-content h3 {
    margin: 20px 0 10px 0;
    color: #2d3748;
}

.preview-content p {
    margin-bottom: 15px;
}

.preview-content ul, .preview-content ol {
    margin: 10px 0 10px 20px;
}

.preview-content li {
    margin-bottom: 5px;
}

.preview-content strong {
    font-weight: 600;
}

.preview-content em {
    font-style: italic;
}

.preview-content u {
    text-decoration: underline;
}

/* Note Info */
.note-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    color: #718096;
    font-size: 0.85rem;
}

.note-stats {
    display: flex;
    gap: 20px;
}

/* Empty State */
.empty-state {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.empty-content {
    text-align: center;
    color: #718096;
}

.empty-content i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-content h3 {
    margin-bottom: 10px;
    color: #2d3748;
    font-weight: 600;
}

.empty-content p {
    margin-bottom: 30px;
    max-width: 300px;
    line-height: 1.5;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar,
.editor-area::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.editor-area::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb,
.editor-area::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.editor-area::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        height: auto;
        min-height: 100vh;
    }
    
    .app-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 40vh;
    }
    
    .editor-header {
        padding: 15px 20px;
    }
    
    .toolbar {
        padding: 10px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .editor-area {
        padding: 20px;
    }
    
    .note-info {
        padding: 10px 20px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}