/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo h2 {
    color: #3b82f6;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #f1f5f9;
    color: #3b82f6;
}

.nav-link.active {
    color: #3b82f6;
    background-color: #eff6ff;
}

.nav-mobile-toggle {
    display: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
}

/* Main Content Layout */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1rem;
}

/* Desktop-first improvements */
@media (min-width: 1025px) {
    .main-content {
        max-width: 1400px;
    }
}

.content-container {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 2rem;
    height: 100%;
}

.page-content {
    min-height: 70vh;
}

/* Sidebar */
.sidebar, .right-sidebar {
    display: block;
}

.sidebar-section {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

.sidebar-section h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    justify-content: space-around;
    align-items: center;
    background: white;
    border-top: 1px solid #e2e8f0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 1000;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    font-size: 0.75rem;
    padding: 0.5rem;
    transition: color 0.2s;
    flex: 1;
}

.mobile-nav-link i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: #3b82f6;
}

/* Cards and Posts */
.card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.post-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
}

.post-meta {
    flex: 1;
}

.post-author {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.post-time {
    color: #64748b;
    font-size: 0.875rem;
}

.post-content {
    padding: 0 1.5rem 1rem;
}

.post-text {
    color: #334155;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

.post-actions {
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.post-action:hover {
    background-color: #f1f5f9;
    color: #3b82f6;
}

.post-action.liked {
    color: #ef4444;
}

.post-action.liked i {
    animation: heartBeat 0.3s ease-in-out;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* User Cards */
.user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    cursor: pointer;
}

.user-card:hover {
    background-color: #f8fafc;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-username {
    color: #64748b;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-container {
        grid-template-columns: 1fr;
    }

    .sidebar, .right-sidebar {
        display: none;
    }
}

/* Desktop Styles - Show sidebars and proper layout */
@media (min-width: 1025px) {
    .sidebar, .right-sidebar {
        display: block;
    }
    
    .content-container {
        grid-template-columns: 250px 1fr 300px;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .nav-mobile-toggle {
        display: none;
    }
    
    .mobile-nav {
        display: none;
    }
    
    .nav-menu {
        display: flex;
    }
    
    /* Improve font scaling for desktop */
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }
    h4 { font-size: 1.25rem; }
    
    /* Larger content areas for desktop */
    .post {
        max-width: 100%;
    }
    
    .post-content {
        font-size: 1.0625rem;
        line-height: 1.7;
    }
    
    .btn {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }
    
    .form-input,
    .form-textarea {
        padding: 0.875rem;
        font-size: 1rem;
    }
}

/* Large desktop screens */
@media (min-width: 1440px) {
    .main-content {
        max-width: 1400px;
    }
    
    .content-container {
        gap: 2.5rem;
    }
    
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .nav-mobile-toggle {
        display: block;
    }

    .main-content {
        padding: 1rem 0.5rem;
        padding-bottom: 5rem;
    }

    .mobile-nav {
        display: flex;
    }

    .post-header {
        padding: 0.75rem 1rem;
    }

    .post-content {
        padding: 0 1rem 0.75rem;
    }

    .post-actions {
        padding: 0.5rem 1rem;
    }

    .post-action {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }

    .sidebar-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.75rem;
    }

    .main-content {
        padding: 0.75rem 0.25rem;
    }

    .post-header {
        padding: 0.5rem 0.75rem;
    }

    .post-content {
        padding: 0 0.75rem 0.5rem;
    }

    .post-actions {
        padding: 0.375rem 0.75rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.hidden { display: none; }
.visible { display: block; }

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #64748b;
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

/* Additional Components */
.create-post-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.5rem;
    min-height: 60px;
    font-family: inherit;
}

.post-hashtags {
    margin-top: 0.75rem;
}

.hashtag {
    color: #3b82f6;
    font-weight: 500;
    margin-right: 0.5rem;
    cursor: pointer;
}

.hashtag:hover {
    text-decoration: underline;
}

.post-comments {
    border-top: 1px solid #f1f5f9;
    padding: 1rem 1.5rem;
}

.comment-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.comment-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.comment {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.comment-text {
    color: #334155;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.comment-time {
    color: #94a3b8;
    font-size: 0.75rem;
}

.verified-badge {
    color: #3b82f6;
    font-size: 0.875rem;
    margin-left: 0.25rem;
}

.explore-container {
    display: grid;
    gap: 2rem;
}

.trending-section {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.trending-topics {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.trending-topic {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    transition: background-color 0.2s;
    cursor: pointer;
}

.trending-topic:hover {
    background: #f1f5f9;
}

.topic-tag {
    font-weight: 600;
    color: #1e293b;
}

.topic-posts {
    font-size: 0.875rem;
    color: #64748b;
}

.explore-posts {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.post-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card-content {
    padding: 1rem;
}

.post-card-author {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.post-card-text {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.post-card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.notifications-container {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.notifications-container h3 {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
}

.notifications-list {
    max-height: 600px;
    overflow-y: auto;
}

.notification {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

.notification:hover {
    background-color: #f8fafc;
}

.notification.unread {
    background-color: #eff6ff;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-text {
    color: #1e293b;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.notification-time {
    color: #64748b;
    font-size: 0.75rem;
}

.notification-action {
    padding: 0.375rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: none;
    color: #64748b;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-action:hover {
    background-color: #f1f5f9;
    color: #3b82f6;
}

.no-notifications {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
}

.profile-container {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 4px solid #f1f5f9;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h2 {
    margin-bottom: 0.25rem;
    color: #1e293b;
}

.username {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.bio {
    color: #334155;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
}

.profile-posts {
    padding: 1.5rem;
}

.profile-posts h3 {
    margin-bottom: 1rem;
    color: #1e293b;
}

.create-container {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.create-container h3 {
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.create-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.trending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: color 0.2s;
}

.trending-item:hover .trending-tag {
    color: #3b82f6;
}

.trending-tag {
    font-weight: 600;
    color: #1e293b;
}

.trending-count {
    font-size: 0.875rem;
    color: #64748b;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.activity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 0.875rem;
    color: #1e293b;
    margin-bottom: 0.125rem;
}

.activity-time {
    font-size: 0.75rem;
    color: #64748b;
}

.action-count {
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        padding: 1.5rem 1rem;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-stats {
        gap: 1.5rem;
    }

    .create-container {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }
}