:root {
    --bg-color: #fafafa;
    --text-color: #1c1b1f;
    --card-bg: #ffffff;
    --border-color: #e7e0ec;
    --primary-color: #1976d2;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

.dark-theme {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --border-color: #49454f;
    --shadow: 0 2px 10px rgba(0,0,0,0.4);
}

body.dark-theme {
    background-color: var(--bg-color);
    background-image:
        /* Manchas leves de tinta oscuras */
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.01) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(255,255,255,0.015) 0%, transparent 45%),
        /* Líneas horizontales azules desvaídas oscuras */
        repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(25, 118, 210, 0.2) 28px, rgba(25, 118, 210, 0.2) 29px),
        /* Fondo base oscuro */
        linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 50%, #1a1a1a 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 30px, 100% 100%;
    background-repeat: no-repeat, no-repeat, no-repeat, repeat, no-repeat;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.2), 0 0 20px rgba(0,0,0,0.3);
}

.dark-theme #update-message {
    background: rgba(0,0,0,0.7);
}

.dark-theme #update-message > div {
    background: var(--card-bg);
    color: var(--text-color);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    transition: var(--transition);
    min-height: 100vh;
    /* Fondo de cuaderno antiguo */
    background-image:
        /* Manchas leves de tinta */
        radial-gradient(circle at 20% 50%, rgba(0,0,0,0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0,0,0,0.01) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(0,0,0,0.015) 0%, transparent 45%),
        /* Líneas horizontales azules desvaídas */
        repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(25, 118, 210, 0.1) 28px, rgba(25, 118, 210, 0.1) 29px),
        /* Fondo base amarillento vintage */
        linear-gradient(135deg, #fefefe 0%, #f9f6f0 50%, #fefefe 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 30px, 100% 100%;
    background-repeat: no-repeat, no-repeat, no-repeat, repeat, no-repeat;
    /* Bordes desgastados */
    box-shadow: inset 0 0 50px rgba(0,0,0,0.05), 0 0 20px rgba(139, 69, 19, 0.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    margin: 0;
    font-size: 2rem;
}

.theme-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.theme-btn:hover {
    background: #1565c0;
    transform: scale(1.1);
}

form {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: grid;
    gap: 15px;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0,123,255,0.5);
}

button[type="submit"] {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

button[type="submit"]:hover {
    background: #1565c0;
    transform: translateY(-2px);
}

#notes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.note {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: relative;
    transition: var(--transition);
    animation: fadeIn 0.5s ease-in;
}

.note:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.note.high {
    border-left: 5px solid var(--danger-color);
}

.note.medium {
    border-left: 5px solid var(--warning-color);
}

.note.low {
    border-left: 5px solid var(--success-color);
}

.note h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.note.high h3::before {
    content: '🔴';
}

.note.medium h3::before {
    content: '🟡';
}

.note.low h3::before {
    content: '🟢';
}

.note p {
    margin: 10px 0;
    line-height: 1.5;
}

.note .actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.note button {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.edit-btn {
    background: var(--primary-color);
    color: white;
}

.edit-btn:hover {
    background: #1565c0;
    transform: scale(1.05);
}

.delete-btn {
    background: var(--danger-color);
    color: white;
}

.delete-btn:hover {
    background: #d32f2f;
    transform: scale(1.05);
}

.move-btn {
    background: var(--warning-color);
    color: white;
}

.move-btn:hover {
    background: #f57c00;
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Filtros */
#notes-list::before {
    content: '';
    grid-column: 1 / -1;
    margin-bottom: 10px;
}

#notes-list::before + div {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    grid-column: 1 / -1;
}

#notes-list button {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

#notes-list button:hover {
    background: #1565c0;
}

.filter-btn {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Responsividad */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
    }

    #notes-list {
        grid-template-columns: 1fr;
    }

    form {
        padding: 15px;
    }
}