/* ================= BAC-ALL PAGE — PAGE-SPECIFIC STYLES ================= */

/* ================= BASE RESET ================= */
html { font-size: clamp(14px, 2.5vw, 16px); }
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: #dcedc8;
    font-family: 'Source Sans Pro', sans-serif;
    overflow-x: clip;
}

/* ================= MAIN CONTENT ================= */
.main-content {
    margin-top: clamp(70px, 10vh, 90px);
    padding: clamp(2.5rem, 4vw, 3rem) clamp(2rem, 3vw, 2rem);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    background: #dcedc8;
}

/* ================= PAGE HEADER ================= */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.page-header p {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: #1A1A1A;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

/* ================= BAC LIST ================= */
.bac-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

/* ================= BID ITEM ================= */
.bid-item {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    /* scroll animation start state */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.bid-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays */
.bid-item:nth-child(1) { transition-delay: 0.1s; }
.bid-item:nth-child(2) { transition-delay: 0.2s; }
.bid-item:nth-child(3) { transition-delay: 0.3s; }
.bid-item:nth-child(4) { transition-delay: 0.4s; }
.bid-item:nth-child(5) { transition-delay: 0.5s; }
.bid-item:nth-child(6) { transition-delay: 0.6s; }

.bid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.bid-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 15px rgba(46, 125, 50, 0.2);
}

.bid-item:hover::before {
    opacity: 0.05;
}

/* ================= BID ITEM INTERNALS ================= */
.bid-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.bid-item-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1b5e20;
    line-height: 1.3;
    margin: 0;
}

.bid-ref {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.35rem;
}

.bid-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.pdf-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ff4444;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.bid-item:hover .pdf-badge {
    background: #cc0000;
    transform: scale(1.05);
}

.bid-preview-hint {
    color: #2e7d32;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.bid-preview-hint i {
    font-size: 0.85rem;
}

.bid-item:hover .bid-preview-hint {
    color: #1b5e20;
    transform: translateX(5px);
}

/* ================= HIDDEN ITEMS ================= */
.hidden-items {
    display: none;
}

.hidden-items.show {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.hidden-items.show .bid-item {
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.6s ease forwards;
}

.hidden-items.show .bid-item:nth-child(1) { animation-delay: 0.1s; }
.hidden-items.show .bid-item:nth-child(2) { animation-delay: 0.2s; }
.hidden-items.show .bid-item:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================= VIEW MORE BUTTON ================= */
.view-more-container {
    text-align: center;
    margin: 2rem 0 1rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: 0.3s;
}

.view-more-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.view-more-btn {
    background: #2e7d32;
    color: white;
    border: 2px solid transparent;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: pulseButton 2s infinite;
}

.view-more-btn:hover {
    background: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.view-more-btn:focus {
    outline: none;
    border-color: #fbc02d;
}

.view-more-btn.hidden {
    display: none;
}

@keyframes pulseButton {
    0%   { box-shadow: 0 4px 6px rgba(46, 125, 50, 0.1); }
    50%  { box-shadow: 0 8px 15px rgba(46, 125, 50, 0.3); }
    100% { box-shadow: 0 4px 6px rgba(46, 125, 50, 0.1); }
}

/* ================= PDF MODAL ================= */
.bac-pdf-preview {
    position: relative;
}

.bac-pdf-preview::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2e7d32;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.bac-pdf-preview.loading::before {
    opacity: 1;
}

@keyframes spin {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .pspp-modal-content {
        height: 95vh !important;
        margin: 10px auto !important;
    }
    #bacPdfFrame { height: 65vh !important; }

    .bid-item { padding: 1.25rem; }
    .bid-item:hover { transform: translateY(-3px) scale(1.01); }
}

@media (max-width: 599px) and (min-width: 480px) {
    .main-content { padding: 90px 1.25rem 2rem; }
    .bid-item { padding: 1.25rem; }
    .bid-item-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .bid-item-title { font-size: 1.2rem; }
    .pdf-badge { align-self: flex-start; }
    .bid-ref { font-size: 0.9rem; }
    .bid-description { font-size: 0.85rem; }
    .bid-preview-hint { font-size: 0.85rem; }
    .view-more-btn { padding: 0.875rem 1.75rem; font-size: 1rem; }
}

@media (max-width: 480px) {
    .pspp-modal-content {
        height: 75vh !important;
        margin: 5px auto !important;
    }
    #bacPdfFrame { height: 55vh !important; }

    .bid-item { padding: 1rem; }
    .bid-item:hover { transform: translateY(-2px) scale(1.005); }
}

@media (max-width: 479px) {
    .main-content { padding: 5px 1rem 1.5rem; }
    .bid-item { padding: 1rem; }
    .bid-item-title { font-size: 1.1rem; }
    .bid-ref { font-size: 0.85rem; }
    .bid-description { font-size: 0.8rem; }
    .bid-preview-hint { font-size: 0.8rem; }
    .view-more-btn { padding: 0.75rem 1.5rem; font-size: 0.95rem; width: 100%; justify-content: center; }
}

@media (max-width: 360px) {
    .pspp-modal-content {
        height: 75vh !important;
        margin: 5px auto !important;
    }
    #bacPdfFrame { height: 45vh !important; }
}

@media (max-width: 319px) {
    .main-content { padding: 80px 0.75rem 1.25rem; }
}

/* ================= TOUCH DEVICES ================= */
@media (hover: none) and (pointer: coarse) {
    .bid-item:hover {
        transform: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }
    .bid-item:active {
        transform: scale(0.99);
        background: #f8f9fa;
    }
}

/* ================= ACCESSIBILITY ================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}