/* ========================================
   Starlink Pagamentos - Custom Styles
   ======================================== */

:root {
    --starlink-primary: #0d6efd;
    --starlink-dark: #212529;
    --starlink-warning: #ffc107;
    --starlink-success: #198754;
    --starlink-danger: #dc3545;
    --starlink-info: #0dcaf0;
    --starlink-bg: #f0f2f5;
}

body {
    background-color: var(--starlink-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

main {
    flex: 1;
}

/* ─── Navbar ─── */
.navbar-brand strong {
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.nav-link {
    transition: color 0.2s;
}

/* ─── Cards ─── */
.card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ─── Summary Cards (Dashboard) ─── */
.summary-card {
    border-left: 4px solid transparent;
    border-radius: 12px;
}

.summary-card.card-total   { border-left-color: var(--starlink-primary); }
.summary-card.card-paid    { border-left-color: var(--starlink-success); }
.summary-card.card-pending { border-left-color: var(--starlink-warning); }
.summary-card.card-canceled{ border-left-color: var(--starlink-danger); }
.summary-card.card-failed  { border-left-color: #6c757d; }
.summary-card.card-revenue { border-left-color: var(--starlink-info); }

.summary-card .card-icon {
    font-size: 2rem;
    opacity: 0.7;
}

.summary-card .card-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.summary-card .card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
}

/* ─── Status Badges ─── */
.badge {
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.badge-status-paid     { background-color: #d1e7dd; color: #0f5132; }
.badge-status-pending  { background-color: #fff3cd; color: #664d03; }
.badge-status-canceled { background-color: #f8d7da; color: #842029; }
.badge-status-failed   { background-color: #e2e3e5; color: #41464b; }
.badge-status-refunded { background-color: #cff4fc; color: #055160; }

.badge-method-credit_card { background-color: #cfe2ff; color: #084298; }
.badge-method-pix         { background-color: #d1e7dd; color: #0f5132; }
.badge-method-boleto      { background-color: #fff3cd; color: #664d03; }

.badge-webhook-received  { background-color: #cff4fc; color: #055160; }
.badge-webhook-processed { background-color: #d1e7dd; color: #0f5132; }
.badge-webhook-failed    { background-color: #f8d7da; color: #842029; }

/* ─── Payment Method Chart ─── */
.chart-bar-container {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.chart-bar-label {
    width: 120px;
    font-size: 0.85rem;
    font-weight: 500;
}

.chart-bar-track {
    flex: 1;
    height: 24px;
    background-color: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 10px;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 0.7rem;
    color: white;
    font-weight: 600;
    min-width: 40px;
}

.chart-bar-fill.bar-credit_card { background: linear-gradient(135deg, #0d6efd, #6610f2); }
.chart-bar-fill.bar-pix         { background: linear-gradient(135deg, #198754, #20c997); }
.chart-bar-fill.bar-boleto      { background: linear-gradient(135deg, #fd7e14, #ffc107); }

.chart-bar-value {
    width: 100px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ─── Tables ─── */
.table-transactions {
    font-size: 0.9rem;
}

.table-transactions th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #dee2e6;
}

.table-transactions td {
    vertical-align: middle;
}

.table-transactions tbody tr {
    cursor: pointer;
    transition: background-color 0.15s;
}

.table-transactions tbody tr:hover {
    background-color: #e8f0fe;
}

/* ─── Filters ─── */
.filters-bar {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.filters-bar .form-control,
.filters-bar .form-select {
    font-size: 0.85rem;
    border-radius: 8px;
}

/* ─── Pagination ─── */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    font-size: 0.85rem;
}

/* ─── Order Detail Modal ─── */
.detail-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 500;
}

/* ─── Loading ─── */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

/* ─── Timeline de webhooks ─── */
.webhook-timeline {
    position: relative;
    padding-left: 30px;
}

.webhook-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.webhook-timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85rem;
}

.webhook-timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--starlink-primary);
    border: 2px solid white;
}

.webhook-timeline-item.wh-processed::before { background-color: var(--starlink-success); }
.webhook-timeline-item.wh-failed::before    { background-color: var(--starlink-danger); }

/* ─── Footer ─── */
footer {
    margin-top: auto;
}

/* ─── Payment Method Selector ─── */
.payment-method-card {
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: white;
}

.payment-method-card i {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 8px;
    color: #6c757d;
    transition: color 0.25s ease;
}

.payment-method-card span {
    font-weight: 600;
    font-size: 0.9rem;
    color: #6c757d;
    transition: color 0.25s ease;
}

.payment-method-card:hover {
    border-color: var(--starlink-primary);
    box-shadow: 0 4px 15px rgba(13,110,253,0.15);
}

.payment-method-card:hover i,
.payment-method-card:hover span {
    color: var(--starlink-primary);
}

.payment-method-card.active {
    border-color: var(--starlink-primary);
    background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
    box-shadow: 0 4px 15px rgba(13,110,253,0.2);
}

.payment-method-card.active i {
    color: var(--starlink-primary);
}

.payment-method-card.active span {
    color: var(--starlink-primary);
}

/* ─── Pay Button ─── */
.btn-pay {
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(13,110,253,0.3);
}

.btn-pay:hover:not(:disabled) {
    background: linear-gradient(135deg, #0b5ed7, #520dc2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13,110,253,0.4);
    color: white;
}

.btn-pay:disabled {
    opacity: 0.7;
    color: white;
}

.btn-pay-pix {
    background: linear-gradient(135deg, #198754, #20c997);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(25,135,84,0.3);
}

.btn-pay-pix:hover:not(:disabled) {
    background: linear-gradient(135deg, #157347, #1aa179);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25,135,84,0.4);
    color: white;
}

.btn-pay-pix:disabled {
    opacity: 0.7;
    color: white;
}

/* ─── Payment Item Row ─── */
.payment-item-row {
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f5;
}

.payment-item-row:last-child {
    border-bottom: none;
}

/* ─── Card Brand Indicator ─── */
#card-brand {
    min-width: 55px;
    justify-content: center;
    background: #f8f9fa;
}

/* ─── PIX QR Code ─── */
.pix-qr-image {
    width: 220px;
    height: 220px;
    border: 3px solid #198754;
    border-radius: 16px;
    padding: 8px;
    background: white;
}

.pix-copy-container {
    text-align: left;
}

.pix-copy-container .form-control {
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .summary-card .card-value {
        font-size: 1.4rem;
    }

    .chart-bar-label {
        width: 80px;
        font-size: 0.75rem;
    }

    .table-transactions {
        font-size: 0.8rem;
    }

    .payment-method-card {
        padding: 14px 10px;
    }

    .payment-method-card i {
        font-size: 1.8rem;
    }

    .pix-qr-image {
        width: 180px;
        height: 180px;
    }
}
