/**
 * Saudi Trainers - Features CSS
 * Covers: Filter Form, Result Cards, Escrow Dashboard,
 *         Reputation/Ratings, Privacy Gate, Toast Notifications
 *
 * @package SaudiTrainers
 */

/* ═══════════════════════════════════════════════════════════
   1. FILTER FORM
   ═══════════════════════════════════════════════════════════ */
.st-filter-form {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem 2rem;
    box-shadow: 0 4px 24px rgba(0, 51, 102, 0.08);
    margin-bottom: 2rem;
}

.st-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem 1.25rem;
    align-items: end;
}

.st-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.st-filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #003366;
}

.st-filter-group input,
.st-filter-group select,
.st-filter-group textarea {
    border: 1.5px solid #d0dae8;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    background: #f7f9fc;
    color: #1a1a2e;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.st-filter-group input:focus,
.st-filter-group select:focus {
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.12);
    background: #fff;
}

.st-filter-submit {
    flex-direction: row;
    gap: 0.75rem;
    align-items: flex-end;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.st-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.12s, box-shadow 0.2s;
    border: none;
    text-decoration: none;
}

.st-btn-primary {
    background: linear-gradient(135deg, #003366, #0056b3);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.25);
}

.st-btn-primary:hover {
    background: linear-gradient(135deg, #002244, #004099);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 51, 102, 0.35);
}

.st-btn-secondary {
    background: #f0f4f9;
    color: #003366;
    border: 1.5px solid #d0dae8;
}

.st-btn-secondary:hover {
    background: #e0eaf5;
}

.st-btn-danger {
    background: #dc3545;
    color: #fff;
}

.st-btn-danger:hover {
    background: #c82333;
}

/* ═══════════════════════════════════════════════════════════
   2. SEARCH RESULTS GRID & CARDS
   ═══════════════════════════════════════════════════════════ */
.st-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: st-fade-in 0.3s ease;
}

@keyframes st-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.st-result-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 51, 102, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    display: flex;
    flex-direction: column;
}

.st-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 51, 102, 0.16);
}

.st-card-thumb-wrap {
    display: block;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #003366, #0056b3);
}

.st-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.st-result-card:hover .st-card-thumb {
    transform: scale(1.05);
}

.st-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #003366, #0056b3);
    color: #fff;
    font-size: 3rem;
    font-weight: 700;
}

