/* Brand tokens live in design-tokens.css — loaded before this file */

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Mobile responsiveness */
@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 0;
    }
    .hero-section h1 {
        font-size: 1.75rem;
    }
    .hero-section .btn {
        width: 100%;
    }
    .hero-section .d-flex.gap-3 {
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    .input-group-status {
        flex-direction: column;
    }
    .input-group-status .form-control,
    .input-group-status .btn {
        width: 100%;
        border-radius: 0.375rem !important;
    }
    .input-group-status .form-control {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }
    .input-group-status .btn {
        margin-top: -1px;
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
    }
}

/* Table scroll on small screens */
@media (max-width: 767px) {
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* Admin layout: fixed viewport shell — sidebar stable, main scrolls (desktop) */
.admin-body {
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-workspace {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

.admin-sidebar {
    flex: 0 0 16.66666667%;
    width: 16.66666667%;
    max-width: 16.66666667%;
    background: #212529;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #f8f9fa;
}

/* Consistent padding, spacing, and overflow on every admin page */
.admin-main-inner {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1.25rem clamp(1rem, 2.5vw, 2rem) 2rem;
}

.admin-main-inner > h2,
.admin-main-inner > .d-flex h2 {
    margin-bottom: 0.35rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.admin-main-inner > h2 + p,
.admin-main-inner > h2 + .text-muted,
.admin-main-inner > .d-flex + p.text-muted {
    margin-bottom: 1rem;
}

.admin-main-inner > .alert {
    margin-bottom: 1rem;
}

.admin-main-inner > .row,
.admin-main-inner > .card,
.admin-main-inner > .table-responsive {
    margin-bottom: 1.25rem;
}

.admin-main-inner .table-responsive,
.admin-main-inner #requestsTable,
.admin-main-inner #applicationsTable,
.admin-main-inner #writersTable,
.admin-main-inner #postsTable,
.admin-main-inner #instTable,
.admin-main-inner #faqTable,
.admin-main-inner #reviewsTable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-main-inner .table td {
    word-break: break-word;
    vertical-align: middle;
}

.admin-main-inner .table th {
    vertical-align: middle;
    white-space: nowrap;
}

.admin-main-inner .table td .btn-group {
    flex-wrap: nowrap;
}

.admin-main-inner .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    margin-bottom: 1rem;
    padding-bottom: 1px;
}

.admin-main-inner .nav-tabs .nav-link {
    white-space: nowrap;
}

.admin-main-inner .tab-content {
    padding-top: 0.25rem;
}

.admin-main-inner pre,
.admin-main-inner code {
    word-break: break-word;
}

.admin-main-inner .form-control,
.admin-main-inner .form-select {
    max-width: 100%;
}

.admin-main-inner > .d-flex.flex-wrap,
.admin-main-inner > .mb-3.d-flex {
    gap: 0.5rem;
}

/* Admin mobile: whole workspace scrolls; sidebar full width on top */
@media (max-width: 767px) {
    .admin-body {
        height: auto;
        max-height: none;
        overflow: auto;
    }
    .admin-workspace {
        flex-direction: column;
        overflow: visible;
        min-height: 0;
    }
    .admin-sidebar {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        min-height: auto;
    }
    .admin-main {
        overflow: visible;
    }
}

main {
    flex: 1;
}

.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: 0.5px;
}

.hero-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 40%, #7c3aed 100%);
    color: white;
    padding: 4rem 0;
    border-radius: 0 0 2rem 2rem;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-section--compact {
    padding: 2rem 0 1.5rem;
    margin-bottom: 0;
    border-radius: 0 0 1.25rem 1.25rem;
}

.customer-home-dashboard-card .table-warning {
    --bs-table-bg: rgba(255, 193, 7, 0.12);
}

.customer-home-requests-table code {
    font-size: 0.85em;
}

.service-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.service-category {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.btn-researchwindow {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    color: white;
}

.btn-researchwindow:hover {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: white;
}

/* About Us — contact block (moved from global header strip) */
.about-contact-details {
    background: linear-gradient(90deg, #0d5c4a, #047857);
    color: #fff;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.about-contact-details a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.about-contact-details__address {
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    line-height: 1.5;
}

.about-contact-details__channels {
    margin-bottom: 0;
}

.request-status-badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}

#guestFields, #paymentEvidence {
    transition: all 0.3s ease;
}

.card {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-control:focus, .form-select:focus {
    border-color: var(--researchwindow-blue);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* writer-apply.php: clear borders on selects & fields (avoids white-on-white) */
.page-writer-apply .form-control,
.page-writer-apply .form-select,
.page-writer-apply select {
    border: 1px solid #94a3b8;
    background-color: #fff;
}

.page-writer-apply .form-control:focus,
.page-writer-apply .form-select:focus,
.page-writer-apply select:focus {
    border-color: var(--researchwindow-blue);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    border-radius: 8px;
    margin: 2px 0;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.admin-nav-grouped .admin-nav-section {
    margin-top: 0.75rem;
    pointer-events: none;
}

.admin-nav-grouped .admin-nav-section:first-child {
    margin-top: 0;
}

.admin-nav-grouped .admin-nav-section-label {
    display: block;
    padding: 0.35rem 0.5rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.2;
}

/* Admin — Add/Edit request modal: vertical scroll inside form (flex child must shrink: flex 1 1 0%) */
#requestCrudModal .modal-dialog.modal-dialog-scrollable {
    max-height: calc(100vh - 1.5rem);
    margin: 0.75rem auto;
}

#requestCrudModal .modal-content {
    max-height: calc(100vh - 1.5rem);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#requestCrudModal #requestCrudForm {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* This block must shrink (not grow with content) or no scrollbar appears */
#requestCrudModal .modal-body {
    flex: 1 1 0%;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

#requestCrudModal .modal-header,
#requestCrudModal .modal-footer {
    flex-shrink: 0;
}

.stat-card {
    border-left: 4px solid var(--researchwindow-blue);
}

.upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--researchwindow-blue);
    background: rgba(37, 99, 235, 0.05);
}

