/* ============================================================
   Sahrang Medtech — Offer Letters Page Styles (css/offers.css)
   ============================================================ */

.offers-hero {
    background: var(--surface-white);
    padding: 4.25rem 0 2rem;
}

.offers-hero .container {
    max-width: 1200px;
}

.offers-hero-title {
    font-size: clamp(1.9rem, 4.2vw, 2.7rem);
    font-weight: 700;
    color: var(--dark-blue);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.offers-hero-subtitle {
    max-width: 640px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.offers-section {
    padding: 1rem 0 4.5rem;
    background: var(--surface-medium);
}

.offers-filters {
    background: var(--surface-white);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.offers-filters-head {
    margin-bottom: 1rem;
}

.offers-filters-title {
    font-size: 1.125rem;
    color: var(--dark-blue);
    margin-bottom: 0.375rem;
}

.offers-filters-note {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.offers-filters-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}

.offers-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.offers-field-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.offers-input-wrap {
    position: relative;
}

.offers-input-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
}

.offers-input-wrap input,
.offers-field select {
    width: 100%;
    border: 1px solid var(--border-color);
    background: #fff;
    min-height: 44px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    padding: 0.625rem 0.75rem;
    border-radius: 2px;
    outline: none;
    transition: border-color 0.12s;
}

.offers-input-wrap input {
    padding-left: 2.3rem;
}

.offers-input-wrap input:focus,
.offers-field select:focus {
    border-color: var(--primary-blue);
}

.offers-filters-meta {
    margin-top: 0.875rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.offers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
}

.offer-card {
    background: var(--surface-white);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    position: relative;
    overflow: hidden;
    min-height: 230px;
    transition: background 0.15s;
}

.offer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-blue);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.offer-card:hover {
    background: #EBF4FB;
}

.offer-card:hover::before {
    transform: scaleX(1);
}

.offer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.offer-name {
    margin: 0;
    font-size: 1.05rem;
    color: var(--dark-blue);
    line-height: 1.4;
}

.offer-pill {
    background: var(--dark-blue);
    color: #fff;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
}

.offer-meta {
    display: grid;
    gap: 0.5rem;
}

.offer-meta-row {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.offer-meta-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

.offer-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.offer-view-btn,
.offer-download-btn {
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    font-size: 0.875rem;
}

.offer-view-btn {
    background: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    border-radius: 2px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.offer-view-btn:hover {
    color: #fff;
    background: var(--primary-blue);
}

.offer-download-btn[aria-disabled="true"],
.offer-view-btn[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.offers-empty {
    margin-top: 1.5rem;
    background: var(--surface-white);
    border: 1px solid var(--border-color);
    text-align: center;
    padding: 2rem 1rem;
}

.offers-empty i {
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.offers-empty h3 {
    font-size: 1.0625rem;
    color: var(--dark-blue);
    margin-bottom: 0.25rem;
}

.offers-empty p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.offer-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.offer-modal[hidden] {
    display: none;
}

.offer-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 17, 43, 0.6);
    backdrop-filter: blur(3px);
}

.offer-modal-panel {
    position: relative;
    width: min(980px, 100%);
    background: #fff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-heavy);
    max-height: calc(100vh - 1.5rem);
    display: flex;
    flex-direction: column;
}

.offer-modal-header {
    padding: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.offer-modal-kicker {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#offerModalTitle,
#completionModalTitle {
    font-size: 1rem;
    color: var(--dark-blue);
    margin-top: 0.2rem;
}

.offer-modal-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#offerModalDownload,
#completionModalDownload {
    min-height: 36px;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
}

.offer-modal-close {
    height: 36px;
    width: 36px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.offer-modal-close:hover {
    background: #EBF4FB;
    color: var(--primary-blue);
}


/* ── Dark Mode Overrides ───────────────────────────────────── */
body.dark-mode .offers-input-wrap input,
body.dark-mode .offers-field select,
body.dark-mode .offer-modal-panel,
body.dark-mode .offer-modal-close,
body.dark-mode #offerPreviewFrame,
body.dark-mode #completionPreviewFrame {
    background: #141c27;
}

body.dark-mode .offer-card:hover,
body.dark-mode .offer-modal-close:hover {
    background: #172230;
}

body.dark-mode .offer-modal-kicker {
    color: #b4c3d8;
}

.offer-modal-body {
    flex: 1;
    min-height: 320px;
}

#offerPreviewFrame,
#completionPreviewFrame {
    width: 100%;
    height: 100%;
    min-height: 66vh;
    border: none;
    background: #f4f7fb;
}

@media (min-width: 640px) {
    .offers-filters {
        padding: 1.5rem;
    }

    .offers-filters-controls {
        grid-template-columns: 1.5fr 0.8fr 0.8fr;
    }

    .offer-card {
        padding: 1.5rem;
    }

    .offer-modal-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.1rem;
    }
}

@media (min-width: 900px) {
    .offers-section {
        padding-bottom: 5.5rem;
    }

    .offers-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .offer-card {
        min-height: 250px;
    }
}

@media (max-width: 480px) {
    .offers-hero {
        padding-top: 3.5rem;
    }

    .offers-hero-subtitle {
        font-size: 0.95rem;
    }

    .offers-filters-title {
        font-size: 1rem;
    }

    .offer-actions {
        flex-direction: column;
    }

    .offer-view-btn,
    .offer-download-btn {
        width: 100%;
        justify-content: center;
    }

    .offer-modal {
        padding: 0;
    }

    .offer-modal-panel {
        width: 100%;
        max-height: 100vh;
        height: 100vh;
    }

    #offerPreviewFrame,
    #completionPreviewFrame {
        min-height: calc(100vh - 120px);
    }
}