.st-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.st-card-type-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.st-type-st_trainer { background: #e8f0fe; color: #003366; }
.st-type-st_center  { background: #fff3e0; color: #e65100; }

.st-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.4;
}

.st-card-title a {
    color: inherit;
    text-decoration: none;
}

.st-card-title a:hover { color: #003366; }

.st-card-rating {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: #666;
}

.st-card-meta {
    font-size: 0.82rem;
    color: #777;
}

.st-card-tag {
    display: inline-block;
    background: #f0f4f9;
    color: #003366;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
}

.st-card-excerpt {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.6;
    flex: 1;
    margin: 0;
}

.st-card-cta {
    margin-top: auto;
    width: 100%;
    text-align: center;
}

/* Stars */
.st-stars { color: #f5c518; font-size: 1rem; letter-spacing: 0.02em; }
.st-star-empty { color: #ccc; }

/* Loading / Empty */
.st-loading-spinner,
.st-loading {
    text-align: center;
    padding: 2rem;
    color: #0056b3;
    font-size: 1rem;
    animation: st-pulse 1s infinite alternate;
}

@keyframes st-pulse {
    from { opacity: 0.5; }
    to   { opacity: 1;   }
}

.st-no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.st-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════════════════
   3. ESCROW DASHBOARD
   ═══════════════════════════════════════════════════════════ */
.st-escrow-dashboard {
    max-width: 900px;
    margin: 0 auto;
}

.st-dash-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0eaf5;
    padding-bottom: 0.25rem;
}

.st-dash-tab {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #888;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.st-dash-tab.active,
.st-dash-tab:hover {
    color: #003366;
    border-bottom-color: #003366;
}

.st-contracts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.st-contract-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 51, 102, 0.08);
    border-right: 4px solid #003366;
    transition: box-shadow 0.2s;
}

.st-contract-card:hover { box-shadow: 0 4px 20px rgba(0, 51, 102, 0.14); }

.st-contract-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.st-contract-id {
    font-family: monospace;
    font-size: 0.85rem;
    color: #555;
    background: #f0f4f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.st-contract-status {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.status-offer     { background: #fff3cd; color: #856404; }
.status-held      { background: #cce5ff; color: #004085; }
.status-completed { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

.st-contract-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0.5rem 0;
}

.st-contract-parties {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: #555;
    margin-bottom: 0.75rem;
}

.st-contract-financials {
    background: #f7f9fc;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.st-fin-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e8eef5;
}

.st-fin-row:last-child { border-bottom: none; }
.st-positive { color: #28a745; }
.st-negative { color: #dc3545; }

.st-contract-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.st-contract-date {
    font-size: 0.78rem;
    color: #999;
    margin-top: 0.75rem;
}

/* Offer Form */
.st-offer-form {
    background: #fff;
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: 0 2px 16px rgba(0, 51, 102, 0.08);
    max-width: 600px;
}

.st-form-hint { color: #888; font-size: 0.8rem; }

.st-commission-preview {
    background: #f7f9fc;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.st-preview-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════
   4. REPUTATION / RATINGS
   ═══════════════════════════════════════════════════════════ */
.st-profile-rating {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 51, 102, 0.08);
    margin-bottom: 2rem;
}

.st-profile-rating-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.st-rating-big-num {
    font-size: 3rem;
    font-weight: 800;
    color: #003366;
    line-height: 1;
}

.st-rating-total { font-size: 0.88rem; color: #888; }

.st-ratings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.st-rating-item {
    padding: 1rem;
    background: #f7f9fc;
    border-radius: 10px;
    border-right: 3px solid #f5c518;
}

.st-rating-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.st-reviewer-name { font-weight: 700; color: #1a1a2e; font-size: 0.95rem; }
.st-reviewer-type { font-size: 0.75rem; background: #e8f0fe; color: #003366; padding: 0.1rem 0.5rem; border-radius: 4px; }
.st-rating-date   { font-size: 0.78rem; color: #aaa; margin-right: auto; }
.st-rating-num    { font-size: 0.88rem; color: #555; }
.st-rating-comment { font-size: 0.9rem; color: #555; margin: 0.5rem 0 0; line-height: 1.6; }

/* Star Picker */
.st-rating-form-wrap {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 51, 102, 0.08);
    margin-top: 1.5rem;
}

.st-star-picker {
    display: flex;
    flex-direction: row-reverse;
    gap: 0.2rem;
    margin-bottom: 0.75rem;
    justify-content: flex-end;
}

.st-star-picker input { display: none; }

.st-star-picker label {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.12s, transform 0.12s;
}

.st-star-picker input:checked ~ label,
.st-star-picker label.hovered { color: #f5c518; }

.st-star-picker label:hover { transform: scale(1.15); }

/* ═══════════════════════════════════════════════════════════
   5. PRIVACY GATE
   ═══════════════════════════════════════════════════════════ */
.st-contact-masked {
    background: #f7f9fc;
    border: 1px dashed #d0dae8;
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    color: #888;
    font-family: monospace;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.st-contact-revealed {
    color: #003366;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.st-contact-revealed:hover { text-decoration: underline; }

.st-login-prompt {
    font-size: 0.8rem;
    color: #0056b3;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   6. TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */
.st-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #1a1a2e;
    color: #fff;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 360px;
}

.st-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.st-toast-success { border-right: 4px solid #28a745; }
.st-toast-error   { border-right: 4px solid #dc3545; }

/* ═══════════════════════════════════════════════════════════
   7. FORM MESSAGES
   ═══════════════════════════════════════════════════════════ */
.st-form-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.st-msg-success { background: #d4edda; color: #155724; }
.st-msg-error   { background: #f8d7da; color: #721c24; }

/* ═══════════════════════════════════════════════════════════
   8. PROFILE PAGE GENERAL
   ═══════════════════════════════════════════════════════════ */
.st-login-notice {
    background: #fff3cd;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    color: #856404;
}

.st-no-contracts,
.st-no-ratings {
    text-align: center;
    padding: 2rem;
    color: #888;
}

/* ═══════════════════════════════════════════════════════════
   9. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .st-filter-grid {
        grid-template-columns: 1fr;
    }

    .st-results-grid {
        grid-template-columns: 1fr;
    }

    .st-contract-actions {
        flex-direction: column;
    }

    .st-dash-tabs {
        flex-direction: column;
        border-bottom: none;
        gap: 0.5rem;
    }

    .st-dash-tab {
        border: 1.5px solid #d0dae8;
        border-radius: 8px;
        text-align: center;
    }

    .st-dash-tab.active {
        background: #003366;
        color: #fff;
        border-color: #003366;
    }

    .st-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}
