/* public/css/components.css */

/* --- GRILLAS RESPONSIVAS (MOBILE-FIRST) --- */
.grid-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.grid-5-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.grid-3-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.grid-3fr-2fr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 576px) {
    .grid-cards {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    .grid-5-cols {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .grid-5-cols {
        grid-template-columns: repeat(5, 1fr);
    }
    .grid-3-cols {
        grid-template-columns: repeat(3, 1fr);
    }
    .grid-3fr-2fr {
        grid-template-columns: 3fr 2fr;
    }
}


/* --- FORMULARIOS ESTILO APPSHEET (CLAROS Y TÁCTILES) --- */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--secondary-color);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    font-family: var(--font-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Checkbox o select de servicios vinculados */
.services-selection-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    background-color: var(--secondary-color);
}

.service-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
}

.service-select-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* --- BOTONES PREMIUM TÁCTILES --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-main);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    filter: brightness(0.9);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e8eaed;
}

.btn-danger {
    background-color: var(--color-danger);
    color: #ffffff;
}

.btn-danger:hover {
    filter: brightness(0.9);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Botón Flotante Redondo (FAB) para Móvil */
.fab-btn {
    position: fixed;
    bottom: 80px; /* Sobre la barra inferior */
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: transform var(--transition-fast);
}

.fab-btn:active {
    transform: scale(0.95);
}

.fab-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* --- MODALES (BOTTOM SHEETS EN MÓVIL, CENTRADOS EN DESKTOP) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 500;
    display: none;
    justify-content: center;
    align-items: flex-end; /* Bottom sheet en móvil */
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    width: 100%;
    max-height: 85vh;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Cerrar Modal */
.btn-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.btn-close svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* --- ADJUNTOS EN LA OPORTUNIDAD --- */
.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background-color: var(--secondary-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    text-decoration: none;
    color: var(--text-primary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
}

.attachment-info svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    flex-shrink: 0;
}

.attachment-info:hover {
    color: var(--primary-color);
}

.attachment-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-danger);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-delete:hover {
    background-color: var(--color-danger-light);
}

.attachment-delete svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Ficha de Detalles de Prospecto */
.prospect-details-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.details-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

/* ANIMACIONES */
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* MODALES EN ESCRITORIO (>= 768px) */
@media (min-width: 768px) {
    .modal-overlay {
        align-items: center; /* Centrar en escritorio */
    }

    .modal-content {
        max-width: 550px;
        border-radius: 12px; /* Redondear todos los bordes */
        max-height: 80vh;
        animation: scaleIn 0.2s ease;
    }
}

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