/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
}

.back-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #4a5568;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-input {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 14px;
    width: 250px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Main layout */
.main {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    height: calc(100vh - 120px);
}

/* Sidebar */
.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.categories h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-item {
    background: none;
    border: none;
    padding: 12px 15px;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #718096;
}

.category-item:hover {
    background: #f7fafc;
    color: #4a5568;
}

.category-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.stats {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: #667eea;
}

.stat-label {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content area */
.content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

/* Notes grid */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.note-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid #667eea;
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.note-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
}

.note-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.note-card:hover .note-actions {
    opacity: 1;
}

.note-action-btn {
    background: none;
    border: none;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.note-action-btn:hover {
    background: #f7fafc;
}

.edit-btn {
    color: #667eea;
}

.delete-btn {
    color: #e53e3e;
}

.note-content {
    color: #718096;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #a0aec0;
}

.note-category {
    background: #f7fafc;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.note-tag {
    background: #e2e8f0;
    color: #4a5568;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #4a5568;
}

.empty-state p {
    margin-bottom: 30px;
    line-height: 1.6;
}

.empty-add-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-content.small {
    max-width: 400px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 25px;
}

.modal-header h2,
.modal-header h3 {
    color: #2d3748;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f7fafc;
    color: #718096;
}

.modal-body {
    padding: 0 30px 25px;
}

.note-title-input,
.note-category-select,
.note-content-input,
.tags-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    font-family: inherit;
}

.note-title-input:focus,
.note-category-select:focus,
.note-content-input:focus,
.tags-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.note-content-input {
    min-height: 200px;
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 25px 30px;
    border-top: 1px solid #e2e8f0;
}

.cancel-btn,
.save-btn,
.delete-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.cancel-btn {
    background: #f7fafc;
    color: #718096;
}

.cancel-btn:hover {
    background: #e2e8f0;
}

.save-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.delete-btn {
    background: #e53e3e;
    color: white;
}

.delete-btn:hover {
    background: #c53030;
}

/* Category colors */
.note-card[data-category="personal"] {
    border-left-color: #38b2ac;
}

.note-card[data-category="work"] {
    border-left-color: #667eea;
}

.note-card[data-category="ideas"] {
    border-left-color: #ed8936;
}

.note-card[data-category="todo"] {
    border-left-color: #48bb78;
}

/* Responsive design */
@media (max-width: 768px) {
    .main {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .sidebar {
        order: 2;
    }

    .content {
        order: 1;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-controls {
        width: 100%;
        justify-content: center;
    }

    .search-input {
        width: 200px;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 15px 20px;
    }

    .sidebar,
    .content {
        padding: 20px;
    }

    .search-input {
        width: 150px;
    }
}
