

body {
    font-family: Arial, sans-serif;
    max-width: 600px;
    margin: 20px auto;
    background: #f5f5f5;
    padding: 0 20px;
}

h1 {
    text-align: center;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.add-note {
    display: flex;
    gap: 10px;
    flex: 1;
}

.toggle-view-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-view-btn:hover {
    background: #45a049;
}

input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

button {
    padding: 10px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    transition: all 0.2s;
}

button:hover {
    background: #f0f0f0;
}


.list-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.list-view li {
    background: rgb(251, 255, 246);
    padding: 10px;
    list-style: none;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table-view {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    padding: 0;
}

.table-view li {
    background: rgb(204, 243, 255);
    padding: 10px;
    list-style: none;
    display: contents; 
}

.table-view li span {
    background: rgb(204, 243, 255);
    padding: 10px;
    border-radius: 5px;
    word-break: break-word;
}

.table-view li button {
    background: rgb(204, 243, 255);
    border: 1px solid #999;
}


li {
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

li span {
    flex: 1;
}

@media (max-width: 500px) {
    .controls {
        flex-direction: column;
    }
    
    .add-note {
        width: 100%;
    }
    
    .toggle-view-btn {
        width: 100%;
    }
}

.note-title {
    font-weight: bold;
    font-size: 18px;
}

.note-date {
    font-size: 12px;
    color: gray;
}

.note-text {
    margin-top: 5px;
}

.archived {
    opacity: 0.5;
}

.archived .note-title,
.archived .note-text,
.archived .note-date {
    text-decoration: line-through;
}

.note-content {
    flex: 1;
}