/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }
  
  /* Variables */
  :root {
    --primary-color: #c92ebc;
    --secondary-color: #3182ce;
    --dark-color: #2d3748;
    --light-color: #f7fafc;
    --gray-color: #a0aec0;
    --border-color: #e2e8f0;
  }
  
  /* Utility Classes */
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
  }
  
  .btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #c53030;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Header Styles */
header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.date-display {
    color: var(--gray-color);
    font-size: 14px;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-right: 20px;
}

.main-nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.search-login {
    display: flex;
    align-items: center;
}

.search-form {
    position: relative;
    margin-right: 15px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 200px;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-color);
}

.user-actions {
    display: flex;
    align-items: center;
}

.user-actions .btn {
    margin-left: 10px;
}

/* Hero Section */
.hero {
    margin: 20px 0;
    position: relative;
}

.breaking-news {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.breaking-label {
    font-weight: bold;
    margin-right: 15px;
}

.breaking-content {
    flex: 1;
    overflow: hidden;
    height: 24px;
}

.breaking-text {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 15s linear infinite;
    white-space: nowrap;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.main-featured {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 400px;
}

.main-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px;
}

.featured-content h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.featured-content p {
    font-size: 14px;
    margin-bottom: 10px;
}

.side-featured {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-news {
    display: flex;
    gap: 15px;
    height: 120px;
}

.side-news img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.side-news-content h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.side-news-content p {
    font-size: 14px;
    color: var(--gray-color);
}

/* News Section */
.news-section {
    margin: 40px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.section-title {
    font-size: 22px;
    color: var(--dark-color);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.news-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-content {
    padding: 15px;
}

.news-card-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.news-card-content p {
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 15px;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-color);
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.footer-col h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: white;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: var(--light-color);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    display: inline-block;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    transition: background-color 0.3s;
}

.social-links a:hover {
    background-color: var(--primary-color);
}

.copyright {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-color);
}

.modal-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    color: var(--dark-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-text {
    font-size: 14px;
    color: var(--gray-color);
    margin-top: 5px;
}

.form-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.form-switch a {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

/* Dashboard Styles */
.dashboard-header {
    background-color: var(--light-color);
    padding: 20px 0;
    margin-bottom: 30px;
}

.dashboard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-nav ul {
    display: flex;
    list-style: none;
}

.dashboard-nav li {
    margin-right: 20px;
}

.dashboard-nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
}

.dashboard-nav a.active {
    color: var(--primary-color);
}

.welcome-user {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.news-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.news-form h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.news-editor {
    min-height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.user-news {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-news h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.news-table {
    width: 100%;
    border-collapse: collapse;
}

.news-table th,
.news-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.news-table th {
    background-color: var(--light-color);
    font-weight: 600;
}

.news-table tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.action-btn {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
}

.edit-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
}

.delete-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-main {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main-nav {
        margin: 15px 0;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
    }
    
    .search-login {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-form {
        flex: 1;
        margin-right: 0;
    }
    
    .search-input {
        width: 100%;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
  /* Styling untuk Kartu Berita dengan Gambar */
.news-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.news-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover; /* Membuat gambar menutupi area tanpa distorsi */
}

.news-card-content {
    padding: 1rem;
}

.news-card h3 a {
    text-decoration: none;
    color: #333;
}

.news-card h3 a:hover {
    color: #007bff;
}

.post-meta {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.5rem;
}

/* Styling untuk Kartu Berita */
.news-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Styling untuk Halaman Artikel Penuh */
.post-full {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.post-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.post-meta {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1.5rem;
}

.post-image-full {
    width: 80%; /* Atur lebar gambar */
    max-width: 700px; /* Batas lebar maksimum */
    height: auto;
    display: block; /* Agar margin auto berfungsi */
    margin: 2rem auto; /* Ini akan membuat gambar berada di tengah */
    border-radius: 5px;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

/* Styling untuk Breaking News agar Full-Width */
.breaking-news {
    width: 100%; /* Membuatnya selebar layar */
    background-color: #000269; /* Memberi warna latar belakang merah */
    color: white;
    padding: 10px 0; /* Memberi sedikit ruang di atas dan bawah */
    box-sizing: border-box;
}

.breaking-news .container {
    display: flex;
    align-items: center;
}

/* Styling untuk menengahkan section berita */
.news-section {
    display: grid;
    /* Membuat 3 kolom di layar besar, 2 di tablet, dan 1 di mobile */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 20px; /* Jarak antar kartu berita */
    justify-items: center; /* Menengahkan item di dalam grid */
    padding-top: 2rem;
}

/* ... (kode CSS yang sudah ada) ... */

/* Styling untuk Tabel di Dashboard */
.post-list-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.post-list-table th, .post-list-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.post-list-table th {
    background-color: #f2f2f2;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    margin-right: 5px;
}

.btn-danger {
    background-color: #d9534f;
    color: white;
    border: 1px solid #d43f3a;
}

.btn-danger:hover {
    background-color: #c9302c;
}

/* ... (kode CSS yang sudah ada) ... */

/* Perbaikan untuk Tautan Breaking News */
#breaking-news-link {
    text-decoration: none; /* Menghilangkan garis bawah */
    color: white; /* Mewarisi warna teks dari parent */
    display: flex; /* Memastikan tata letak tetap sama */
    align-items: center;
    transition: background-color 0.2s ease-in-out; /* Transisi halus */
}

#breaking-news-link:hover {
    background-color: #03009e; /* Warna sedikit lebih gelap saat disentuh mouse */
}