/* ==========================================================================
   START.AI PropertyActivity - Modern SaaS Responsive UI
   Updated: 2026-11-10
   ========================================================================== */

/* Base Container */
.spa-activity-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
    padding: 28px;
    margin: 20px 0;
    box-sizing: border-box;
}

.spa-activity-container * {
    box-sizing: border-box;
}

/* Header & Actions */
.spa-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 24px;
}

.spa-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spa-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.spa-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.spa-badge-version {
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 9999px;
    border: 1px solid #bfdbfe;
    letter-spacing: 0.03em;
}

.spa-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tabs: Modern Segmented Pill Control */
.spa-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #f8fafc;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.spa-tab-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.spa-tab-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.spa-tab-btn.active {
    background: #ffffff;
    color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* Tab Content Visibility Control */
.spa-tab-content {
    display: none;
    animation: spaFadeIn 0.25s ease-in-out;
}

.spa-tab-content.active {
    display: block;
}

@keyframes spaFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Header */
.spa-section-header {
    margin-bottom: 18px;
}

.spa-section-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.spa-text-muted {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

/* Buttons */
.spa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1.3;
}

.spa-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.spa-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
    color: #ffffff;
}

.spa-btn-secondary {
    background: #f8fafc;
    color: #334155;
    border-color: #cbd5e1;
}

.spa-btn-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.spa-btn-link {
    background: transparent;
    color: #64748b;
    border-color: transparent;
    padding: 8px 12px;
}

.spa-btn-link:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.spa-btn-sm {
    padding: 5px 11px;
    font-size: 0.78rem;
    border-radius: 6px;
}

.spa-btn-icon {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

/* Filter & Search Bar */
.spa-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.spa-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
}

.spa-filter-bar .spa-filter-group:last-child {
    flex: 0 0 auto;
}

/* Form Controls */
.spa-input, .spa-select, .spa-textarea {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 13px;
    font-size: 0.88rem;
    color: #0f172a;
    background: #ffffff;
    width: 100%;
    transition: all 0.15s ease;
    font-family: inherit;
}

.spa-input:focus, .spa-select:focus, .spa-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.spa-input::placeholder, .spa-textarea::placeholder {
    color: #94a3b8;
}

/* Data Tables */
.spa-table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.spa-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    text-align: left;
}

.spa-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.spa-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
}

.spa-table tbody tr:last-child td {
    border-bottom: none;
}

.spa-table tbody tr:hover td {
    background-color: #f8fafc;
}

/* Status Badges */
.spa-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.spa-badge-draft { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.spa-badge-proposed { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.spa-badge-confirmed { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.spa-badge-rescheduled { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.spa-badge-inprogress { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.spa-badge-completed { background: #ccfbf1; color: #0f766e; border: 1px solid #99f6e4; }
.spa-badge-cancelled { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.spa-badge-noshow { background: #fdf2f8; color: #be185d; border: 1px solid #fbcfe8; }

/* Alerts */
.spa-alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.spa-alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

/* Modals */
.spa-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.spa-modal-dialog {
    margin: 40px auto;
    max-width: 640px;
    width: 100%;
}

.spa-modal-content {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    animation: spaModalSlide 0.25s ease-out;
}

@keyframes spaModalSlide {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.spa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.spa-modal-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

.spa-close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.spa-close-modal:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.spa-modal-body {
    padding: 24px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

.spa-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Forms in Modals */
.spa-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}

.spa-form-group {
    flex: 1;
    margin-bottom: 14px;
}

.spa-form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
}

.spa-req {
    color: #ef4444;
    font-weight: bold;
}

.spa-text-center { text-align: center; }
.spa-loading { color: #64748b; font-style: italic; }
.spa-mt-2 { margin-top: 10px; }

/* Timeline Components */
.spa-timeline-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.spa-timeline-filter label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #334155;
    margin: 0;
}

.spa-timeline-filter .spa-select {
    width: auto;
    min-width: 220px;
}

.spa-timeline-filter .spa-input {
    width: auto;
    min-width: 180px;
}

.spa-timeline-list {
    position: relative;
    padding-left: 28px;
    margin-top: 20px;
    border-left: 2px solid #e2e8f0;
}

.spa-timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.spa-timeline-marker {
    position: absolute;
    left: -35px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2563eb;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px #bfdbfe;
}

.spa-timeline-content {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.spa-timeline-content:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    border-color: #cbd5e1;
}

.spa-timeline-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.spa-timeline-desc {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.4;
}

.spa-timeline-time {
    font-size: 0.74rem;
    color: #94a3b8;
    margin-top: 6px;
    font-weight: 500;
}

/* Feedbacks Grid */
.spa-feedbacks-grid {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 28px;
    text-align: center;
}

/* Pagination */
.spa-pagination {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 18px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .spa-activity-container {
        padding: 16px;
    }

    .spa-activity-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .spa-header-right {
        width: 100%;
    }

    .spa-header-right .spa-btn {
        width: 100%;
    }

    .spa-form-row {
        flex-direction: column;
        gap: 0;
    }

    .spa-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .spa-filter-group {
        width: 100%;
    }

    .spa-modal-dialog {
        margin: 20px auto;
        padding: 0 10px;
    }
}
