/**
 * Campus Marketplace Ghana — Main stylesheet
 * Colors: deep green (primary), gold (secondary), navy (accent)
 */

:root {
    --cmg-primary: #0b5e3b;
    --cmg-primary-dark: #084a2f;
    --cmg-secondary: #f4b400;
    --cmg-secondary-dark: #d9a000;
    --cmg-accent: #1a2744;
    --cmg-light: #f8f9fa;
    --cmg-muted: #6c757d;
    --cmg-radius: 0.5rem;
    --cmg-font: "DM Sans", system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--cmg-font);
    color: #212529;
    background-color: #fff;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--cmg-secondary);
    color: var(--cmg-accent);
    padding: 0.5rem 1rem;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* Header */
.site-header .navbar {
    background: linear-gradient(135deg, var(--cmg-primary) 0%, var(--cmg-primary-dark) 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.navbar-brand .site-logo {
    display: block;
    height: 42px;
    width: auto;
    max-width: min(220px, 58vw);
    object-fit: contain;
}

@media (max-width: 575.98px) {
    .navbar-brand .site-logo {
        height: 36px;
        max-width: min(180px, 52vw);
    }
}

.navbar-brand .brand-icon {
    font-size: 1.75rem;
    color: var(--cmg-secondary);
}

.brand-text strong {
    display: block;
    line-height: 1.2;
    font-size: 1rem;
}

.brand-tagline {
    font-size: 0.65rem;
    opacity: 0.85;
    font-weight: 400;
}

.header-search {
    min-width: 200px;
    max-width: 280px;
}

@media (min-width: 992px) {
    .header-search {
        min-width: 220px;
    }
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    padding: 0;
    line-height: 1;
}

.user-menu-btn .bi-person-circle {
    font-size: 1.25rem;
}

.user-menu-btn.dropdown-toggle::after {
    display: none;
}

.nav-link.active {
    color: var(--cmg-secondary) !important;
    font-weight: 600;
}

/* Hero */
.hero-section {
    background: linear-gradient(160deg, var(--cmg-accent) 0%, var(--cmg-primary) 55%, var(--cmg-primary-dark) 100%);
}

.hero-title {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-search-form {
    max-width: 900px;
}

.hero-search-form .input-group-text {
    background: #fff;
    border-right: 0;
}

.hero-search-form .form-control,
.hero-search-form .form-select {
    border-color: #dee2e6;
}

/* Feature cards */
.feature-icon {
    font-size: 2.5rem;
    color: var(--cmg-primary);
}

.section-title {
    color: var(--cmg-accent);
    font-weight: 700;
}

/* Category tiles */
.category-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: var(--cmg-radius);
    color: var(--cmg-accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    min-height: 110px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.category-tile:hover {
    border-color: var(--cmg-primary);
    box-shadow: 0 4px 12px rgba(11, 94, 59, 0.12);
    transform: translateY(-2px);
    color: var(--cmg-primary);
}

.category-tile i {
    font-size: 1.75rem;
    color: var(--cmg-primary);
}

.bg-warning-subtle {
    background-color: rgba(244, 180, 0, 0.12) !important;
}

/* Buttons */
.btn-primary {
    background-color: var(--cmg-primary);
    border-color: var(--cmg-primary);
}

.btn-primary:hover {
    background-color: var(--cmg-primary-dark);
    border-color: var(--cmg-primary-dark);
}

.btn-warning {
    background-color: var(--cmg-secondary);
    border-color: var(--cmg-secondary);
    color: var(--cmg-accent);
}

.btn-warning:hover {
    background-color: var(--cmg-secondary-dark);
    border-color: var(--cmg-secondary-dark);
    color: var(--cmg-accent);
}

.btn-outline-primary {
    color: var(--cmg-primary);
    border-color: var(--cmg-primary);
}

.btn-outline-primary:hover {
    background-color: var(--cmg-primary);
    border-color: var(--cmg-primary);
}

/* Safety banner */
.safety-banner {
    background: #e8f4fc !important;
    color: var(--cmg-accent);
}

/* Footer */
.site-footer {
    background: var(--cmg-accent);
    color: rgba(255, 255, 255, 0.9);
}

.footer-heading {
    color: var(--cmg-secondary);
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.2rem 0;
}

.footer-links a:hover {
    color: var(--cmg-secondary);
}

.text-muted-small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.disclaimer-text {
    color: rgba(255, 255, 255, 0.55);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Listing cards */
.listing-card {
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
}

.listing-card-image-link {
    position: relative;
    display: block;
}

.listing-card-image {
    height: 180px;
    object-fit: cover;
    background: #e9ecef;
}

.badge-featured {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--cmg-secondary);
    color: var(--cmg-accent);
    font-weight: 700;
}

.listing-card-price {
    font-weight: 700;
    color: var(--cmg-primary);
    font-size: 1.1rem;
}

.price-negotiable {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--cmg-muted);
}

.listing-card-title a {
    color: var(--cmg-accent);
}

.listing-card-title a:hover {
    color: var(--cmg-primary);
}

.listing-card-meta li {
    margin-bottom: 0.15rem;
}

/* Listing detail */
.listing-gallery-image {
    max-height: 480px;
    object-fit: contain;
    background: #f8f9fa;
}

.listing-details-dl dt {
    font-weight: 600;
    color: var(--cmg-muted);
}

.seller-box .card-header {
    background: var(--cmg-primary) !important;
}

.reference-card:hover {
    border-color: var(--cmg-primary);
    box-shadow: 0 4px 12px rgba(11, 94, 59, 0.12);
}

.filters-sidebar .card-header {
    background: var(--cmg-primary) !important;
}

.listing-pagination .page-link {
    color: var(--cmg-primary);
}

.listing-pagination .page-item.active .page-link {
    background-color: var(--cmg-primary);
    border-color: var(--cmg-primary);
}

.empty-state {
    padding: 3rem 1rem;
}

/* User dashboard */
.dashboard-page .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.dashboard-page .badge.status-published {
    background-color: var(--cmg-primary);
}

.dashboard-page .badge.status-pending_review {
    background-color: #ffc107;
    color: #212529;
}

.dashboard-page .badge.status-sold {
    background-color: #6c757d;
}

.dashboard-page .badge.status-expired {
    background-color: #dc3545;
}

.dashboard-page .badge.status-draft {
    background-color: #adb5bd;
}

.ad-slot {
    min-height: 90px;
    margin: 0.75rem 0;
    text-align: center;
    overflow: hidden;
}

.ad-slot-between_listings {
    min-height: 120px;
    padding: 0.5rem 0;
}

.ad-slot ins,
.ad-slot iframe {
    max-width: 100%;
}

/* PWA install banner */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1080;
    padding: 0.75rem;
    pointer-events: none;
}

.pwa-install-banner-inner {
    pointer-events: auto;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--cmg-radius);
    box-shadow: 0 8px 24px rgba(26, 39, 68, 0.15);
}

.pwa-install-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: #fff;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.pwa-install-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pwa-install-copy {
    flex: 1;
    min-width: 0;
}

