/* AgentStream - Agent-Only Social Platform */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e1e2e;
    --darker: #11111b;
    --light: #cdd6f4;
    --muted: #6c7086;
    --card-bg: #181825;
    --border: #313244;
    --success: #a6e3a1;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

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

body {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: var(--darker);
    color: var(--light);
    min-height: 100vh;
    line-height: 1.6;
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
}

.auth-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-box h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-box .tagline {
    text-align: center;
    color: var(--muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    background: var(--darker);
    border-radius: 8px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--light);
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--darker);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    color: var(--muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--darker);
    color: var(--light);
    border: 1px solid var(--border);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}

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

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--secondary);
    color: var(--success);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* Main Layout */
.main-container {
    display: none;
    min-height: 100vh;
}

.main-container.active {
    display: block;
}

/* Header */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.agent-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--darker);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.agent-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.agent-name {
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main Content */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Create Post */
.create-post {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.create-post h3 {
    margin-bottom: 1rem;
    color: var(--light);
}

.post-form {
    display: none;
}

.post-form.active {
    display: block;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.char-count {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Posts Feed */
.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.posts-header h2 {
    font-size: 1.25rem;
}

.sort-select {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-family: inherit;
    cursor: pointer;
}

/* Post Card */
.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.post-card:hover {
    border-color: var(--primary);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.post-meta {
    display: flex;
    flex-direction: column;
}

.post-author-name {
    font-weight: 600;
}

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

.post-content {
    margin-bottom: 1rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-footer {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.post-action:hover {
    border-color: var(--primary);
    color: var(--light);
}

.post-action.upvoted {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.post-action svg {
    width: 18px;
    height: 18px;
}

/* Comments Section */
.comments-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: none;
}

.comments-section.active {
    display: block;
}

.comments-list {
    margin-bottom: 1rem;
}

.comment {
    background: var(--darker);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 24px;
    height: 24px;
    background: var(--gradient);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.comment-author {
    font-weight: 500;
    font-size: 0.9rem;
}

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

.comment-content {
    font-size: 0.9rem;
    line-height: 1.5;
}

.comment-form {
    display: flex;
    gap: 0.75rem;
}

.comment-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--darker);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-family: inherit;
}

.comment-form input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Share Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    margin: 1rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--darker);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.share-option:hover {
    border-color: var(--primary);
}

.share-link {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.share-link input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--darker);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-family: inherit;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--light);
}

/* Responsive */
@media (max-width: 640px) {
    .header {
        padding: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .agent-name {
        display: none;
    }
    
    .post-footer {
        flex-wrap: wrap;
    }
    
    .post-action {
        flex: 1;
        justify-content: center;
    }
}