/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: #1a1a1a; background: #f9f9f7; }
a { color: #e67e00; text-decoration: none; }
a:hover { color: #cc6d00; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

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

/* === Header === */
.site-header { background: #1a1a1a; color: #fff; padding: 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { color: #f5b800; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; }
.logo:hover { color: #ffcc33; }
.main-nav { display: flex; gap: 0.25rem; }
.main-nav a { color: #ccc; padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 0.9rem; transition: background .2s, color .2s; }
.main-nav a:hover { background: #333; color: #f5b800; }
.main-nav a.active { background: #f5b800; color: #1a1a1a; font-weight: 600; }
.menu-toggle { display: none; background: none; border: none; color: #f5b800; font-size: 1.5rem; cursor: pointer; }

/* === Main === */
.site-main { padding: 2rem 0; min-height: calc(100vh - 56px - 80px); }
.site-tagline { text-align: center; color: #888; font-size: 1.1rem; margin-bottom: 1.5rem; }

/* === Alerts === */
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1.5rem; font-size: 0.9rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* === Category Sections (Home) === */
.category-section { margin-bottom: 2.5rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; border-bottom: 3px solid #f5b800; padding-bottom: 0.5rem; }
.section-header h2 { font-size: 1.3rem; }
.section-header h2 a { color: #1a1a1a; }
.section-header h2 a:hover { color: #e67e00; }
.see-all { font-size: 0.85rem; color: #888; white-space: nowrap; }
.see-all:hover { color: #e67e00; }

/* === News Grid === */
.news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.news-grid-latest { grid-template-columns: repeat(4, 1fr); }

/* === News Card === */
.news-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.07); transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; border: 1px solid #eee; }
.news-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); border-color: #f5b800; }
.news-card .news-image { aspect-ratio: 16/9; overflow: hidden; background: #eee; }
.news-card .news-image img { width: 100%; height: 100%; object-fit: cover; }
.news-card .news-content { padding: 0.75rem; flex: 1; display: flex; flex-direction: column; }
.news-card h3 { font-size: 0.95rem; line-height: 1.4; margin-bottom: 0.4rem; }
.news-card h3 a { color: #1a1a1a; }
.news-card h3 a:hover { color: #e67e00; }
.news-excerpt { font-size: 0.8rem; color: #666; line-height: 1.5; flex: 1; margin-bottom: 0.5rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: #999; margin-top: auto; }
.news-category { display: inline-block; color: #b38600; font-weight: 600; font-size: 0.75rem; margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.5px; }
.news-category:hover { background: #f5b800; color: #1a1a1a; }
.news-source { font-weight: 600; color: #e67e00; }

/* === News List (Category page) === */
.news-list { display: flex; flex-direction: column; gap: 1rem; }
.news-card-horizontal { flex-direction: row; }
.news-card-horizontal .news-image { width: 250px; min-width: 250px; aspect-ratio: 16/10; }
.news-card-horizontal .news-content { padding: 1rem; }
.news-card-horizontal h2 { font-size: 1.1rem; line-height: 1.4; margin-bottom: 0.5rem; }
.news-card-horizontal h2 a { color: #1a1a1a; }
.news-card-horizontal h2 a:hover { color: #e67e00; }

/* === Category Page === */
.category-page h1 { font-size: 1.6rem; margin-bottom: 1.5rem; color: #1a1a1a; }

/* === Pagination === */
.pagination { display: flex; justify-content: center; gap: 0.25rem; margin-top: 2rem; flex-wrap: wrap; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 0.75rem; background: #fff; border: 1px solid #ddd; border-radius: 8px; color: #555; font-size: 0.9rem; transition: all .2s; }
.page-link:hover { background: #fff8e6; color: #1a1a1a; border-color: #f5b800; }
.page-link.active { background: #f5b800; color: #1a1a1a; border-color: #f5b800; font-weight: 600; }

/* === Footer === */
.site-footer { background: #1a1a1a; color: #999; padding: 1.5rem 0; text-align: center; font-size: 0.85rem; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; }
.sources-bar { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #e0e0e0; font-size: 0.85rem; }
.sources-bar span { color: #888; }
.sources-bar a { color: #666; }
.sources-bar a:hover { color: #e67e00; }
.footer-nav a { color: #999; margin-left: 1rem; }
.footer-nav a:hover { color: #f5b800; }

/* === Error Page === */
.error-page { text-align: center; padding: 4rem 0; }
.error-page h1 { font-size: 5rem; color: #f5b800; margin-bottom: 1rem; }
.error-page p { font-size: 1.1rem; color: #666; margin-bottom: 2rem; }

/* === Static Pages === */
.static-page { max-width: 700px; }
.static-page h1 { font-size: 1.6rem; margin-bottom: 1rem; }
.static-page h2 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }
.static-page p { color: #555; margin-bottom: 0.75rem; }

/* === Empty State === */
.empty-state { text-align: center; padding: 3rem 0; color: #666; }
.empty-state h1 { font-size: 1.5rem; color: #1a1a1a; margin-bottom: 0.5rem; }
.empty-state code { background: #fff8e6; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.9rem; border: 1px solid #f5b800; }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1.25rem; border-radius: 8px; border: 1px solid #ddd; background: #fff; color: #555; font-size: 0.9rem; cursor: pointer; transition: all .2s; text-decoration: none; }
.btn:hover { background: #f9f9f7; color: #1a1a1a; }
.btn-primary { background: #f5b800; color: #1a1a1a; border-color: #f5b800; font-weight: 600; }
.btn-primary:hover { background: #e6ab00; color: #1a1a1a; }
.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-small { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* === Forms === */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; color: #333; margin-bottom: 0.3rem; }
.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #ccc; border-radius: 8px; font-size: 0.9rem; transition: border-color .2s; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: #f5b800; box-shadow: 0 0 0 3px rgba(245,184,0,.15); }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; cursor: pointer; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.inline-form { display: inline; }

/* === Admin Layout === */
.admin-body { background: #f5f5f3; }
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #1a1a1a; color: #fff; padding: 1.5rem 0; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; }
.admin-logo { padding: 0 1.25rem 1.5rem; }
.admin-logo a { color: #f5b800; font-size: 1.2rem; font-weight: 700; }
.admin-nav { display: flex; flex-direction: column; }
.admin-nav a { color: #999; padding: 0.6rem 1.25rem; font-size: 0.9rem; transition: all .2s; }
.admin-nav a:hover { color: #f5b800; background: #333; }
.admin-nav hr { border: none; border-top: 1px solid #333; margin: 0.5rem 0; }
.admin-main { flex: 1; margin-left: 220px; }
.admin-header { background: #fff; padding: 1rem 1.5rem; border-bottom: 2px solid #f5b800; }
.admin-header h1 { font-size: 1.3rem; color: #1a1a1a; }
.admin-content { padding: 1.5rem; }
.admin-actions { margin-bottom: 1rem; }

/* === Admin Table === */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.admin-table th { background: #1a1a1a; color: #f5b800; text-align: left; padding: 0.75rem 1rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #f5b800; }
.admin-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.admin-table tr:hover td { background: #fff8e6; }
.url-cell { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; color: #888; }
.actions-cell { white-space: nowrap; display: flex; gap: 0.25rem; }
.text-center { text-align: center; }

/* === Stats === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border-radius: 10px; padding: 1.5rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-top: 3px solid #f5b800; }
.stat-number { font-size: 2.5rem; font-weight: 700; color: #e67e00; }
.stat-label { font-size: 0.85rem; color: #888; margin-top: 0.25rem; }

/* === Badges === */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-muted { background: #f1f1f1; color: #888; }

/* === Login === */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1a1a1a; }
.login-box { background: #fff; padding: 2rem; border-radius: 12px; width: 100%; max-width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,.3); border-top: 4px solid #f5b800; }
.login-box h1 { text-align: center; font-size: 1.4rem; margin-bottom: 1.5rem; color: #1a1a1a; }

/* === Responsive === */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: #1a1a1a; flex-direction: column; padding: 0.5rem; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 0.75rem 1rem; }

    .news-grid { grid-template-columns: 1fr 1fr; }
    .news-grid-latest { grid-template-columns: 1fr 1fr; }
    .news-card-horizontal { flex-direction: column; }
    .news-card-horizontal .news-image { width: 100%; min-width: auto; }

    .admin-sidebar { display: none; }
    .admin-main { margin-left: 0; }
}

@media (max-width: 480px) {
    .news-grid { grid-template-columns: 1fr; }
    .news-grid-latest { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}
