/* ============================================
   SocialOrbit Prototype - Social Feed Styles
   ============================================ */

:root {
    /* Colors - Cosmic Dark Theme */
    --bg-primary: #0a0f1a;
    --bg-secondary: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-input: rgba(0, 0, 0, 0.3);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accent Colors */
    --accent-primary: #0ea5e9;
    --accent-secondary: #2dd4bf;
    --accent-pink: #ec4899;
    --gradient-accent: linear-gradient(135deg, #0ea5e9 0%, #2dd4bf 100%);

    /* Status */
    --success: #22c55e;
    --warning: #f59e0b;

    /* UI */
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-glow: rgba(14, 165, 233, 0.4);

    /* Effects */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.2);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-secondary);
}

/* Header */
.proto-header {
    text-align: center;
    padding: var(--space-xl) var(--space-xl) var(--space-md);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.back-link {
    display: inline-block;
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.proto-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.proto-icon {
    font-size: 1.75rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.proto-title h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

.badge {
    font-size: 0.65rem;
    padding: var(--space-xs) var(--space-sm);
    background: var(--gradient-accent);
    color: white;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.proto-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Connection Bar */
.connection-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-sm) var(--space-xl);
}

.connection-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
}

.status-indicator.connected {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.connect-btn {
    padding: var(--space-xs) var(--space-md);
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.connect-btn:hover {
    transform: scale(1.05);
}

.connect-btn.connected {
    background: var(--success);
}

/* Main Container - 3 Column Layout */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg);
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: var(--space-lg);
}

/* Sidebar Cards */
.profile-sidebar,
.friends-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.profile-card,
.compose-card,
.your-posts,
.friends-card,
.activity-card,
.encryption-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

/* Profile Card */
.profile-card {
    text-align: center;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: var(--gradient-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto var(--space-sm);
}

.profile-card h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

.profile-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Compose Card */
.compose-card textarea {
    width: 100%;
    min-height: 80px;
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    resize: none;
    margin-bottom: var(--space-sm);
}

.compose-card textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.compose-card textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compose-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compose-options {
    display: flex;
    gap: var(--space-xs);
}

.option-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.option-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.post-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.post-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.post-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lock-icon {
    font-size: 0.8rem;
}

/* Circle Selector */
.circle-selector {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.circle-selector label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.circle-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.circle-btn {
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.circle-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.circle-btn.active {
    background: var(--gradient-accent);
    border-color: transparent;
    color: white;
}

/* Circles Card */
.circles-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.circles-card h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    font-weight: 500;
}

.circles-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.circle-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s ease;
}

.circle-item:hover {
    background: var(--bg-card-hover);
}

.circle-icon {
    font-size: 1rem;
}

.circle-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.circle-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Your Posts */
.your-posts h4,
.friends-card h4,
.activity-card h4,
.encryption-card h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    font-weight: 500;
}

.posts-list {
    max-height: 200px;
    overflow-y: auto;
}

.empty-state {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* Feed Section */
.feed-section {
    min-height: 500px;
}

.feed-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.feed-header h2 {
    font-size: 1.5rem;
}

.feed-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.feed-empty {
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.feed-empty h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.feed-empty p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-sm);
}

.empty-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Post Card */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    animation: post-appear 0.4s ease;
}

@keyframes post-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.post-avatar {
    width: 48px;
    height: 48px;
    background: var(--gradient-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.post-meta {
    flex: 1;
}

.post-author {
    font-weight: 600;
    font-size: 1rem;
}

.post-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-encrypted-badge {
    font-size: 0.7rem;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border-radius: var(--radius-full);
}

.post-content {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.post-actions {
    display: flex;
    gap: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.post-action {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.post-action:hover {
    color: var(--accent-primary);
    background: rgba(14, 165, 233, 0.1);
}

.post-action.liked {
    color: var(--accent-pink);
}

.post-action.liked:hover {
    background: rgba(236, 72, 153, 0.1);
}

/* Friends List */
.friends-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.friend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background 0.2s ease;
}

.friend-item:hover {
    background: var(--bg-card-hover);
}

.friend-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.friend-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.friend-status {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-left: auto;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.activity-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: var(--space-sm);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.activity-item strong {
    color: var(--text-primary);
}

/* Encryption Card */
.encryption-card ul {
    list-style: none;
}

.encryption-card li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: var(--space-xs) 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.encryption-card li::before {
    content: "✓";
    color: var(--success);
    font-size: 0.75rem;
}

/* Encryption Proof */
.encryption-proof {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg) var(--space-lg);
}

.proof-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.proof-toggle:hover {
    background: var(--bg-card-hover);
}

.toggle-arrow {
    transition: transform 0.2s ease;
}

.proof-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.proof-content {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.proof-content.open {
    display: flex;
}

.proof-item {
    text-align: center;
}

.proof-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.proof-item code {
    display: block;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.proof-item code.encrypted {
    color: var(--accent-secondary);
    font-size: 0.7rem;
}

.proof-arrow {
    color: var(--accent-primary);
    font-size: 1.25rem;
}

/* Footer */
.proto-footer {
    text-align: center;
    padding: var(--space-xl);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .profile-sidebar,
    .friends-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--space-md);
    }

    .your-posts {
        display: none;
    }
}

@media (max-width: 600px) {
    .connection-inner {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .profile-sidebar,
    .friends-sidebar {
        grid-template-columns: 1fr;
    }
}

/* Mini Post (for sidebar) */
.mini-post {
    padding: var(--space-sm);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
}

.mini-post-content {
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mini-post-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}