/* Estilos adicionales para la agenda de contactos */

/* Header y búsqueda */
.search-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
}

#searchInput {
    margin-bottom: 0;
}

/* Grid de contactos */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* Tarjetas de contacto */
.contact-card {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    background-color: var(--card-background-color);
    transition: box-shadow 0.2s ease;
}

.contact-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.contact-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    line-height: 1.3;
}

.contact-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: var(--border-radius);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background-color 0.2s ease;
}

.action-btn:hover {
    background-color: var(--dropdown-hover-background-color);
}

.edit-btn {
    color: var(--primary);
}

.delete-btn {
    color: var(--del-color);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.contact-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Diálogo */
dialog {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90vw;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--muted-color);
}

.close-btn:hover {
    background-color: var(--dropdown-hover-background-color);
    color: var(--color);
}

dialog article {
    margin: 0;
    padding: 1.5rem;
}

dialog header {
    margin-bottom: 1rem;
}

dialog footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted-color);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .search-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .contacts-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .contact-actions {
        align-self: flex-end;
    }
}

/* Variables de tema específicas */
:root:not([data-theme="dark"]) {
    --border-color: hsl(205, 20%, 90%);
    --card-background-color: hsl(0, 0%, 100%);
    --muted-color: hsl(205, 10%, 50%);
    --del-color: hsl(353, 100%, 62%);
}

[data-theme="dark"] {
    --border-color: hsl(205, 15%, 25%);
    --card-background-color: hsl(205, 20%, 15%);
    --muted-color: hsl(205, 10%, 65%);
    --del-color: hsl(353, 100%, 70%);
}
