/* Portal Berita - Complete Stylesheet */
/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #1e40af;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    gap: 20px;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

.logo:hover {
    color: #2563eb;
}

.search-form {
    display: flex;
    gap: 8px;
    max-width: 400px;
    flex: 1;
}

.search-form input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}

.search-form button {
    padding: 10px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.search-form button:hover {
    background: #1e40af;
}

.main-nav {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid #e5e7eb;
    overflow-x: auto;
}

.nav-link {
    padding: 8px 16px;
    color: #4b5563;
    white-space: nowrap;
    border-radius: 6px;
}

.nav-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Ads */
.ad-container {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.ad-header {
    text-align: center;
    padding: 16px 0;
}

.ad-header img {
    margin: 0 auto;
    max-height: 90px;
}

/* Main Content */
.site-main {
    padding: 30px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

/* Hero Article */
.hero-article {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hero-image {
    display: block;
    position: relative;
    padding-bottom: 56.25%;
    overflow: hidden;
}

.hero-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    padding: 24px;
}

.hero-content h1 {
    font-size: 1.875rem;
    line-height: 1.2;
    margin: 12px 0 8px;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #2563eb;
    color: #fff;
    border-radius: 4px;
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
}

.category-badge:hover {
    background: #1e40af;
    color: #fff;
}

/* Post Meta */
.post-meta {
    display: flex;
    gap: 16px;
    color: #6b7280;
    font-size: 0.875rem;
    margin: 8px 0;
}

/* Excerpt */
.excerpt {
    color: #4b5563;
    margin-top: 12px;
    line-height: 1.7;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.post-thumbnail {
    display: block;
    position: relative;
    padding-bottom: 66.67%;
    overflow: hidden;
    background: #f3f4f6;
}

.post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 16px;
}

.post-content h2,
.post-content h3 {
    font-size: 1.125rem;
    line-height: 1.4;
    margin: 8px 0;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #2563eb;
}

.ad-widget {
    padding: 0;
    overflow: hidden;
}

.ad-widget img {
    width: 100%;
}

.post-list {
    list-style: none;
}

.post-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.post-item:last-child {
    border-bottom: none;
}

.post-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
    background: #f3f4f6;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-info h4 {
    font-size: 0.938rem;
    line-height: 1.4;
    margin-bottom: 4px;
}

.post-info .views,
.post-info .date {
    font-size: 0.813rem;
    color: #6b7280;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #4b5563;
}

.page-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.page-link.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.page-dots {
    padding: 8px 4px;
    color: #6b7280;
}

/* Article Detail */
.article-detail {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.article-header {
    margin-bottom: 24px;
}

.article-header h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    margin: 16px 0;
}

.article-featured-image {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
}

.article-content {
    font-size: 1.063rem;
    line-height: 1.8;
    color: #1f2937;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 24px 0 12px;
    line-height: 1.3;
}

.article-content h2 {
    font-size: 1.75rem;
}

.article-content h3 {
    font-size: 1.5rem;
}

.article-content ul,
.article-content ol {
    margin: 16px 0 16px 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content img {
    margin: 20px 0;
    border-radius: 8px;
}

.article-content blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 16px;
    margin: 20px 0;
    font-style: italic;
    color: #4b5563;
}

.ad-mid-article {
    margin: 32px 0;
    text-align: center;
}

.ad-mid-article img {
    margin: 0 auto;
}

.article-share {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.article-share h3 {
    font-size: 1.125rem;
    margin-bottom: 12px;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 20px;
    border-radius: 6px;
    color: #fff;
    font-weight: 500;
    font-size: 0.938rem;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn.telegram {
    background: #0088cc;
}

.share-btn:hover {
    opacity: 0.9;
    color: #fff;
}

/* Related Posts */
.related-posts {
    margin-top: 40px;
}

.related-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

/* Page Header */
.page-header {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.page-header p {
    color: #6b7280;
}

/* Search Page */
.search-page-form {
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-page-form form {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.search-page-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.search-page-form button {
    padding: 12px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.no-results {
    background: #fff;
    padding: 48px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.no-results p {
    margin: 8px 0;
    font-size: 1.063rem;
}

/* 404 Page */
.error-404 {
    background: #fff;
    padding: 64px 32px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.error-404 h1 {
    font-size: 6rem;
    color: #2563eb;
    margin-bottom: 16px;
}

.error-404 h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.error-404 p {
    color: #6b7280;
    margin-bottom: 24px;
}

/* Footer */
.site-footer {
    background: #1f2937;
    color: #9ca3af;
    padding: 32px 0;
    margin-top: 48px;
    text-align: center;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 0.938rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1e40af;
    color: #fff;
}

.btn-secondary {
    background: #6b7280;
    color: #fff;
}

.btn-secondary:hover {
    background: #4b5563;
    color: #fff;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    text-align: center;
    color: #1f2937;
}

.login-box h2 {
    font-size: 1.25rem;
    margin-bottom: 24px;
    text-align: center;
    color: #6b7280;
    font-weight: 400;
}

/* Admin Layout */
.admin-page {
    background: #f3f4f6;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #1f2937;
    color: #fff;
    padding: 24px 0;
    flex-shrink: 0;
}

.admin-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid #374151;
}

.admin-logo h2 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.admin-logo p {
    font-size: 0.875rem;
    color: #9ca3af;
}

.admin-nav {
    padding: 20px 0;
}

.admin-nav .nav-item {
    display: block;
    padding: 12px 20px;
    color: #d1d5db;
    transition: all 0.2s;
}

.admin-nav .nav-item:hover {
    background: #374151;
    color: #fff;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: #fff;
    padding: 20px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: #1f2937;
}

.admin-user {
    color: #6b7280;
}

.admin-content {
    flex: 1;
    padding: 32px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 0.938rem;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

/* Card */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    color: #1f2937;
}

.card-body {
    padding: 24px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.938rem;
    font-family: inherit;
}

.form-group input[type="file"] {
    padding: 8px 0;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.875rem;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.filter-form {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f9fafb;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.813rem;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-secondary {
    background: #e5e7eb;
    color: #4b5563;
}

/* Alert */
.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert ul {
    margin: 8px 0 0 20px;
}

/* Grid Layout */
.row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.col-md-4 {
    flex: 0 0 33.333%;
}

.col-md-8 {
    flex: 0 0 66.667%;
}

.current-image {
    margin-bottom: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
}

.current-image p {
    margin-top: 8px;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form {
        max-width: none;
    }
    
    .main-nav {
        gap: 4px;
    }
    
    .nav-link {
        font-size: 0.875rem;
        padding: 6px 12px;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .article-detail {
        padding: 20px;
    }
    
    .article-header h1 {
        font-size: 1.75rem;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
    }
    
    .admin-nav {
        display: flex;
        overflow-x: auto;
        padding: 12px 0;
    }
    
    .admin-nav .nav-item {
        white-space: nowrap;
    }
    
    .admin-content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-md-4,
    .col-md-8 {
        flex: 1;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}
