/* --- Modern UI Core --- */
body {
    background-color: #f4f7f6;
    font-family: 'Roboto', "Segoe UI", sans-serif;
    color: #4a4a4a; /* Color base texto */
}

/* --- Search Bar Container (REPARADO) --- */
.search-container {
    width: 100%;
    padding: 20px 0 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
}

#buscador form {
    width: 90%;
    max-width: 700px;
}

#buscador .input-field {
    background-color: #fff;
    border-radius: 50px;
    height: 54px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
}

#buscador .input-field:hover,
#buscador .input-field:focus-within {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

#buscador input[type=search] {
    border: none !important;
    box-shadow: none !important;
    height: 100% !important;
    width: 100% !important;
    padding-left: 55px !important;
    padding-right: 50px !important;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin: 0 !important;
    background: transparent !important;
}

#buscador .label-icon {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
}
#buscador .label-icon i { color: #fbc02d; }

#buscador .close-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #9e9e9e;
    cursor: pointer;
    transition: color 0.3s;
}
#buscador .close-icon:hover { color: #d32f2f; }


/* --- Cards (Notas) --- */
.card {
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: #fff;
    display: flex;
    flex-direction: column; 
    height: 100%;
    min-height: 250px;
    position: relative;
}

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

.card-title {
    font-weight: 800 !important;
    font-size: 1.3rem !important;
    line-height: 1.3 !important;
    margin-bottom: 15px !important;
    display: block;
    padding-bottom: 5px;
    color: #333; /* Color por defecto */
}

.card-content {
    padding: 24px 24px 0 24px !important;
    flex-grow: 1; 
    overflow: hidden;
    color: #4a4a4a; /* Color por defecto */
}

/* Footer de Tarjeta */
.card-action {
    background-color: rgba(255, 255, 255, 0.6) !important;
    border-top: 1px solid rgba(0,0,0,0.05) !important;
    padding: 12px 15px !important;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 16px 16px;
    z-index: 5;
}

/* Botones Icono (Notas) */
.btn-icon {
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.2s;
    cursor: pointer;
    background-color: transparent;
    border: none;
    position: relative;
    z-index: 10;
}
.btn-icon:hover { background-color: rgba(0, 0, 0, 0.08); transform: scale(1.1); }
.btn-icon i { font-size: 20px; color: #555; }
.btn-icon.delete-btn:hover { background-color: rgba(244, 67, 54, 0.1); }
.btn-icon.delete-btn:hover i { color: #d32f2f; }
.btn-icon.edit-btn:hover { background-color: rgba(33, 150, 243, 0.1); }
.btn-icon.edit-btn:hover i { color: #1976d2; }

/* --- AJUSTES: Estilos Específicos para Botones --- */
.settings-btn {
    border-radius: 50px !important; /* Pill shape forzado */
    height: 44px !important;
    line-height: 44px !important;
    padding: 0 25px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px; /* Espacio entre icono y texto */
    min-width: 140px; /* Ancho mínimo para uniformidad */
}

.settings-btn i {
    margin: 0 !important;
    line-height: inherit !important;
}

/* Corrección especial para el input de archivo de Materialize */
.file-field .btn {
    border-radius: 50px !important;
    height: 44px !important;
    line-height: 44px !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    float: none !important; /* Quitar float para usar flexbox */
}

.d-flex-center {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* --- Dark Mode (CORREGIDO TEXTO NEGRO) --- */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .card {
    background-color: #1e1e1e;
}

/* Forzar texto blanco en modo oscuro */
body.dark-mode .card-title,
body.dark-mode .card-title a,
body.dark-mode .card-content,
body.dark-mode .card-content p,
body.dark-mode .card-content span,
body.dark-mode .card-content div {
    color: #e0e0e0 !important;
}

body.dark-mode .settings-card {
    background-color: #1e1e1e !important;
    color: #e0e0e0;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode .input-field label {
    color: #e0e0e0 !important;
}

body.dark-mode #search {
    color: #333 !important;
}


body.dark-mode .btn-icon i {
    color: #b0b0b0;
}
body.dark-mode .card-action {
    background-color: rgba(0,0,0,0.2) !important;
    border-top: 1px solid rgba(255,255,255,0.05) !important;
}

/* Utilidad */
.sort-btn {
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    padding: 0 18px;
    height: 34px;
    line-height: 32px;
    background: #fff;
    color: #616161;
    margin-right: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex; align-items: center;
}
body.dark-mode .sort-btn {
    background-color: #2c2c2c;
    border-color: #444;
    color: #ccc;
}