/**
 * 永强风向标 - Main Stylesheet
 * 简约科技风 蓝色系主题
 */

:root {
    --primary: #0052CC;
    --primary-dark: #003D99;
    --primary-light: #4C9AFF;
    --secondary: #00B8D9;
    --dark: #172B4D;
    --gray: #6B778C;
    --light-gray: #F4F5F7;
    --white: #FFFFFF;
    --sidebar-width: 280px;
    --header-height: 60px;
    --success: #52c41a;
    --danger: #ff4d4f;
    --warning: #faad14;
    --border: #E0E6ED;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    color: var(--dark);
    background: var(--light-gray);
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark) 0%, #0D1B2A 100%);
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-toggle {
    position: fixed;
    left: var(--sidebar-width);
    top: 15px;
    z-index: 1001;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: left 0.3s ease, background 0.2s;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
}

.sidebar.collapsed + .sidebar-toggle {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.sidebar-logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo .logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 24px;
    color: white;
}

.sidebar-logo h1 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.sidebar-logo span {
    color: var(--primary-light);
    font-size: 11px;
}

.sidebar-nav {
    padding: 15px 0;
}

.nav-section {
    margin-bottom: 5px;
}

.nav-section-title {
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(0, 82, 204, 0.3);
    color: white;
    border-left-color: var(--primary-light);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.nav-item .nav-arrow {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.5;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 0;
}

/* ==================== TOPBAR ==================== */
.topbar {
    position: sticky;
    top: 0;
    background: white;
    height: var(--header-height);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger {
    display: none;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.hamburger:hover {
    background: var(--light-gray);
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--dark);
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray);
}

.topbar-breadcrumb a:hover {
    color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-search {
    position: relative;
}

.topbar-search input {
    width: 200px;
    padding: 8px 16px;
    padding-left: 36px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s;
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    width: 260px;
}

.topbar-search::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.topbar-user .avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.topbar-user .points {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.topbar-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.topbar-user::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 8px;
    background: transparent;
}

.topbar-user:hover .topbar-user-dropdown {
    display: block;
}

.topbar-user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--dark);
    font-size: 14px;
    transition: background 0.2s;
}

.topbar-user-dropdown a:hover {
    background: var(--light-gray);
}

.topbar-user-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}

.topbar-user-dropdown a:last-child {
    border-radius: 0 0 8px 8px;
}

.topbar-user-dropdown .divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ==================== PAGE CONTAINER ==================== */
.page-container {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== CARDS ==================== */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
}

.card-header .card-actions {
    display: flex;
    gap: 10px;
}

/* ==================== ARTICLE LIST ==================== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.article-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.article-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 82, 204, 0.12);
}

.article-cover {
    width: 200px;
    height: 130px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
    overflow: hidden;
}

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

.article-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-category {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(0, 82, 204, 0.1);
    color: var(--primary);
    font-size: 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    width: fit-content;
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
    line-height: 1.4;
}

.article-title a {
    text-decoration: none;
    color: inherit;
}

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

.article-summary {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.article-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-top {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 8px;
}

/* ==================== ARTICLE DETAIL ==================== */
.article-detail-header {
    margin-bottom: 30px;
}

.article-detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--dark);
}

.article-detail-meta {
    display: flex;
    gap: 20px;
    color: var(--gray);
    font-size: 14px;
    flex-wrap: wrap;
}

.article-detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content h2 {
    margin: 24px 0 12px;
    font-size: 22px;
}

.article-content h3 {
    margin: 24px 0 12px;
    font-size: 20px;
}

.article-content h4 {
    margin: 20px 0 10px;
    font-size: 18px;
}

.article-content ul,
.article-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

.article-content pre {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.article-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 14px;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--gray);
}

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

.article-content a:hover {
    text-decoration: underline;
}

/* ==================== DOWNLOAD LIST ==================== */
.download-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.download-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 82, 204, 0.12);
}

.download-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.download-info {
    flex: 1;
}

.download-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark);
}

.download-desc {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.download-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
}

