
:root {
    --pico-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --pico-grid-spacing-vertical: 2rem;
    --pico-grid-spacing-horizontal: 1.5rem;
}


body {
    background-color: #f8f9fa;
    color: #212529;
    transition: background-color 0.3s ease, color 0.3s ease;
}


.container {
    max-width: 1100px;
}


header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

header .grid {
    grid-template-columns: 1fr auto;
    gap: 1rem;
    margin: 0;
}


#buscador {
    padding: 0.75rem;
    border-radius: 2rem;
    border: 1px solid #ced4da;
    background-color: #ffffff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;

}


#btn-agregar {
    background-color: #212529;
    border-color: #212529;
    color: #ffffff;
    border-radius: 2rem;
}


#btn-tema {
    background-color: transparent;
    color: #6c757d;
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    height: auto;
    line-height: 1;
    border: none;
}

#btn-tema:hover {
    border-color: #212529;
    color: #212529;
    background-color: #e9ecef;
}


#lista-contactos {
    --grid-spacing-vertical: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}


.card-contacto {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.card-contacto:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-contacto h4 {
    margin: 0 0 1.5rem 0;
    font-weight: 600;
    font-size: 1.25rem;
}


.info p {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: #000000;
    word-break: break-word;
}

.info p svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}


.card-acciones {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.card-acciones button {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    border-radius: 50%;
    background-color: transparent;
    border: 1px solid #ced4da;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.card-acciones .btn-editar:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.card-acciones .btn-borrar:hover {
    border-color: #dc3545;
    color: #dc3545;
}

.card-acciones button svg {
    width: 14px;
    height: 14px;
}


dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

dialog[open] {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease-out;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}


@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

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

    .card-contacto {
        padding: 1rem;
    }
}


.modo-claro {
    background-color: #f8f9fa;
    color: #212529;
}

.modo-claro .card-contacto {
    background-color: #ffffff;
    border-color: #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    color: #212529;
}

.modo-claro #buscador {
    background-color: #ffffff;
    border-color: #ced4da;
    color: #212529;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
}

.modo-claro dialog[open] {
    background-color: #ffffff;
    color: #212529;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
}

.modo-claro .card-acciones button {
    border-color: #ced4da;
    color: #6c757d;
}

.modo-claro .btn-editar:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.modo-claro .btn-borrar:hover {
    border-color: #dc3545;
    color: #dc3545;
}


.modo-oscuro {
    background-color: #121212;
    color: #f1f1f1;
    
}

.modo-oscuro .card-contacto {
    background-color: #1e1e1e;
    border-color: #333;
    color: #f1f1f1;
    box-shadow: 0 0.125rem 0.25rem rgba(255, 255, 255, 0.05);
}

.modo-oscuro #buscador {
    background-color: #1e1e1e;
    border-color: #444;
    color: #f1f1f1;
}

.modo-oscuro dialog[open] {
    background-color: #1e1e1e;
    color: #f1f1f1;
}

.modo-oscuro .card-acciones button {
    border-color: #555;
    color: #ccc;
}

.modo-oscuro .btn-editar:hover {
    border-color: #66b0ff;
    color: #66b0ff;
}

.modo-oscuro .btn-borrar:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}
.modo-oscuro h1,
.modo-oscuro h4,
.modo-oscuro p,
.modo-oscuro label,
.modo-oscuro input,
.modo-oscuro span {
    color: #f1f1f1;
}
.modo-claro .card-contacto h4 {
    color: #000000;
}
.modo-claro .card-contacto h4 {
    font-weight: 700;
    letter-spacing: 0.5px;
}
.modo-claro header h1 {
    color: #000000;
}
header h1 {
    margin: 0;
    font-size: 2.5rem;
    color: inherit;
}

.modo-claro header h1 {
    color: #000000;
}

header .grid {
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
}