.pwa-install-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
}

@media (max-width: 575.98px) {
    .pwa-install-banner-inner {
        flex-wrap: wrap;
    }

    .pwa-install-actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
    }
}

/* Ghana universities directory */
.universities-hero {
    max-width: 42rem;
}

.university-card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.university-card:hover,
.university-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(26, 39, 68, 0.12) !important;
    border-color: rgba(11, 94, 59, 0.25);
}

.university-card-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 1rem;
    background: #f8f9fa;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.university-card-shortname {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--cmg-primary);
    letter-spacing: 0.02em;
}

.university-card-name {
    color: #212529;
    line-height: 1.35;
}

.university-type-filter.active {
    font-weight: 600;
}

/* CMS static pages */
.cms-prose {
    line-height: 1.7;
}

.cms-prose .lead {
    font-size: 1.125rem;
    color: #495057;
}

.cms-prose h2,
.cms-prose h3,
.cms-prose h4,
.cms-prose h5 {
    color: var(--cmg-accent);
    margin-top: 1.5rem;
}

.cms-prose ul,
.cms-prose ol {
    padding-left: 1.25rem;
}

.cms-prose ul li + li,
.cms-prose ol li + li {
    margin-top: 0.35rem;
}

.cms-prose a {
    color: var(--cmg-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.static-page-content .cms-prose > :last-child {
    margin-bottom: 0;
}

/* Seller ratings & reviews */
.seller-rating-stars {
    letter-spacing: 0.05em;
    font-size: 1rem;
}

.seller-rating-stars .bi {
    margin-right: 0.05rem;
}

.seller-star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 0.15rem;
}

.seller-star-option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.seller-star-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.seller-star-icon {
    color: #dee2e6;
    font-size: 1.5rem;
    line-height: 1;
    transition: color 0.12s ease, transform 0.12s ease;
}

.seller-star-option:hover .seller-star-icon,
.seller-star-option:hover ~ .seller-star-option .seller-star-icon,
.seller-star-option:has(.seller-star-radio:checked) .seller-star-icon,
.seller-star-option:has(.seller-star-radio:checked) ~ .seller-star-option .seller-star-icon {
    color: #ffc107;
}

.seller-star-option:hover .seller-star-icon {
    transform: scale(1.08);
}

.seller-rating-form-compact .seller-star-icon {
    font-size: 1.25rem;
}

.seller-review-card {
    background: #fafbfc;
}

.seller-review-snippet {
    background: rgba(255, 193, 7, 0.06);
    border-radius: 0.25rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.seller-reviews-preview .seller-rating-stars {
    font-size: 0.75rem;
}
