/**
 * ProCargo Manifests List Styles
 * EXACT visual match to Next.js ManifestsList.tsx
 * 
 * @package ProCargo
 * @since 2.0.14
 */

/* ============================================
   LOADING SCREEN (matches Next.js loading)
   ============================================ */
.procargo-loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.procargo-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.procargo-spinner {
    width: 32px;
    height: 32px;
    animation: spin 0.8s linear infinite;
}

.procargo-spinner-blue {
    color: #5EC7F2;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.procargo-loading-text {
    color: #6b7280;
}

body.dark-theme .procargo-loading-text {
    color: #9ca3af;
}

/* ============================================
   ERROR ALERT (matches Next.js error)
   ============================================ */
.procargo-error-alert {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.75rem;
    padding: 1.5rem;
    animation: fade-in 0.3s ease;
}

body.dark-theme .procargo-error-alert {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.procargo-error-content {
    display: flex;
    align-items: center;
    color: #ef4444;
    gap: 0.75rem;
}

body.dark-theme .procargo-error-content {
    color: #f87171;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   EMPTY STATE (matches Next.js empty)
   ============================================ */
.procargo-empty-state-card {
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
}

body.dark-theme .procargo-empty-state-card {
    background: #374151;
    border-color: #4b5563;
}

.procargo-empty-icon {
    width: 48px;
    height: 48px;
    color: rgba(94, 199, 242, 0.5);
    margin: 0 auto 1rem;
}

.procargo-empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

body.dark-theme .procargo-empty-title {
    color: #ffffff;
}

.procargo-empty-description {
    margin-bottom: 1.5rem;
    color: #6b7280;
}

body.dark-theme .procargo-empty-description {
    color: #9ca3af;
}

/* ============================================
   TABLE CARD (matches Next.js main container)
   ============================================ */
.procargo-table-card {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    overflow: hidden;
}

body.dark-theme .procargo-table-card {
    background: #374151;
    border-color: #4b5563;
}

/* ============================================
   TABLE HEADER (matches Next.js filters section)
   ============================================ */
.procargo-table-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

body.dark-theme .procargo-table-header {
    border-bottom-color: #4b5563;
}

.procargo-table-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.procargo-table-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

body.dark-theme .procargo-table-title {
    color: #ffffff;
}

/* ============================================
   FILTERS PANEL (matches Next.js filters)
   ============================================ */
.procargo-filters-panel {
    margin-top: 1rem;
}

.procargo-filters-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .procargo-filters-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.procargo-filter-item {
    display: flex;
    flex-direction: column;
}

.procargo-filter-label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: #374151;
}

body.dark-theme .procargo-filter-label {
    color: #d1d5db;
}

.procargo-filter-input-group {
    position: relative;
}

.procargo-input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

.procargo-filter-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #f3f4f6;
    background: #ffffff;
    color: #1f2937;
    transition: all 0.3s ease;
}

.procargo-filter-input-group .procargo-filter-input {
    padding-left: 2.25rem;
}

.procargo-filter-input:focus {
    outline: none;
    border-color: #5EC7F2;
    box-shadow: 0 0 0 3px rgba(94, 199, 242, 0.1);
}

body.dark-theme .procargo-filter-input {
    background: #4b5563;
    border-color: #6b7280;
    color: #ffffff;
}

.procargo-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.procargo-btn-filter {
    flex: 1;
    padding: 0.5rem 1rem;
    justify-content: center;
}

/* ============================================
   BUTTONS (matches Next.js gradients and styles)
   ============================================ */
