/* Profile Activity Tabs Styling
 *
 * This CSS provides accessible tab navigation for user profiles with:
 * - High contrast colors meeting WCAG AA standards
 * - Clear focus indicators for keyboard navigation
 * - Support for high contrast system preferences
 * - Responsive design for mobile accessibility
 * - Proper visual hierarchy and readable text
 */

/* Accessibility Improvements */
.card-header-tabs .nav-link:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.card-header-tabs .nav-link:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
        .card-header-tabs .nav-link {
        border: 2px solid #000000;
        color: #000000 !important;
        background-color: #ffffff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .card-header-tabs .nav-link:hover {
        background-color: #f0f0f0;
        color: #000000 !important;
        border-color: #000000;
    }

    .card-header-tabs .nav-link.active {
        background-color: #000000;
        color: #ffffff !important;
        border-color: #000000;
        transform: translateY(-2px);
    }

    .card-header-tabs .badge {
        background-color: #000000 !important;
        color: #ffffff !important;
        border: 1px solid #000000;
    }

    .card-header-tabs .nav-link.active .badge {
        background-color: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #ffffff;
    }
}

/* Tab Navigation */
.card-header-tabs {
    border-bottom: none;
    margin-bottom: 0;
}

.card-header-tabs .nav-link {
    border: 1px solid #dee2e6;
    border-bottom: 3px solid transparent;
    color: #495057 !important;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    background-color: #ffffff;
    font-weight: 500;
    border-radius: 0.375rem 0.375rem 0 0;
    margin-right: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header-tabs .nav-link:hover {
    border-color: #007bff;
    color: #212529 !important;
    background-color: #f8f9fa;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.2);
}

.card-header-tabs .nav-link.active {
    color: #ffffff !important;
    border-color: #007bff;
    border-bottom-color: #007bff;
    background-color: #007bff;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
}

.card-header-tabs .nav-link i {
    margin-right: 0.5rem;
}

.card-header-tabs .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: #007bff !important;
    color: #ffffff !important;
    border: 1px solid #007bff;
    font-weight: 600;
}

.card-header-tabs .nav-link.active .badge {
    background-color: #ffffff !important;
    color: #007bff !important;
    border: 1px solid #ffffff;
    font-weight: 600;
}

/* Activity Content Styling */
.activity-item {
    padding: 1rem 0;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

.activity-meta .badge {
    font-size: 0.75rem;
}

/* Search and Filter Controls */
.activity-controls {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
}

.activity-controls .form-control {
    border-color: #ced4da;
}

.activity-controls .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.activity-controls .btn-outline-primary {
    border-color: #007bff;
}

.activity-controls .btn-outline-secondary {
    border-color: #6c757d;
}

/* Post Activity Styling */
.post-activity-item {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05) 0%, rgba(0, 123, 255, 0.02) 100%);
    border-left: 4px solid #007bff;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
}

.post-activity-item h6 {
    margin-bottom: 0.75rem;
    color: #212529;
}

.post-activity-item h6 a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.post-activity-item h6 a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.post-activity-content {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-activity-tags .badge {
    background-color: #e9ecef;
    color: #495057;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    font-weight: normal;
}

/* Comment Activity Styling */
.comment-activity-item {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.02) 100%);
    border-left: 4px solid #28a745;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
}

.comment-context {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e9ecef;
}

.comment-context small {
    color: #6c757d;
    font-weight: 500;
}

.comment-context a {
    color: #007bff;
    text-decoration: none;
}

.comment-context a:hover {
    text-decoration: underline;
}

/* Stance Badges */
.stance-agree {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb;
}

.stance-disagree {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb;
}

.stance-neutral {
    background-color: #e2e3e5 !important;
    color: #383d41 !important;
    border: 1px solid #d6d8db;
}

/* Score Badges */
.score-high {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
}

.score-medium {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

.score-low {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

/* Pagination Styling */
.pagination {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.pagination .page-link {
    color: #007bff;
    border-color: #dee2e6;
    padding: 0.5rem 0.75rem;
}


.pagination .page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: #ffffff;
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

.empty-state h5 {
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-header-tabs {
        flex-direction: column;
        background-color: #f8f9fa;
        padding: 0.5rem;
        border-radius: 0.375rem;
    }

        .card-header-tabs .nav-link {
        text-align: center;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        margin-bottom: 0.25rem;
        margin-right: 0;
        background-color: #ffffff;
        color: #495057 !important;
        font-weight: 500;
    }

    .card-header-tabs .nav-link:hover {
        background-color: #e9ecef;
        color: #212529 !important;
        border-color: #007bff;
    }

    .card-header-tabs .nav-link.active {
        background-color: #007bff;
        color: #ffffff !important;
        border-color: #007bff;
        border-left: 4px solid #0056b3;
        font-weight: 600;
    }

    .activity-controls {
        padding: 0.75rem;
    }

    .activity-controls .d-flex {
        flex-direction: column;
        gap: 0.75rem;
    }

    .activity-controls .d-flex.gap-2 > * {
        width: 100%;
    }

    .post-activity-item,
    .comment-activity-item {
        padding: 1rem;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
    }

    .d-flex.justify-content-between .text-end {
        text-align: left !important;
    }
}

@media (max-width: 576px) {
    .activity-controls form {
        flex-direction: column;
    }

    .activity-controls .form-control {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }

    .dropdown-menu {
        position: static !important;
        display: block;
        float: none;
        width: 100%;
        margin-top: 0.5rem;
        border: 1px solid #dee2e6;
        box-shadow: none;
    }
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Activity Metrics */
.activity-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

.activity-stat {
    text-align: center;
    flex: 1;
}

.activity-stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    display: block;
}

.activity-stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animation for tab transitions */
.tab-content {
    animation: fadeIn 0.3s ease-in;
}

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