/* Resident Swap Platform — Frontend Styles */
:root {
    --rsp-primary:   #1a73e8;
    --rsp-danger:    #c62828;
    --rsp-success:   #2e7d32;
    --rsp-warning:   #e65100;
    --rsp-bg:        #f8f9fa;
    --rsp-border:    #dee2e6;
    --rsp-text:      #333;
    --rsp-hint:      #6c757d;
    --rsp-radius:    6px;
    --rsp-shadow:    0 2px 8px rgba(0,0,0,.08);
}

/* ---- General ---- */
.rsp-notice {
    padding: 12px 16px;
    border-radius: var(--rsp-radius);
    margin: 12px 0;
    border-left: 4px solid var(--rsp-primary);
    background: #e8f0fd;
}
.rsp-success {
    border-color: var(--rsp-success);
    background: #e8f5e9;
    color: #1b5e20;
}
.rsp-error {
    border-color: var(--rsp-danger);
    background: #ffebee;
    color: #b71c1c;
}
.rsp-error ul { margin: 4px 0 0 16px; padding: 0; }
.rsp-hint {
    color: var(--rsp-hint);
    font-size: .85em;
    margin: 4px 0 0;
}
.rsp-required { color: var(--rsp-danger); }

/* ---- Buttons ---- */
.rsp-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: var(--rsp-radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: opacity .15s;
}
.rsp-btn:hover { opacity: .85; }
.rsp-btn-primary  { background: var(--rsp-primary);  color: #fff; }
.rsp-btn-danger   { background: var(--rsp-danger);   color: #fff; }
.rsp-btn-secondary{ background: #455a64; color: #fff; }
.rsp-btn-link     { background: transparent; color: var(--rsp-primary); padding-left: 0; }
.rsp-btn-sm       { padding: 5px 12px; font-size: .8rem; }

/* ---- Form ---- */
.rsp-form {
    max-width: 680px;
}
.rsp-form-section {
    background: #fff;
    border: 1px solid var(--rsp-border);
    border-radius: var(--rsp-radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--rsp-shadow);
}
.rsp-form-section h3 {
    margin: 0 0 16px;
    font-size: 1rem;
    color: var(--rsp-primary);
    border-bottom: 1px solid var(--rsp-border);
    padding-bottom: 8px;
}
.rsp-form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}
.rsp-form-row label { font-weight: 600; margin-bottom: 5px; font-size: .9rem; }
.rsp-form-row input,
.rsp-form-row select,
.rsp-form-row textarea {
    padding: 8px 10px;
    border: 1px solid var(--rsp-border);
    border-radius: 4px;
    font-size: .95rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}
.rsp-form-row input:focus,
.rsp-form-row select:focus,
.rsp-form-row textarea:focus {
    outline: none;
    border-color: var(--rsp-primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}
.rsp-form-actions { margin-top: 8px; }

/* ---- Dashboard ---- */
.rsp-dashboard { max-width: 780px; }
.rsp-dashboard h2 { margin-bottom: 6px; }
.rsp-card {
    background: #fff;
    border: 1px solid var(--rsp-border);
    border-radius: var(--rsp-radius);
    margin-bottom: 18px;
    box-shadow: var(--rsp-shadow);
    overflow: hidden;
}
.rsp-card.rsp-matched { border-color: var(--rsp-success); }
.rsp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--rsp-bg);
    border-bottom: 1px solid var(--rsp-border);
    font-size: .85rem;
}
.rsp-card-date { color: var(--rsp-hint); }
.rsp-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.rsp-badge-waiting { background: #fff3e0; color: var(--rsp-warning); }
.rsp-badge-matched { background: #e8f5e9; color: var(--rsp-success); }
.rsp-card-body { padding: 14px 16px; }
.rsp-card-row { margin-bottom: 6px; font-size: .9rem; }
.rsp-match-info {
    background: #e8f5e9;
    border-radius: 4px;
    padding: 10px 14px;
    margin-top: 12px;
    border: 1px solid #a5d6a7;
}
.rsp-match-info h4 { margin: 0 0 6px; font-size: .95rem; color: var(--rsp-success); }
.rsp-card-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--rsp-border);
    background: var(--rsp-bg);
}

/* ---- Listings ---- */
.rsp-listings { max-width: 900px; }
.rsp-filter-form {
    background: #fff;
    border: 1px solid var(--rsp-border);
    border-radius: var(--rsp-radius);
    padding: 14px 16px;
    margin-bottom: 20px;
}
.rsp-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.rsp-filter-row label { font-size: .85rem; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.rsp-filter-row select { padding: 6px 8px; border: 1px solid var(--rsp-border); border-radius: 4px; }
.rsp-results-count { color: var(--rsp-hint); font-size: .85rem; margin-bottom: 12px; }
.rsp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.rsp-listing-card {
    background: #fff;
    border: 1px solid var(--rsp-border);
    border-radius: var(--rsp-radius);
    overflow: hidden;
    box-shadow: var(--rsp-shadow);
    transition: box-shadow .2s;
}
.rsp-listing-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.rsp-listing-thumb img { width: 100%; height: 160px; object-fit: cover; display: block; }
.rsp-listing-body { padding: 14px; }
.rsp-listing-route {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--rsp-text);
}
.rsp-arrow { color: var(--rsp-primary); font-size: 1.1em; }
.rsp-listing-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: .8rem;
    color: var(--rsp-hint);
    margin-bottom: 10px;
}
.rsp-listing-meta span {
    background: var(--rsp-bg);
    border-radius: 10px;
    padding: 2px 8px;
}

@media (max-width: 600px) {
    .rsp-filter-row { flex-direction: column; }
    .rsp-grid { grid-template-columns: 1fr; }
    .rsp-form-section { padding: 14px; }
}
