/* ============================================
   PayPal Middleware - Consolidated Stylesheet
   ============================================ */

/* ============================================
   GLOBAL / RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
}

/* ============================================
   PAYMENT / CHECKOUT PAGE (payment.php, index copy.php, client_payment.php)
   ============================================ */
.checkout-card,
.center-card {
    max-width: 720px;
    margin: 0 auto;
}

@media (max-width: 576px) {
    .checkout-card,
    .center-card {
        padding: 1rem !important;
    }
    .checkout-title,
    .lead-text {
        font-size: 0.95rem;
    }
    .form-label {
        font-size: 0.95rem;
    }
}

/* Tablet-specific improvements */
@media (min-width: 768px) and (max-width: 991px) {
    .checkout-card {
        max-width: 600px;
        padding: 2.5rem !important;
    }
    .center-card {
        max-width: 650px;
        padding: 2.5rem !important;
    }
    .form-control {
        font-size: 1rem;
    }
}

/* Touch-friendly form elements */
.form-control,
.btn {
    min-height: 44px; /* Apple/Android touch target recommendation */
}

.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
    border-color: var(--bs-success);
}

/* Consent modal for client_payment.php */
.consent-modal .modal-body {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ============================================
   ADMIN PANEL (admin.php)
   ============================================ */
.card-responsive {
    max-width: 100%;
    margin: 0 auto;
}

@media (max-width: 576px) {
    .card-responsive {
        padding: 1rem !important;
    }
    .table td,
    .table th {
        white-space: normal;
        word-break: break-word;
        font-size: 0.9rem;
    }
    .header-username {
        display: none;
    }
}

.small-badge {
    font-size: 0.75rem;
    padding: .25rem .45rem;
}

/* Table: percent-based columns (no fixed px) */
.table-fixed {
    table-layout: fixed;
    width: 100%;
}

.table-fixed th,
.table-fixed td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    padding: .45rem .6rem;
}

/* Column width percentages */
.col-created {
    width: 12%; /* Date / Created */
}

.col-name {
    width: 18%;
}

.col-email {
    width: 24%;
}

.col-amount {
    width: 8%;
}

.col-status {
    width: 8%;
}

.col-address {
    width: 30%; /* combined address column */
}

/* Allow the combined address column to wrap and show full content */
.col-address,
td.col-address,
th.col-address {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}

/* Responsive tweaks */
@media (max-width: 992px) {
    /* reduce address dominance on medium screens */
    .col-address {
        width: 28%;
    }
    .col-email {
        width: 26%;
    }
    .col-name {
        width: 18%;
    }
}

@media (max-width: 768px) {
    .col-created {
        width: 14%;
    }
    .col-name {
        width: 20%;
    }
    .col-email {
        width: 30%;
    }
    .col-address {
        width: 26%;
    }
}

/* Pagination styling (keep green active) */
.pagination .page-item.active .page-link {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
    color: #fff;
}

.pagination .page-link {
    border-color: rgba(25, 135, 84, 0.15);
    color: var(--bs-success);
}

.pagination .page-link:hover {
    background-color: rgba(25, 135, 84, 0.06);
    color: var(--bs-success);
}

/* Keep horizontal scrolling on narrow screens */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   SUCCESS PAGE (success.php)
   ============================================ */
body.success-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.success-container {
    max-width: 600px;
    width: 100%;
}

.success-header {
    text-align: center;
    margin-bottom: 30px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: #d4edda;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: #28a745;
}

.success-title {
    font-size: 32px;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 8px;
}

.success-subtitle {
    color: #6c757d;
    font-size: 16px;
}

.transaction-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 20px;
}

.transaction-details {
    display: grid;
    gap: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.detail-row:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 18px;
}

.detail-label {
    color: #6c757d;
    font-weight: 500;
}

.detail-value {
    color: #343a40;
    font-weight: 500;
}

.status-badge {
    background-color: #d4edda;
    color: #155724;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status-badge.failed {
    background-color: #f8d7da;
    color: #721c24;
}

.total-amount {
    color: #28a745;
    font-weight: 700;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    width: 100%;
    font-size: 16px;
    padding: 15px 20px;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.info-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

.info-item {
    margin-bottom: 15px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 5px;
}

.info-text {
    color: #6c757d;
    line-height: 1.5;
}

.failed-state {
    text-align: center;
}

.failed-icon {
    background-color: #f8d7da;
    color: #721c24;
}

.failed-title {
    color: #dc3545;
}

/* ============================================
   CANCEL PAGE (cancel.php)
   ============================================ */
body.cancel-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cancel-container {
    max-width: 600px;
    width: 100%;
}

.cancel-header {
    text-align: center;
    margin-bottom: 30px;
}

.cancel-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #f8d7da;
    color: #721c24;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
}

.cancel-title {
    font-size: 32px;
    font-weight: 700;
    color: #dc3545;
    margin-bottom: 8px;
    text-align: center;
}

.cancel-subtitle {
    color: #6c757d;
    font-size: 16px;
    text-align: center;
}

.cancel-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.cancel-info {
    color: #6c757d;
    line-height: 1.6;
}

.cancel-details {
    display: grid;
    gap: 12px;
}

.cancel-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f1f3f4;
}

.cancel-row:last-child {
    border-bottom: none;
}

.cancel-label {
    color: #6c757d;
}

.cancel-value {
    color: #343a40;
    font-weight: 500;
}

.cancel-value.cancelled {
    color: #721c24;
}

/* ============================================
   LOGIN PAGE (login.php, login_secure.php)
   ============================================ */
body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 400px;
    width: 100%;
}

.login-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header h2 {
    margin: 0;
    font-weight: 600;
    font-size: 24px;
}

.login-header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

.login-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.login-form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.login-form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.login-input-group-text {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 8px 0 0 8px;
}

.login-input-group .login-form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

.btn-login {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

.login-alert {
    border-radius: 8px;
    border: none;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.login-alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.login-alert-success {
    background-color: #d4edda;
    color: #155724;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
}

.back-link a:hover {
    color: #007bff;
}

.security-note {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 13px;
    color: #004085;
}

.security-note i {
    color: #007bff;
    margin-right: 8px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-cancelled {
    color: #721c24;
}

.modal-icon-large {
    font-size: 3rem;
}

.admin-table {
    border-collapse: collapse;
}

.mobile-details-wrapper {
    min-width: 160px;
}