.download-points {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.points-tag {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.points-tag.free {
    background: var(--success);
}

.btn-download {
    padding: 8px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-download:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ==================== USER CENTER ==================== */
.user-info-card {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    color: white;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.user-details h3 {
    font-size: 24px;
    margin-bottom: 5px;
}

.user-details p {
    opacity: 0.8;
    font-size: 14px;
}

.user-points-display {
    font-size: 36px;
    font-weight: 700;
    margin: 10px 0;
}

.user-points-display span {
    font-size: 14px;
    opacity: 0.8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--gray);
    margin-top: 5px;
}

/* ==================== CHECKIN ==================== */
.checkin-container {
    text-align: center;
}

.checkin-btn {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    background: linear-gradient(135deg, var(--success), #389e0d);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.checkin-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(82, 196, 26, 0.3);
}

.checkin-btn.done {
    background: #d9d9d9;
    cursor: default;
}

.checkin-btn.done:hover {
    transform: none;
    box-shadow: none;
}

.checkin-info {
    margin-top: 15px;
    color: var(--gray);
    font-size: 14px;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

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

.form-control.error {
    border-color: var(--danger);
}

.form-help {
    font-size: 12px;
    color: var(--gray);
    margin-top: 6px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

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

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

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

.btn-success:hover {
    background: #389e0d;
}

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

.btn-danger:hover {
    background: #cf4444;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--dark);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* ==================== AUTH PAGES ==================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark), #0D1B2A);
    padding: 20px;
}

.auth-card {
    background: white;
    padding: 50px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo .logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 28px;
    color: white;
}

.auth-logo h1 {
    font-size: 28px;
    color: var(--dark);
    margin-bottom: 5px;
}

.auth-logo span {
    color: var(--primary);
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--gray);
}

.auth-footer a {
    color: var(--primary);
}

/* ==================== ADMIN ==================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--dark);
    flex-shrink: 0;
}

.admin-sidebar .sidebar-logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar .sidebar-logo h1 {
    color: white;
    font-size: 18px;
    margin-top: 10px;
}

.admin-sidebar .nav-item {
    color: rgba(255, 255, 255, 0.7);
}

.admin-sidebar .nav-item:hover,
.admin-sidebar .nav-item.active {
    background: rgba(0, 82, 204, 0.3);
    color: white;
}

.admin-main {
    flex: 1;
    background: var(--light-gray);
}

.admin-header {
    background: white;
    padding: 0 25px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-header h2 {
    font-size: 18px;
    color: var(--dark);
}

.admin-container {
    padding: 25px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.admin-stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.admin-stat-card.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.admin-stat-card .stat-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.admin-stat-number {
    font-size: 32px;
    font-weight: 700;
}

.admin-stat-label {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 5px;
}

/* ==================== DATA TABLE ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--light-gray);
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.data-table tr:hover {
    background: rgba(0, 82, 204, 0.03);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .actions {
    display: flex;
    gap: 8px;
}

.data-table .status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.data-table .status.active {
    background: rgba(82, 196, 26, 0.1);
    color: var(--success);
}

.data-table .status.inactive {
    background: rgba(255, 77, 79, 0.1);
    color: var(--danger);
}

/* ==================== CATEGORY TABS ==================== */
.category-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.category-tab {
    padding: 8px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--gray);
    text-decoration: none;
    display: inline-block;
}

.category-tab:hover,
.category-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==================== SEARCH ==================== */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: 25px;
    font-size: 15px;
}

.search-box button {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a {
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--dark);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination a:hover,
.pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--gray);
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--light-gray);
    color: var(--dark);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== HOME HERO ==================== */
.home-hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 40px;
    border-radius: 16px;
    color: white;
    margin-bottom: 25px;
}

.home-hero h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.home-hero p {
    opacity: 0.9;
    font-size: 16px;
}

.home-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark);
}

.empty-state p {
    font-size: 14px;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

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

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ==================== POINTS HISTORY ==================== */
.points-history {
    max-height: 400px;
    overflow-y: auto;
}

.points-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.points-item:last-child {
    border-bottom: none;
}

.points-item .reason {
    font-size: 14px;
    color: var(--dark);
}

.points-item .date {
    font-size: 12px;
    color: var(--gray);
}

.points-item .amount {
    font-size: 16px;
    font-weight: 600;
}

.points-item .amount.positive {
    color: var(--success);
}

.points-item .amount.negative {
    color: var(--danger);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: block;
    }

    .article-item {
        flex-direction: column;
    }

    .article-cover {
        width: 100%;
        height: 180px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-stats {
        grid-template-columns: repeat.grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .user-info-card {
        flex-direction: column;
        text-align: center;
    }

    .admin-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s;
    }

    .admin-sidebar.mobile-open {
        left: 0;
    }

    .admin-main {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 15px;
    }

    .article-detail-title {
        font-size: 24px;
    }

    .topbar {
        padding: 0 15px;
    }

    .topbar-search input {
        width: 150px;
    }

    .topbar-search input:focus {
        width: 180px;
    }

    .auth-card {
        padding: 30px;
    }

    .home-hero {
        padding: 25px;
    }

    .home-hero h1 {
        font-size: 24px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .modal {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .topbar-right {
        gap: 10px;
    }

    .topbar-user .points {
        display: none;
    }

    .download-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .download-points {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

/* ==================== UTILITIES ==================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--gray);
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

.hidden {
    display: none !important;
}

/* ==================== LOADING ==================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

/* ==================== ALERTS ==================== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: rgba(82, 196, 26, 0.1);
    color: var(--success);
    border: 1px solid rgba(82, 196, 26, 0.3);
}

.alert-danger {
    background: rgba(255, 77, 79, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 77, 79, 0.3);
}

.alert-warning {
    background: rgba(250, 173, 20, 0.1);
    color: var(--warning);
    border: 1px solid rgba(250, 173, 20, 0.3);
}

.alert-info {
    background: rgba(0, 82, 204, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 82, 204, 0.3);
}
