:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .header {
    background: rgba(15, 23, 42, 0.9);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.unread-badge {
    background: var(--danger);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-card);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.search-bar {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all var(--transition);
}

.search-bar:focus {
    outline: 2px solid var(--accent);
    outline-offset: 0;
    border-color: var(--accent);
}

.search-bar::placeholder {
    color: var(--text-tertiary);
}

/* Filters */
.filters {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.filter-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.filter-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.hamburger {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* Feed */
.feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.feed[role="feed"] {
    list-style: none;
}

/* Activity Card */
.activity-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.activity-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.activity-card.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    border-radius: var(--radius) 0 0 var(--radius);
}

.activity-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.card-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.activity-text {
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.activity-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.timestamp {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.activity-preview {
    margin-top: 0.75rem;
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 100%;
}

.preview-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.preview-video {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.reaction-bar {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all var(--transition);
}

.reaction-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent);
}

.reaction-btn.active {
    color: var(--accent);
}

.reaction-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.comments-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.comments-section.expanded {
    max-height: 1000px;
    padding-top: 1rem;
}

.comment {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.comment-text {
    color: var(--text-secondary);
}

/* Skeleton Loading */
.skeleton {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.skeleton-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
}

.skeleton-text {
    flex: 1;
    height: 1rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

/* Loading More */
.loading-more {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
    .header-top {
        flex-wrap: wrap;
    }

    .hamburger {
        display: block;
    }

    .filters {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        flex-direction: column;
        margin-top: 0;
    }

    .filters.open {
        display: flex;
    }

    .filter-btn {
        width: 100%;
        text-align: left;
    }

    .container {
        padding: 0.5rem;
    }

    .activity-card {
        padding: 1rem;
    }

    .card-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

