/* VikieCloud Forum - Main Stylesheet */

:root {
    --bg-primary: #F7FAFC;
    --bg-white: #FFFFFF;
    --bg-light-blue: #E8F4FD;
    --bg-hover: #DFF1FF;
    --blue-primary: #5BA8E8;
    --blue-dark: #1E3A5F;
    --text-primary: #243447;
    --text-secondary: #4A5568;
    --text-muted: #64748B;
    --border-color: #DCEAF5;
    --border-light: #EDF2F7;
    --success: #48BB78;
    --warning: #ED8936;
    --danger: #F56565;
    --shadow-sm: 0 1px 2px 0 rgba(30, 58, 95, 0.05);
    --shadow: 0 4px 6px -1px rgba(30, 58, 95, 0.07);
    --shadow-md: 0 10px 15px -3px rgba(30, 58, 95, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(30, 58, 95, 0.1);
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--blue-primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; height: auto; }

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

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-logo { display: flex; align-items: center; gap: 12px; }
.header-logo img { height: 40px; }
.header-logo span { font-size: 1.25rem; font-weight: 700; color: var(--blue-dark); }
.header-nav { display: flex; align-items: center; gap: 8px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 0.925rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary { background: var(--blue-primary); color: var(--bg-white); }
.btn-primary:hover { background: var(--blue-dark); color: var(--bg-white); }
.btn-secondary { background: var(--bg-light-blue); color: var(--blue-dark); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }
.btn-outline:hover { background: var(--bg-light-blue); border-color: var(--blue-primary); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text-secondary); font-size: 0.9rem; }
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px var(--bg-light-blue);
}
.form-textarea { min-height: 150px; resize: vertical; }
.form-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, var(--bg-light-blue) 0%, var(--bg-white) 100%);
}
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border-light); background: var(--bg-primary); }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--bg-light-blue) 0%, var(--bg-white) 100%);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.hero h1 { font-size: 2rem; font-weight: 800; color: var(--blue-dark); margin-bottom: 8px; }
.hero p { color: var(--text-secondary); font-size: 1.05rem; max-width: 600px; margin: 0 auto; }

/* Category List */
.category-list { margin-top: 30px; }
.category-item {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.category-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.category-content { display: flex; align-items: center; padding: 20px; gap: 16px; }
.category-icon {
    width: 50px; height: 50px;
    background: var(--bg-light-blue);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}
.category-info { flex: 1; min-width: 0; }
.category-name { font-size: 1.1rem; font-weight: 700; color: var(--blue-dark); margin-bottom: 4px; }
.category-name a { color: inherit; }
.category-name a:hover { color: var(--blue-primary); }
.category-description { color: var(--text-muted); font-size: 0.9rem; }
.category-stats { display: flex; gap: 20px; text-align: center; padding-right: 20px; }
.stat-item { min-width: 60px; }
.stat-value { font-size: 1.1rem; font-weight: 700; color: var(--blue-dark); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Topic List */
.topic-list { margin-top: 20px; }
.topic-item {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 12px;
    transition: box-shadow 0.15s;
}
.topic-item:hover { box-shadow: var(--shadow-md); }
.topic-content { display: flex; align-items: flex-start; padding: 16px 20px; gap: 14px; }
.topic-avatar img { width: 44px; height: 44px; border-radius: var(--radius); object-fit: cover; }
.topic-info { flex: 1; min-width: 0; }
.topic-title {
    font-size: 1rem; font-weight: 600; color: var(--blue-dark); margin-bottom: 4px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.topic-title a { color: inherit; }
.topic-title a:hover { color: var(--blue-primary); }
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    border-radius: 999px;
}
.badge-pinned { background: var(--bg-light-blue); color: var(--blue-dark); }
.badge-locked { background: #FEE2E2; color: #991B1B; }
.badge-new { background: #D1FAE5; color: #065F46; }
.topic-meta { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--text-muted); flex-wrap: wrap; }
.topic-stats { display: flex; gap: 16px; padding-right: 16px; border-left: 1px solid var(--border-light); }
.topic-stat { text-align: center; }
.topic-stat-value { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.topic-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 16px 0; font-size: 0.9rem; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb a { color: var(--blue-primary); }
.breadcrumb-separator { color: var(--border-color); }

/* Page Header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 1.5rem; font-weight: 800; color: var(--blue-dark); }

/* Post */
.post {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
}
.post-header {
    display: flex; align-items: flex-start; padding: 20px; gap: 16px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, var(--bg-light-blue) 0%, var(--bg-white) 100%);
}
.post-avatar img { width: 60px; height: 60px; border-radius: var(--radius); object-fit: cover; }
.post-author { flex: 1; }
.post-author-name { font-size: 1.1rem; font-weight: 700; color: var(--blue-dark); margin-bottom: 2px; }
.post-author-role {
    display: inline-block; padding: 2px 8px;
    background: var(--bg-light-blue); color: var(--blue-dark);
    font-size: 0.75rem; font-weight: 600; border-radius: 999px; text-transform: uppercase;
}
.post-author-role.moderator { background: #FEF3C7; color: #92400E; }
.post-author-role.administrator, .post-author-role.owner { background: #FEE2E2; color: #991B1B; }
.post-meta { margin-top: 6px; font-size: 0.85rem; color: var(--text-muted); }
.post-body { padding: 20px; line-height: 1.7; color: var(--text-primary); }
.post-body a { word-break: break-word; }
.post-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; border-top: 1px solid var(--border-light); background: var(--bg-primary);
}
.post-actions { display: flex; gap: 8px; }
.post-likes { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.9rem; }
.post-likes.liked { color: var(--blue-primary); }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 30px; }
.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 20px; text-align: center;
}
.stat-card-value { font-size: 2rem; font-weight: 800; color: var(--blue-primary); margin-bottom: 4px; }
.stat-card-label { color: var(--text-muted); font-size: 0.9rem; }

/* Footer */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 30px 20px; margin-top: 50px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.footer a { color: var(--blue-primary); }

/* Alerts */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid; }
.alert-success { background: #D1FAE5; border-color: #6EE7B7; color: #065F46; }
.alert-error { background: #FEE2E2; border-color: #FCA5A5; color: #991B1B; }
.alert-warning { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
.alert-info { background: var(--bg-light-blue); border-color: var(--blue-primary); color: var(--blue-dark); }

/* Auth Pages */
.auth-container { max-width: 440px; margin: 60px auto; padding: 0 20px; }
.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}
.auth-header {
    background: linear-gradient(135deg, var(--bg-light-blue) 0%, var(--bg-white) 100%);
    padding: 40px 30px; text-align: center; border-bottom: 1px solid var(--border-light);
}
.auth-logo { height: 60px; margin-bottom: 16px; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--blue-dark); margin-bottom: 8px; }
.auth-subtitle { color: var(--text-muted); }
.auth-body { padding: 30px; }
.auth-footer {
    text-align: center; padding: 20px 30px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
}
.auth-footer a { color: var(--blue-primary); font-weight: 600; }

/* Profile */
.profile-header {
    background: linear-gradient(135deg, var(--bg-light-blue) 0%, var(--bg-white) 100%);
    border-radius: var(--radius-lg); padding: 30px; margin-bottom: 30px; text-align: center;
}
.profile-avatar { width: 100px; height: 100px; border-radius: var(--radius-lg); margin-bottom: 16px; border: 4px solid var(--bg-white); box-shadow: var(--shadow-md); }
.profile-name { font-size: 1.5rem; font-weight: 800; color: var(--blue-dark); margin-bottom: 4px; }
.profile-role {
    display: inline-block; padding: 4px 12px;
    background: var(--blue-primary); color: var(--bg-white);
    font-size: 0.8rem; font-weight: 600; border-radius: 999px; text-transform: uppercase;
}
.profile-stats { display: flex; justify-content: center; gap: 30px; margin-top: 20px; }
.profile-stat { text-align: center; }
.profile-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--blue-dark); }
.profile-stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* Admin Panel */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 260px; background: var(--blue-dark); padding: 20px; flex-shrink: 0; }
.admin-sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 0 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px;
}
.admin-sidebar-logo img { height: 36px; }
.admin-sidebar-logo span { color: var(--bg-white); font-weight: 700; font-size: 1.1rem; }
.admin-nav { list-style: none; }
.admin-nav li { margin-bottom: 4px; }
.admin-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; color: rgba(255,255,255,0.8);
    border-radius: var(--radius); transition: all 0.15s;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.1); color: var(--bg-white); }
