/* Préstamos Responsive Styles */

/* Container */
.prestamos-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Filters Container */
.filters-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Stats Cards */
.stats-card {
    transition: transform 0.2s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-2px);
}

/* Table Responsive */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    .table-responsive th,
    .table-responsive td {
        white-space: nowrap;
        padding: 0.75rem 0.5rem;
    }
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .prestamos-container {
        padding: 0;
    }
    
    .filters-container {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-card .text-2xl {
        font-size: 1.5rem;
    }
}

/* Button Responsive */
@media (max-width: 768px) {
    #new-loan-btn {
        display: none !important;
    }
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-prospected {
    background-color: #fef3c7;
    color: #92400e;
}

.status-approved {
    background-color: #d1fae5;
    color: #065f46;
}

.status-active {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background-color: #e5e7eb;
    color: #374151;
}

.status-overdue {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-cancelled {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-buttons button {
        width: 100%;
        justify-content: center;
    }
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Preloader */
#prestamos-preloader {
    z-index: 9999;
}

/* Empty State */
.empty-state-icon {
    width: 6rem;
    height: 6rem;
    margin: 0 auto 1rem;
    background-color: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pagination-button {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #374151;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.pagination-button:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-button.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Responsive Pagination */
@media (max-width: 640px) {
    .pagination-container {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination-button {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Filter Labels */
.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
}

/* Input Focus States */
input:focus,
select:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    border-color: #3b82f6;
}

/* Button Hover Effects */
button:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease-in-out;
}

/* Card Shadows */
.bg-white {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.rounded-xl {
    border-radius: 0.75rem;
}

/* Mobile Menu Button */
@media (max-width: 768px) {
    .mobile-menu-button {
        display: block;
    }
}

/* Desktop Menu Button */
@media (min-width: 769px) {
    .mobile-menu-button {
        display: none;
    }
}

/* Floating Action Button */
#floating-prospect-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background-color: #16a34a;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    transition: all 0.3s ease;
}

#floating-prospect-btn:hover {
    background-color: #15803d;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

#floating-prospect-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#floating-prospect-btn i {
    font-size: 1.25rem;
}

/* Hide floating button on desktop */
@media (min-width: 768px) {
    #floating-prospect-btn {
        display: none !important;
    }
}

/* Show floating button only on mobile */
@media (max-width: 767px) {
    #floating-prospect-btn {
        display: flex !important;
    }
}

/* Client Search Styles */
#client-search-results {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.client-search-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.client-search-item:hover {
    background-color: #f9fafb;
}

.client-search-item:last-child {
    border-bottom: none;
}

.client-search-item.selected {
    background-color: #dbeafe;
    color: #1e40af;
}

.client-search-item .client-name {
    font-weight: 500;
    color: #111827;
}

.client-search-item .client-dni {
    font-size: 0.875rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

.client-search-item .client-phone {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

#selected-client-info {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

#selected-client-info .font-medium {
    color: #111827;
}

#selected-client-info .text-sm {
    color: #6b7280;
}

#clear-client-selection {
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

#clear-client-selection:hover {
    background-color: #fee2e2;
}

/* Loading state for search */
.client-search-loading {
    padding: 0.75rem 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.client-search-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* No results state */
.client-search-no-results {
    padding: 0.75rem 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
}
