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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1em;
    opacity: 0.9;
}

.controls {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

#noteTitle {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1em;
    transition: border-color 0.3s;
}

#noteTitle:focus {
    outline: none;
    border-color: #667eea;
}

#noteContent {
    width: 100%;
    height: 150px;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

#noteContent:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

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

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

.btn-clear {
    background: #f5f5f5;
    color: #333;
}

.btn-clear:hover {
    background: #e0e0e0;
}

.search-filter {
    padding: 20px 30px;
    display: flex;
    gap: 10px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

#searchBox {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
}

#sortBy {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 1em;
}

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

.note-card {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
    position: relative;
}

.note-card:hover {
    border-color: #667eea;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.1);
    transform: translateY(-5px);
}

.note-card h3 {
    color: #667eea;
    margin-bottom: 10px;
    word-break: break-word;
}

.note-card p {
    color: #555;
    line-height: 1.6;
    word-break: break-word;
}

.note-card .timestamp {
    font-size: 0.85em;
    color: #999;
    margin-top: 15px;
    margin-bottom: 10px;
}

.note-card .actions {
    display: flex;
    gap: 10px;
}

.note-card button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

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

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

.btn-edit {
    background: #4ecdc4;
    color: white;
}

.btn-edit:hover {
    background: #45b7ad;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .notes-list {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.8em;
    }

    .button-group {
        flex-direction: column;
    }

    .search-filter {
        flex-direction: column;
    }
}
