/* ==========================================================================
   myjobmap – Frontend Styles
   ========================================================================== */

/* Base */
.rw-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
}

.rw-container *, .rw-container *::before, .rw-container *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Header
   ========================================================================== */

.rw-header {
    text-align: center;
    margin-bottom: 28px;
}

.rw-title {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

.rw-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
}

.rw-subtitle a {
    color: #3b82f6;
    text-decoration: none;
}

.rw-subtitle a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */

.rw-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.rw-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 160px;
}

.rw-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.rw-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 22px;
}

/* ==========================================================================
   Inputs & Selects
   ========================================================================== */

.rw-input, .rw-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    height: 40px;
}

.rw-input:focus, .rw-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* County dropdown */
.rw-county-search-wrap {
    position: relative;
}

.rw-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.rw-dropdown-item {
    padding: 9px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.1s;
}

.rw-dropdown-item:hover,
.rw-dropdown-item.highlighted {
    background: #eff6ff;
    color: #3b82f6;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.rw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    white-space: nowrap;
    height: 40px;
}

.rw-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rw-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.rw-btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.rw-btn-ghost {
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.rw-btn-ghost:hover {
    background: #f3f4f6;
    color: #374151;
}

.rw-btn-outline {
    background: transparent;
    color: #3b82f6;
    border: 1.5px solid #3b82f6;
    margin-top: 12px;
    height: auto;
    padding: 8px 18px;
}

.rw-btn-outline:hover {
    background: #3b82f6;
    color: #fff;
}

.rw-btn-donate {
    background: #f59e0b;
    color: #fff;
}

.rw-btn-donate:hover {
    background: #d97706;
}

/* ==========================================================================
   Results Layout
   ========================================================================== */

.rw-results-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.rw-results-col {
    flex: 1;
    min-width: 0;
}

.rw-map-wrap {
    width: 420px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.rw-map {
    width: 100%;
    height: 560px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    z-index: 1;
}

.rw-map-hint {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin: 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ==========================================================================
   Results Meta
   ========================================================================== */

.rw-results-meta {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 14px;
    display: none;
}

.rw-job-count {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-right: 4px;
}

/* Leaflet tooltip */
.rw-tooltip {
    font-size: 13px;
    font-weight: 600;
    background: rgba(26, 26, 46, 0.92);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rw-tooltip::before {
    border-top-color: rgba(26, 26, 46, 0.92);
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.rw-loading {
    text-align: center;
    padding: 60px 20px;
}

.rw-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: rw-spin 0.75s linear infinite;
    margin: 0 auto 14px;
}

@keyframes rw-spin {
    to { transform: rotate(360deg); }
}

.rw-loading p {
    color: #9ca3af;
    font-size: 14px;
    margin: 0;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.rw-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.rw-empty svg {
    display: block;
    margin: 0 auto 16px;
}

.rw-empty p {
    font-size: 15px;
    margin: 0 0 4px;
    color: #6b7280;
}

/* ==========================================================================
   Job Cards
   ========================================================================== */

.rw-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rw-job-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: box-shadow 0.18s, border-color 0.18s;
    overflow: hidden;
}

.rw-job-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 2px 16px rgba(59, 130, 246, 0.1);
}

.rw-job-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    gap: 16px;
}

.rw-job-info {
    flex: 1;
    min-width: 0;
}

.rw-job-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    text-decoration: none;
    margin-bottom: 6px;
    line-height: 1.35;
    transition: color 0.15s;
}

.rw-job-title:hover {
    color: #3b82f6;
}

.rw-job-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}

.rw-job-company {
    color: #374151;
    font-weight: 500;
}

.rw-job-location {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #6b7280;
}

.rw-job-date {
    color: #9ca3af;
    font-size: 12px;
}

.rw-job-sep {
    color: #d1d5db;
    line-height: 1;
}

.rw-job-source {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s;
}

.rw-job-source:hover {
    color: #3b82f6;
}

.rw-apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #eff6ff;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.rw-apply-btn:hover {
    background: #3b82f6;
    color: #fff;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.rw-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 0 8px;
    flex-wrap: wrap;
}

.rw-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.rw-page-btn:hover:not(:disabled) {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #3b82f6;
}

.rw-page-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.rw-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.rw-page-ellipsis {
    font-size: 14px;
    color: #9ca3af;
    padding: 0 4px;
    line-height: 34px;
}

.rw-page-info {
    font-size: 12px;
    color: #9ca3af;
    margin-left: 8px;
}

/* ==========================================================================
   Donate & Ad Slot
   ========================================================================== */

.rw-donate-section {
    text-align: center;
    margin-top: 32px;
    padding: 24px;
    background: #fffbeb;
    border-radius: 12px;
    border: 1px solid #fde68a;
}

.rw-donate-section p {
    margin: 0 0 12px;
    color: #92400e;
    font-size: 15px;
}

.rw-ad-slot {
    margin-top: 24px;
    text-align: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.rw-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

.rw-footer-links {
    font-size: 13px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.rw-footer-links a {
    color: #6b7280;
    text-decoration: none;
}

.rw-footer-links a:hover {
    color: #3b82f6;
}

.rw-footer-sep {
    color: #d1d5db;
}

/* ==========================================================================
   Disclaimer Modal
   ========================================================================== */

.rw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.rw-modal {
    background: #fff;
    border-radius: 14px;
    max-width: 400px;
    width: 100%;
    padding: 28px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
    animation: rw-modal-in 0.2s ease;
}

@keyframes rw-modal-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rw-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 10px;
}

.rw-modal-body {
    font-size: 14px;
    color: #374151;
    line-height: 1.65;
    margin: 0 0 20px;
}

.rw-btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 15px;
}

/* ==========================================================================
   Search Button – Loading State
   ========================================================================== */

.rw-btn-spinner {
    animation: rw-spin 0.75s linear infinite;
}

@keyframes rw-spin-btn {
    to { transform: rotate(360deg); }
}

.rw-btn-loading {
    opacity: 0.85;
    cursor: wait !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .rw-results-layout {
        flex-direction: column-reverse;
    }

    .rw-map-wrap {
        width: 100%;
        position: static;
    }

    .rw-map {
        height: 320px;
    }
}

@media (max-width: 640px) {
    .rw-container {
        padding: 12px;
    }

    .rw-title {
        font-size: 26px;
    }

    .rw-filter-bar {
        flex-direction: column;
        gap: 10px;
    }

    .rw-filter-group {
        min-width: 0;
        width: 100%;
    }

    .rw-filter-actions {
        padding-top: 0;
        width: 100%;
    }

    .rw-filter-actions .rw-btn {
        flex: 1;
    }

    .rw-job-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .rw-apply-btn {
        align-self: flex-start;
    }

    .rw-map {
        height: 260px;
    }
}