/* WhatsApp sticky CTA - mobile friendly */
.whatsapp-sticky {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
@media (min-width: 768px) {
    .whatsapp-sticky { bottom: 32px; right: 32px; width: 60px; height: 60px; }
}

.request-steps .step { color: inherit; }
.request-steps .step.active { font-weight: 600; color: var(--researchwindow-primary); }

/* Institution autocomplete dropdown */
.institution-autocomplete-wrap .list-group { top: 100%; left: 0; right: 0; margin-top: -1px; border-radius: 0 0 0.375rem 0.375rem; }
.institution-autocomplete-wrap .list-group-item { cursor: pointer; }
.institution-autocomplete-wrap .list-group-item:hover { background-color: rgba(30, 58, 95, 0.08); }

/* Footer base (sleek overrides in public-interface.css) */
.site-footer:not(.site-footer--sleek) {
    padding: 0.55rem 0 0.4rem;
    margin-top: 1.25rem;
    font-size: 0.78rem;
}
.site-footer:not(.site-footer--sleek) .footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--rw-footer-border, #a8cce8);
    font-size: 0.75rem;
}

/* Customer payment panel (request status, my requests) */
.customer-payment-panel-header {
    background: linear-gradient(135deg, var(--researchwindow-primary) 0%, var(--researchwindow-blue) 55%, #4f46e5 100%);
}
.customer-payment-steps {
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.12);
}
.payment-gateway-grid .payment-gateway-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(30, 58, 95, 0.12);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
}
.payment-gateway-grid .payment-gateway-tile:hover {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.08);
}
.payment-gateway-grid .payment-gateway-tile:focus-visible {
    outline: 2px solid var(--researchwindow-blue);
    outline-offset: 2px;
}
.payment-gateway-grid .payment-gateway-tile.is-active {
    border-color: var(--researchwindow-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    background: rgba(37, 99, 235, 0.06);
}
.payment-gateway-tile-icon {
    font-size: 1.35rem;
    color: var(--researchwindow-blue);
    line-height: 1;
    margin-bottom: 0.15rem;
}
.payment-gateway-tile-title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--researchwindow-dark);
}
.payment-gateway-tile-sub {
    font-size: 0.7rem;
    color: var(--researchwindow-secondary);
    line-height: 1.25;
}
.payment-bank-details-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.customer-payment-evidence-form .upload-zone {
    border: 2px dashed rgba(37, 99, 235, 0.25);
    border-radius: 0.5rem;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    background: rgba(37, 99, 235, 0.03);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.customer-payment-evidence-form .upload-zone:hover {
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.4);
}

/* Payment evidence — review before submit modal */
.pe-review__body {
    background: #f8fafc;
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 0.5rem;
    padding: 1rem 1.15rem;
}
.pe-review__section {
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(30, 58, 95, 0.08);
}
.pe-review__section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}
.pe-review__label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--researchwindow-secondary, #64748b);
    margin-bottom: 0.2rem;
}
.pe-review__value {
    font-size: 0.95rem;
    color: #0f172a;
    word-break: break-word;
}

/* Request form — service badge picker */
.service-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.service-picker-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(30, 58, 95, 0.18);
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.service-picker-badge:hover {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.08);
}
.service-picker-name {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    color: var(--researchwindow-dark);
}
.service-picker-price {
    font-size: 0.7rem;
    font-weight: 600;
}
.btn-check:checked + .service-picker-badge {
    border-color: var(--researchwindow-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.06);
}
.btn-check:focus-visible + .service-picker-badge {
    outline: 2px solid var(--researchwindow-blue);
    outline-offset: 2px;
}

/* Cookie consent banner */
.researchwindow-cookie-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    padding: 0.85rem 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
}
.researchwindow-cookie-consent__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}
.researchwindow-cookie-consent__text {
    flex: 1 1 16rem;
    max-width: 48rem;
}
.researchwindow-cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
