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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Noto Sans Bengali', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

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

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-user {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-container {
    padding: 2rem 1rem;
}

/* Content Wrapper */
.content-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.sidebar-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.category-list a:hover {
    color: var(--primary-color);
}

/* Feed */
.feed {
    max-width: 800px;
}

.feed-header {
    margin-bottom: 2rem;
}

.feed-header h2 {
    font-size: 1.8rem;
    color: var(--text-color);
}

/* Post Card */
.post-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
}

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

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

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

.author-avatar-large {
    width: 60px;
    height: 60px;
    font-size: 2rem;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

.author-name:hover {
    color: var(--primary-color);
}

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

.post-category {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-secondary);
    line-height: 1.8;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 0.5rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Post Actions */
.post-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-btn .icon {
    font-size: 1.2rem;
}

.like-btn.liked {
    color: #ef4444;
    border-color: #ef4444;
}

.like-btn.liked .icon {
    animation: heartbeat 0.3s ease-in-out;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

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

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

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

.btn-secondary:hover {
    background: #475569;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-box {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
}

.auth-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-form {
    margin-bottom: 1rem;
}

.auth-switch {
    text-align: center;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* Create Post */
.create-post-container {
    max-width: 800px;
    margin: 0 auto;
}

.create-post-container h1 {
    margin-bottom: 2rem;
}

.post-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Post Detail */
.post-detail-container {
    max-width: 800px;
    margin: 0 auto;
}

.post-detail {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.post-detail-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.post-detail-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 2rem;
}

/* Comments Section */
.comments-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.comments-section h2 {
    margin-bottom: 1.5rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    margin-bottom: 1rem;
    resize: vertical;
}

.comments-list {
    margin-top: 2rem;
}

.comment {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

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

.comment-author {
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

.comment-author:hover {
    color: var(--primary-color);
}

.comment-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.comment-content {
    color: var(--text-color);
    line-height: 1.6;
}

.no-comments {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Profile */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 3rem;
    flex-shrink: 0;
}

.profile-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-username {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.profile-joined {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-stats {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
}

.profile-bio,
.profile-bio-edit {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.profile-bio h3,
.profile-bio-edit h3 {
    margin-bottom: 1rem;
}

.bio-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    margin-bottom: 1rem;
}

.profile-posts h2 {
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .nav-toggle {
        display: block;
        order: 2;
    }

    .nav-brand {
        order: 1;
        flex: 1;
    }

    .nav-user {
        order: 3;
        flex: 1;
        text-align: right;
    }

    .nav-menu {
        display: none;
        order: 4;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        padding: 0.75rem 0;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        order: 2;
    }

    .feed {
        order: 1;
    }

    .post-card {
        padding: 1rem;
    }

    .post-title {
        font-size: 1.25rem;
    }

    .post-actions {
        flex-wrap: wrap;
    }

    .action-btn {
        font-size: 0.875rem;
        padding: 0.4rem 0.75rem;
    }

    .auth-box {
        padding: 1.5rem;
    }

    .create-post-container {
        padding: 0;
    }

    .post-form {
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-info h1 {
        font-size: 1.5rem;
    }

    .profile-stats {
        gap: 1rem;
    }

    .post-detail {
        padding: 1rem;
    }

    .post-detail-title {
        font-size: 1.5rem;
    }

    .comments-section {
        padding: 1rem;
    }
}

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

    .main-container {
        padding: 1rem 0.5rem;
    }

    .sidebar-card {
        padding: 1rem;
    }

    .post-card {
        padding: 0.75rem;
    }

    .author-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .post-title {
        font-size: 1.1rem;
    }

    .btn {
        padding: 0.6rem 1rem;
    }
}