.procargo-btn-gradient {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(88deg, #5368B9 -25.12%, #5EC7F2 107.96%);
    color: #ffffff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.procargo-btn-gradient:hover {
    background: linear-gradient(88deg, #5EC7F2 -25.12%, #5368B9 107.96%);
    box-shadow: 0 0 20px rgba(105, 255, 255, 0.3);
    transform: scale(1.02);
}

body.dark-theme .procargo-btn-gradient {
    background: #4b5563;
}

body.dark-theme .procargo-btn-gradient:hover {
    background: #6b7280;
}

.procargo-btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.procargo-btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.procargo-btn-secondary-border {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #f3f4f6;
    background: transparent;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.3s ease;
}

.procargo-btn-secondary-border:hover {
    background: #f9fafb;
}

body.dark-theme .procargo-btn-secondary-border {
    border-color: #4b5563;
    color: #ffffff;
}

body.dark-theme .procargo-btn-secondary-border:hover {
    background: #4b5563;
}

/* ============================================
   TABLE (matches Next.js table exactly)
   ============================================ */
.procargo-table-overflow {
    overflow-x: auto;
}

.procargo-table {
    width: 100%;
    border-collapse: collapse;
}

.procargo-table thead tr {
    border-bottom: 1px solid #f3f4f6;
}

body.dark-theme .procargo-table thead tr {
    border-bottom-color: #4b5563;
}

.procargo-table-th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
}

body.dark-theme .procargo-table-th {
    color: #9ca3af;
}

.procargo-table-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.procargo-table-row:hover {
    background-color: #f9fafb;
}

body.dark-theme .procargo-table-row {
    border-bottom-color: #4b5563;
}

body.dark-theme .procargo-table-row:hover {
    background-color: #4b5563;
}

.procargo-table-td {
    padding: 1rem 1.5rem;
    white-space: nowrap;
}

.procargo-table-cell-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.procargo-icon-blue {
    color: #5EC7F2;
    flex-shrink: 0;
}

.procargo-table-cell-text-bold {
    color: #1f2937;
    font-weight: 500;
}

body.dark-theme .procargo-table-cell-text-bold {
    color: #ffffff;
}

/* ============================================
   BADGES (matches Next.js badges)
   ============================================ */
.procargo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.procargo-badge-light-blue {
    background: rgba(94, 199, 242, 0.1);
    color: #5EC7F2;
}

.procargo-badge svg {
    flex-shrink: 0;
}

/* ============================================
   TABLE ACTION LINK (matches Next.js view link)
   ============================================ */
.procargo-table-action-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    color: #5EC7F2;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.procargo-table-action-link:hover {
    background: rgba(94, 199, 242, 0.1);
}

.procargo-table-action-link svg {
    flex-shrink: 0;
}

/* ============================================
   PAGINATION (matches Next.js pagination exactly)
   ============================================ */
.procargo-pagination-border {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f3f4f6;
}

body.dark-theme .procargo-pagination-border {
    border-top-color: #4b5563;
}

.procargo-pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.procargo-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    border: 2px solid #374151;
    background: transparent;
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.procargo-pagination-btn:hover:not(:disabled) {
    background: #f9fafb;
}

.procargo-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.dark-theme .procargo-pagination-btn {
    color: #ffffff;
    border-color: #ffffff;
}

body.dark-theme .procargo-pagination-btn:hover:not(:disabled) {
    background: #4b5563;
}

.procargo-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.procargo-pagination-page {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #1f2937;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.procargo-pagination-page:hover {
    background: #f3f4f6;
}

.procargo-pagination-page-active {
    background: linear-gradient(88deg, #5368B9 -25.12%, #5EC7F2 107.96%);
    color: #ffffff;
}

.procargo-pagination-page-active:hover {
    background: linear-gradient(88deg, #5368B9 -25.12%, #5EC7F2 107.96%);
}

body.dark-theme .procargo-pagination-page {
    color: #ffffff;
}

body.dark-theme .procargo-pagination-page:hover {
    background: #4b5563;
}

body.dark-theme .procargo-pagination-page-active {
    background: #4b5563;
}

body.dark-theme .procargo-pagination-page-active:hover {
    background: #4b5563;
}

/* ============================================
   PAGINATION STATS (matches Next.js footer stats)
   ============================================ */
.procargo-pagination-stats {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    background: #fafdff;
}

body.dark-theme .procargo-pagination-stats {
    border-top-color: #4b5563;
    color: #d1d5db;
    background: #1e1e1e;
}

.procargo-pagination-stats p {
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .procargo-table-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .procargo-filters-grid {
        grid-template-columns: 1fr;
    }
    
    .procargo-filter-actions {
        grid-column: 1;
    }
    
    .procargo-pagination-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .procargo-pagination-btn-nav {
        width: 100%;
        justify-content: center;
    }
    
    .procargo-pagination-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.procargo-manifests-list-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 1.5rem 2rem;
    min-height: 100vh;
    background: #fafdff;
}

body.dark-theme .procargo-manifests-list-container {
    background: #1e1e1e;
}
