/**
 * ProCargo Lists Styles
 * Unified styles for Shipments, Simplified Shipments, and Shipping Orders lists
 * Matches Next.js visual design exactly
 * 
 * @package ProCargo
 * @since 2.0.18
 */

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */

.procargo-simplified-list-container,
.procargo-shipments-list-container {
    max-width: 100%;
    margin: 0 auto;
}

/* ========================================
   LOADING STATE
   ======================================== */

.procargo-loading-screen {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

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

.procargo-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(94, 199, 242, 0.2);
    border-top-color: #5EC7F2;
    border-radius: 50%;
    animation: procargo-spin 1s linear infinite;
}

.procargo-spinner-blue {
    border-color: rgba(94, 199, 242, 0.2);
    border-top-color: #5EC7F2;
}

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

.procargo-loading-text {
    color: #666;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

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

/* ========================================
   ERROR STATE
   ======================================== */

.procargo-error-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

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

.procargo-error-content svg {
    flex-shrink: 0;
}

.procargo-error-content p {
    margin: 0;
    font-weight: 500;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.procargo-empty-state-card {
    background: #E3F4FF;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
}

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

.procargo-empty-icon {
    color: #5EC7F2;
    margin: 0 auto 16px;
}

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

.procargo-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: #141414;
    margin: 0 0 8px;
    text-transform: uppercase;
}

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

.procargo-empty-description {
    color: #666;
    font-size: 14px;
    margin: 0 0 24px;
}

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

.procargo-btn-gradient {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(88deg, #5368B9 -25.12%, #5EC7F2 107.96%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 12px;
    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%);
    transform: translateY(-2px);
}

.procargo-btn-with-icon svg {
    width: 20px;
    height: 20px;
}

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

body.dark-theme .procargo-btn-gradient:hover {
    background: #1f2937;
}

/* ========================================
   TABLE CARD
   ======================================== */

.procargo-table-card {
    background: #E3F4FF;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

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

.procargo-table-overflow {
    overflow-x: auto;
    position: relative;
}

/* ========================================
   TABLE STYLES
   ======================================== */

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

.procargo-table-header-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.procargo-table-th {
    padding: 16px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    white-space: nowrap;
}

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

.procargo-table-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

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

.procargo-table-row:hover {
    background-color: rgba(94, 199, 242, 0.05);
}

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

.procargo-table-td {
    padding: 16px 24px;
    white-space: nowrap;
    vertical-align: middle;
}

/* Actions column — fixed width, centred, no shrink */
.procargo-table th:last-child,
.procargo-table td:last-child,
.procargo-table-th:last-child,
.procargo-table-td:last-child {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
}

/* ========================================
   TABLE CELL CONTENT
   ======================================== */

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

.procargo-table-cell-text-bold {
    color: #141414;
    font-size: 14px;
    font-weight: 500;
}

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

.procargo-table-cell-text-muted {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
}

body.dark-theme .procargo-table-cell-text-muted {
    color: #6b7280;
}

.procargo-table-truncate {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* ========================================
   BADGES
   ======================================== */

.procargo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.procargo-badge svg {
    width: 16px;
    height: 16px;
}

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

.procargo-badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

body.dark-theme .procargo-badge-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

.procargo-badge-yellow {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

body.dark-theme .procargo-badge-yellow {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border-color: rgba(234, 179, 8, 0.3);
}

.procargo-badge-green {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

body.dark-theme .procargo-badge-green {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.3);
}

.procargo-badge-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

body.dark-theme .procargo-badge-red {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.procargo-badge-gray {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

body.dark-theme .procargo-badge-gray {
    background: #374151;
    color: #9ca3af;
    border-color: #4b5563;
}

/* ========================================
   DROPDOWN MENU
   ======================================== */

.procargo-dropdown-wrapper {
    position: relative;
}

.procargo-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.procargo-dropdown-trigger:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.dark-theme .procargo-dropdown-trigger {
    color: #d1d5db;
}

body.dark-theme .procargo-dropdown-trigger:hover {
    background: #4b5563;
}

.procargo-dropdown-menu {
    position: fixed;
    width: 192px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    overflow: hidden;
}

body.dark-theme .procargo-dropdown-menu {
    background: #1f2937;
    border-color: #374151;
}

.procargo-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.procargo-dropdown-item svg {
    width: 16px;
    height: 16px;
}

.procargo-dropdown-item-primary {
    color: #5EC7F2;
}

.procargo-dropdown-item-primary:hover {
    background: rgba(94, 199, 242, 0.1);
}

body.dark-theme .procargo-dropdown-item-primary:hover {
    background: #374151;
}

.procargo-dropdown-item-secondary {
    color: #6b7280;
}

.procargo-dropdown-item-secondary:hover {
    background: rgba(107, 114, 128, 0.1);
}

body.dark-theme .procargo-dropdown-item-secondary {
    color: #d1d5db;
}

body.dark-theme .procargo-dropdown-item-secondary:hover {
    background: #374151;
}

.procargo-dropdown-item-warning {
    color: #f59e0b;
}

.procargo-dropdown-item-warning:hover {
    background: rgba(245, 158, 11, 0.1);
}

.procargo-dropdown-item-success {
    color: #22c55e;
}

.procargo-dropdown-item-success:hover {
    background: rgba(34, 197, 94, 0.1);
}

.procargo-dropdown-item-danger {
    color: #ef4444;
}

.procargo-dropdown-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ========================================
   VIEW BUTTON (for Shipping Orders)
   ======================================== */

.procargo-btn-view {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    color: #5EC7F2;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.procargo-btn-view:hover {
    background: rgba(94, 199, 242, 0.1);
}

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

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

.procargo-btn-view svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   PAGINATION
   ======================================== */

.procargo-pagination-border {
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

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: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    border: 2px solid #6b7280;
    background: transparent;
    color: #141414;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.procargo-pagination-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
}

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

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

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

.procargo-pagination-btn svg {
    width: 16px;
    height: 16px;
}

.procargo-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.procargo-pagination-page {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #141414;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.procargo-pagination-page:hover {
    background: rgba(0, 0, 0, 0.05);
}

.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;
    color: #ffffff;
}

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

/* ========================================
   PAGINATION STATS
   ======================================== */

.procargo-pagination-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(94, 199, 242, 0.05);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

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

.procargo-pagination-stats p {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin: 0;
}

body.dark-theme .procargo-pagination-stats p {
    color: #d1d5db;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Hide columns on smaller screens */
@media (max-width: 640px) {
    .procargo-hide-sm {
        display: none !important;
    }
    
    .procargo-hide-sm-icon {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .procargo-hide-md {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .procargo-hide-lg {
        display: none !important;
    }
}

@media (max-width: 1280px) {
    .procargo-hide-xl {
        display: none !important;
    }
}

/* Mobile pagination */
@media (max-width: 640px) {
    .procargo-pagination-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .procargo-pagination-stats {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
