:root {
  --theme-color: 0, 49, 83;
  --title-color: 32, 35, 38;
  --content-color: 153, 153, 153;
  --secondary-color: 124, 185, 232;
}

/* Styles généraux */
.transactions-page {
    padding: 15px 15px 100px;
    min-height: 100vh;
    background: #f8f9fa;
}

.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: rgb(var(--title-color));
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i {
    color: rgb(var(--content-color));
    font-size: 24px;
}

/* Filtres */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: rgb(var(--content-color));
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.filter-tab {
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    background: #f8f9fa;
    color: rgb(var(--content-color));
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.filter-tab:hover {
    border-color: rgb(var(--theme-color));
    color: rgb(var(--theme-color));
    background: white;
}

.filter-tab.active {
    background: rgb(var(--theme-color));
    border-color: rgb(var(--theme-color));
    color: white;
}

/* Squelette de chargement */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-item {
    height: 80px;
    margin-bottom: 10px;
    border-radius: 12px;
}

/* Liste des transactions */
.transactions-container {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.transactions-header {
    font-size: 18px;
    font-weight: 600;
    color: rgb(var(--title-color));
    margin-bottom: 20px;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.transaction-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--theme-color), 0.1);
    border-color: rgb(var(--theme-color));
}

.transaction-card.expanded {
    border-color: rgb(var(--theme-color));
    box-shadow: 0 4px 20px rgba(var(--theme-color), 0.15);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.transaction-title-container {
    flex: 1;
}

.transaction-title {
    font-weight: 600;
    color: rgb(var(--title-color));
    font-size: 15px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.transaction-subtitle {
    font-size: 12px;
    color: rgb(var(--content-color));
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.transaction-amount {
    font-weight: 700;
    color: rgb(var(--theme-color));
    font-size: 16px;
    white-space: nowrap;
}

.transaction-status {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.status-initiated {
    background: rgba(var(--content-color), 0.15);
    color: rgb(var(--content-color));
    border: 1px solid rgba(var(--content-color), 0.3);
}

.status-negotiating {
    background: rgba(var(--secondary-color), 0.15);
    color: rgb(var(--secondary-color));
    border: 1px solid rgba(var(--secondary-color), 0.3);
}

.status-terms-agreed {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-payment-pending {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-payment-confirmed {
    background: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.status-in-progress {
    background: rgba(111, 66, 193, 0.15);
    color: #6f42c1;
    border: 1px solid rgba(111, 66, 193, 0.3);
}

.status-buyer-confirmed {
    background: rgba(var(--secondary-color), 0.15);
    color: rgb(var(--secondary-color));
    border: 1px solid rgba(var(--secondary-color), 0.3);
}

.status-seller-confirmed {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-completed {
    background: rgba(32, 201, 151, 0.15);
    color: #20c997;
    border: 1px solid rgba(32, 201, 151, 0.3);
}

.status-disputed {
    background: rgba(253, 126, 20, 0.15);
    color: #fd7e14;
    border: 1px solid rgba(253, 126, 20, 0.3);
}

.status-cancelled {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Badges d'état */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

.badge-accepted {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.badge-pending {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.badge-received {
    background: rgba(var(--secondary-color), 0.1);
    color: rgb(var(--secondary-color));
    border: 1px solid rgba(var(--secondary-color), 0.2);
}

.badge-delivered {
    background: rgba(32, 201, 151, 0.1);
    color: #20c997;
    border: 1px solid rgba(32, 201, 151, 0.2);
}

.transaction-details-expanded {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    animation: slide-down 0.3s ease-out;
}

.transaction-card.expanded .transaction-details-expanded {
    display: block;
}

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

/* Informations de transaction */
.transaction-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 11px;
    color: rgb(var(--content-color));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 13px;
    color: rgb(var(--title-color));
    font-weight: 500;
}

/* Décisions et confirmations */
.decisions-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.decisions-header {
    font-size: 12px;
    font-weight: 600;
    color: rgb(var(--content-color));
    margin-bottom: 8px;
    text-transform: uppercase;
}

.decisions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.decision-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.decision-label {
    font-size: 11px;
    color: rgb(var(--content-color));
}

.decision-value {
    font-size: 12px;
    font-weight: 500;
}

.decision-timestamp {
    font-size: 10px;
    color: #adb5bd;
}

/* Informations utilisateur */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #e9ecef;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: rgb(var(--title-color));
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-role {
    font-size: 11px;
    color: rgb(var(--content-color));
}

.certified-badge {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
}

/* Actions */
.transaction-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn i {
    font-size: 14px;
}

.action-btn.accept {
    background: #28a745;
    color: white;
}

.action-btn.accept:hover {
    background: #218838;
}

.action-btn.decline {
    background: #dc3545;
    color: white;
}

.action-btn.decline:hover {
    background: #c82333;
}

.action-btn.negotiate {
    background: rgb(var(--secondary-color));
    color: white;
}

.action-btn.negotiate:hover {
    background: rgba(var(--secondary-color), 0.9);
}

.action-btn.confirm-payment {
    background: #17a2b8;
    color: white;
}

.action-btn.confirm-payment:hover {
    background: #138496;
}

.action-btn.confirm-receipt {
    background: rgb(var(--secondary-color));
    color: white;
}

.action-btn.confirm-receipt:hover {
    background: rgba(var(--secondary-color), 0.9);
}

.action-btn.confirm-delivery {
    background: #20c997;
    color: white;
}

.action-btn.confirm-delivery:hover {
    background: #1ba87e;
}

.action-btn.complete {
    background: rgb(var(--theme-color));
    color: white;
}

.action-btn.complete:hover {
    background: rgba(var(--theme-color), 0.9);
}

.action-btn.pay {
    background: #6610f2;
    color: white;
}

.action-btn.pay:hover {
    background: #520dc2;
}

.action-btn.release-escrow {
    background: #20c997;
    color: white;
}

.action-btn.release-escrow:hover {
    background: #1ba87e;
}

.action-btn.dispute {
    background: #fd7e14;
    color: white;
}

.action-btn.dispute:hover {
    background: #e46c0a;
}

.action-btn.cancel {
    background: #dc3545;
    color: white;
}

.action-btn.cancel:hover {
    background: #c82333;
}

.action-btn.conversations {
    background: rgb(var(--theme-color));
    color: white;
}

.action-btn.conversations:hover {
    background: rgba(var(--theme-color), 0.9);
}

.action-btn.view-details {
    background: #6f42c1;
    color: white;
}

.action-btn.view-details:hover {
    background: #5e35b1;
}

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

.action-btn:disabled:hover {
    background: inherit;
}

/* Barre de progression */
.progress-section {
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-title {
    font-size: 12px;
    font-weight: 600;
    color: rgb(var(--content-color));
}

.progress-step {
    font-size: 11px;
    font-weight: 500;
    color: rgb(var(--theme-color));
}

.progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: rgb(var(--theme-color));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

.step-indicator {
    font-size: 10px;
    color: #adb5bd;
    text-align: center;
    width: 20%;
}

.step-indicator.active {
    color: rgb(var(--theme-color));
    font-weight: 600;
}

/* Modal personnalisé */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modal-slide-up 0.3s ease-out;
}

@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: rgb(var(--title-color));
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: rgb(var(--content-color));
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f8f9fa;
    color: rgb(var(--title-color));
}

.modal-body {
    padding: 20px;
}

.modal-message {
    color: rgb(var(--content-color));
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

.modal-btn.cancel {
    background: rgb(var(--content-color));
    color: white;
}

.modal-btn.cancel:hover {
    background: rgba(var(--content-color), 0.9);
}

.modal-btn.confirm {
    background: rgb(var(--theme-color));
    color: white;
}

.modal-btn.confirm:hover {
    background: rgba(var(--theme-color), 0.9);
}

.modal-btn.success {
    background: #28a745;
    color: white;
}

.modal-btn.success:hover {
    background: #218838;
}

.modal-btn.error {
    background: #dc3545;
    color: white;
}

.modal-btn.error:hover {
    background: #c82333;
}

/* Modal de litige */
.dispute-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: rgb(var(--title-color));
}

.form-select, .form-textarea {
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: all 0.3s;
}

.form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: rgb(var(--theme-color));
    box-shadow: 0 0 0 3px rgba(var(--theme-color), 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Modal de confirmation mutuelle */
.confirmation-code-input {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.confirmation-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    font-family: monospace;
    transition: all 0.3s;
}

.confirmation-input:focus {
    outline: none;
    border-color: rgb(var(--theme-color));
    box-shadow: 0 0 0 3px rgba(var(--theme-color), 0.1);
}

.code-hint {
    font-size: 12px;
    color: rgb(var(--content-color));
    text-align: center;
    margin-top: 5px;
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-top: 20px;
}

.empty-state i {
    font-size: 64px;
    color: #e9ecef;
    margin-bottom: 20px;
}

.empty-state h4 {
    color: rgb(var(--title-color));
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-state p {
    color: rgb(var(--content-color));
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: rgb(var(--theme-color));
    color: white;
}

.btn-primary:hover {
    background: rgba(var(--theme-color), 0.9);
    color: white;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding: 20px 0;
}

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

.page-link {
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(var(--content-color));
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}

.page-link:hover {
    background: #f8f9fa;
    border-color: rgb(var(--theme-color));
    color: rgb(var(--theme-color));
}

.page-link.active {
    background: rgb(var(--theme-color));
    border-color: rgb(var(--theme-color));
    color: white;
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .transactions-page {
        padding: 12px 12px 90px;
    }
    
    .transaction-info-grid {
        grid-template-columns: 1fr;
    }
    
    .decisions-grid {
        grid-template-columns: 1fr;
    }
    
    .transaction-actions {
        flex-direction: column;
    }
    
    .action-btn {
        min-width: 100%;
    }
    
    .modal-container {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .transaction-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .transaction-amount {
        align-self: flex-start;
    }
}