.admin-content { flex: 1; padding: 30px; background: var(--bg-primary); }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.admin-title { font-size: 1.75rem; font-weight: 800; color: var(--blue-dark); }

/* Tables */
.data-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-white); border-radius: var(--radius-md);
    overflow: hidden; box-shadow: var(--shadow);
}
.data-table th, .data-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-light); }
.data-table th {
    background: var(--bg-light-blue);
    font-weight: 700; color: var(--blue-dark);
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table tr:hover { background: var(--bg-primary); }
.data-table tr:last-child td { border-bottom: none; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 30px; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px;
    border-radius: var(--radius);
    background: var(--bg-white); border: 1px solid var(--border-color);
    color: var(--text-secondary); font-weight: 600; transition: all 0.15s;
}
.pagination a:hover { background: var(--bg-light-blue); border-color: var(--blue-primary); color: var(--blue-dark); }
.pagination .active { background: var(--blue-primary); border-color: var(--blue-primary); color: var(--bg-white); }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }

/* Search */
.search-box { position: relative; }
.search-input {
    width: 300px; padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-color); border-radius: var(--radius);
    background: var(--bg-white); font-size: 0.9rem;
}
.search-input:focus { outline: none; border-color: var(--blue-primary); box-shadow: 0 0 0 3px var(--bg-light-blue); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* Notifications */
.notification-item {
    padding: 14px 18px; border-bottom: 1px solid var(--border-light); transition: background 0.15s;
}
.notification-item:hover { background: var(--bg-primary); }
.notification-item.unread { background: var(--bg-light-blue); }
.notification-item:last-child { border-bottom: none; }

/* User Info */
.user-info { display: flex; align-items: center; gap: 12px; }
.user-info img { width: 36px; height: 36px; border-radius: var(--radius); }
.user-info-name { font-weight: 600; color: var(--text-primary); }
.user-info-role { font-size: 0.75rem; color: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; gap: 12px; }
    .search-input { width: 100%; max-width: 280px; }
    .category-content { flex-wrap: wrap; }
    .category-stats { width: 100%; justify-content: center; padding: 16px 0 0; border-top: 1px solid var(--border-light); }
    .topic-content { flex-wrap: wrap; }
    .topic-stats { width: 100%; justify-content: center; padding: 12px 0 0; border-left: none; border-top: 1px solid var(--border-light); }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .profile-stats { flex-wrap: wrap; gap: 20px; }
    .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .header-logo span { display: none; }
    .hero h1 { font-size: 1.5rem; }
    .stats-grid { grid-template-columns: 1fr; }
}
