/* Moved from index.html */

:root {
    --primary: #4a6fa5;
    --secondary: #6b8cbc;
    --accent: #ff6b6b;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: var(--dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

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

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    transition: background 0.3s;
}

nav a:hover, nav a.active {
    background: rgba(255, 255, 255, 0.2);
}

.user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid white;
    color: white;
}

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

/* Main Content */
main {
    padding: 2rem 0;
    flex: 1;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

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

.forum-title {
    font-size: 2rem;
    color: var(--primary);
}

.forum-stats {
    display: flex;
    gap: 15px;
    color: var(--gray);
    font-size: 0.9rem;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.category-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-header {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    font-size: 1.5rem;
}

.category-body {
    padding: 1rem;
}

.category-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--gray);
    padding-top: 10px;
    border-top: 1px solid var(--light-gray);
}

.topics-list {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 2rem;
}

.topics-header {
    background-color: var(--light);
    padding: 1rem;
    display: grid;
    grid-template-columns: 5fr 1fr 1fr;
    font-weight: 600;
    border-bottom: 1px solid var(--light-gray);
}

.topic-row {
    display: grid;
    grid-template-columns: 5fr 1fr 1fr;
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
    transition: background 0.2s;
}

.topic-row:hover {
    background-color: #f8f9fa;
}

.topic-info {
    display: flex;
    gap: 10px;
}

.topic-icon {
    color: var(--primary);
    font-size: 1.2rem;
}

.topic-title {
    font-weight: 500;
    color: var(--dark);
    text-decoration: none;
}

.topic-title:hover {
    color: var(--primary);
    text-decoration: underline;
}

.topic-stats, .topic-latest {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 0.9rem;
}

.topic-latest {
    align-items: flex-end;
}

.latest-time {
    font-weight: 500;
    color: var(--dark);
}

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

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

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

.modal-footer {
    padding: 1rem;
    background: var(--light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
    font-size: 0.9rem;
}

/* Topic Page */
.topic-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 1rem;
}

.topic-title {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.topic-meta {
    color: var(--gray);
    font-size: 0.9rem;
}

.topic-author {
    display: flex;
    gap: 10px;
    align-items: center;
}

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

.topic-content {
    line-height: 1.8;
    margin-bottom: 2rem;
}

.topic-content pre {
    background: var(--light);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1rem 0;
}

.topic-content code {
    background: var(--light);
    padding: 2px 5px;
    border-radius: 4px;
}

.replies-header {
    font-size: 1.5rem;
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
}

.reply {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.reply-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reply-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.reply-date {
    color: var(--gray);
    font-size: 0.9rem;
}

.reply-content {
    line-height: 1.7;
}

.reply-actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.reply-action {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reply-action:hover {
    color: var(--primary);
}

.reply-form {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-top: 2rem;
}

.reply-form h3 {
    margin-bottom: 1rem;
}

/* Categories Page */
.breadcrumb {
    margin-bottom: 1.5rem;
    color: var(--gray);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Profile Page */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    position: relative;
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border: 4px solid white;
    box-shadow: var(--shadow);
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 1rem;
}

.stat-item {
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
}

.profile-content {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
}

.profile-sidebar {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.info-item {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-main {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
}

.user-topics .topic-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.topic-date {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .topics-header, .topic-row {
        grid-template-columns: 1fr;
    }
    
    .topic-stats, .topic-latest {
        display: none;
    }
    
    .forum-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .profile-content {
        grid-template-columns: 1fr;
    }
}