/**
 * Data A Satu - Portal Berita Indonesia
 * Modern News Portal Design
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --secondary: #1e3a8a;
    --accent: #f59e0b;
    --dark: #111827;
    --gray-900: #1f2937;
    --gray-800: #374151;
    --gray-700: #4b5563;
    --gray-600: #6b7280;
    --gray-500: #9ca3af;
    --gray-400: #d1d5db;
    --gray-300: #e5e7eb;
    --gray-200: #f3f4f6;
    --gray-100: #f9fafb;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* ========================================
   Reset & Base
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    background: var(--gray-100);
    line-height: 1.6;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

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

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

/* ========================================
   Top Bar
   ======================================== */
.top-bar {
    background: var(--dark);
    color: var(--gray-300);
    padding: 6px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--gray-800);
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar .social-links a {
    color: var(--gray-400);
    margin-right: 12px;
    font-size: 13px;
    transition: color 0.2s;
}

.top-bar .social-links a:hover {
    color: var(--white);
}

.top-bar .info-links {
    display: flex;
    gap: 15px;
}

.top-bar .info-links a {
    color: var(--gray-400);
}

.top-bar .info-links a:hover {
    color: var(--white);
}

/* ========================================
   Header
   ======================================== */
.main-header {
    background: var(--white);
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    font-size: 18px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

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

.logo-text .tagline {
    font-size: 10px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.search-box {
    position: relative;
}

.search-box input {
    width: 240px;
    padding: 8px 15px 8px 38px;
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    font-size: 13px;
    background: var(--gray-100);
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    width: 280px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}

.btn-subscribe {
    background: var(--primary);
    color: var(--white);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

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

/* ========================================
   Navigation
   ======================================== */
.main-nav {
    background: var(--primary);
    position: sticky;
    top: 65px;
    z-index: 999;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--white);
    padding: 12px 16px;
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.2s;
    border-bottom: 2px solid transparent;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgba(255,255,255,0.1);
    border-bottom-color: var(--white);
}

.nav-menu li a i {
    font-size: 14px;
}

.navbar-toggler {
    display: none;
    background: transparent;
    border: none;
    color: var(--white);
    padding: 12px 15px;
    width: 100%;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

@media (max-width: 991px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        background: var(--primary-dark);
    }
    .nav-menu.show {
        display: flex;
    }
    .navbar-toggler {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .main-nav {
        position: relative;
        top: 0;
    }
    .main-header {
        position: relative;
    }
    .header-right {
        display: none;
    }
}

/* ========================================
   Breaking News
   ======================================== */
.breaking-news {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 8px 0;
    overflow: hidden;
}

.breaking-label {
    background: var(--accent);
    color: var(--dark);
    padding: 3px 10px;
    font-weight: 700;
    font-size: 10px;
    margin-right: 12px;
    border-radius: 3px;
    text-transform: uppercase;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ticker-wrap {
    overflow: hidden;
    flex: 1;
}

.ticker {
    display: flex;
    animation: ticker 35s linear infinite;
}

.ticker:hover {
    animation-play-state: paused;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    white-space: nowrap;
    padding-right: 40px;
}

.ticker-item a {
    color: var(--white);
    font-weight: 500;
    font-size: 13px;
}

.ticker-item a:hover {
    text-decoration: underline;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    padding: 20px 0;
}

/* ========================================
   Section Header
   ======================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--primary);
}

.section-title .badge {
    background: var(--primary);
    color: var(--white);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
}

.view-all {
    color: var(--primary);
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-all:hover {
    color: var(--primary-dark);
}

/* ========================================
   Featured News
   ======================================== */
.featured-section {
    margin-bottom: 25px;
}

.featured-main {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 340px;
    background: var(--dark);
    display: block;
}

.featured-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.featured-main:hover img {
    transform: scale(1.03);
}

.featured-main .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: var(--white);
}

.featured-main .category {
    background: var(--primary);
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 8px;
}

.featured-main h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.featured-main .meta {
    font-size: 11px;
    color: var(--gray-400);
    display: flex;
    gap: 12px;
}

.featured-main .meta i {
    margin-right: 4px;
}

.featured-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.featured-item {
    display: flex;
    gap: 10px;
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.featured-item:hover {
    transform: translateX(3px);
}

.featured-item .thumb {
    width: 100px;
    height: 70px;
    flex-shrink: 0;
    overflow: hidden;
}

.featured-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-item .info {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-item .category-sm {
    color: var(--primary);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.featured-item h4 {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-item:hover h4 {
    color: var(--primary);
}

/* ========================================
   News Card
   ======================================== */
.news-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.news-card .card-thumb {
    height: 140px;
    overflow: hidden;
    position: relative;
}

.news-card .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.news-card:hover .card-thumb img {
    transform: scale(1.05);
}

.news-card .card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card .category-tag {
    color: var(--primary);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.news-card h5 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.4;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card:hover h5 {
    color: var(--primary);
}

.news-card p {
    color: var(--gray-600);
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .meta {
    display: flex;
    gap: 10px;
    font-size: 10px;
    color: var(--gray-500);
    margin-top: auto;
}

.news-card .meta i {
    margin-right: 3px;
}

/* ========================================
   Sidebar Widget
   ======================================== */
.sidebar-widget {
    background: var(--white);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-title i {
    color: var(--primary);
}

/* Popular List */
.popular-list {
    display: flex;
    flex-direction: column;
}

.popular-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.2s;
}

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

.popular-item:hover {
    background: var(--gray-100);
    margin: 0 -10px;
    padding: 10px;
}

.popular-item .rank {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

.popular-item h6 {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-item .views {
    font-size: 10px;
    color: var(--gray-500);
    margin-top: 3px;
}

/* Category List */
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 13px;
    color: var(--gray-700);
}

.category-list li:last-child a {
    border-bottom: none;
}

.category-list li a:hover {
    color: var(--primary);
}

.category-list li a i {
    color: var(--gray-400);
    transition: transform 0.2s;
}

.category-list li a:hover i {
    transform: translateX(3px);
    color: var(--primary);
}

/* ========================================
   No Image Placeholder
   ======================================== */
.no-image {
    background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 140px;
}

.no-image i {
    font-size: 2rem;
    color: var(--gray-400);
}

.no-image-sm {
    background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 70px;
}

.no-image-sm i {
    font-size: 1.5rem;
    color: var(--gray-400);
}

/* ========================================
   Category Section
   ======================================== */
.category-section {
    margin-bottom: 25px;
    background: var(--white);
    border-radius: 8px;
    padding: 15px;
    box-shadow: var(--shadow);
}

.category-section .section-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    margin: -15px -15px 12px;
    padding: 12px 15px;
    background: var(--gray-100);
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid var(--primary);
}

/* ========================================
   Article Detail
   ======================================== */
.article-detail {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.breadcrumb {
    margin-bottom: 12px;
    font-size: 12px;
    background: none;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--gray-500);
}

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

.category-badge {
    background: var(--primary);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 10px;
}

.category-badge a {
    color: var(--white);
}

.article-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--gray-500);
    font-size: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 15px;
}

.article-meta i {
    margin-right: 5px;
}

.article-image {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.article-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--gray-700);
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content img {
    border-radius: 8px;
    margin: 15px 0;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
}

.share-label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 12px;
}

.share-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: scale(1.1);
    color: var(--white);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }

/* ========================================
   Page Header
   ======================================== */
.page-header {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.page-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-header h2 i {
    color: var(--primary);
}

.page-header p {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
}

/* ========================================
   Pagination
   ======================================== */
.pagination-wrap {
    margin-top: 20px;
}

.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: none;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 14px;
    background: var(--white);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: var(--white);
}

.pagination .page-link:hover {
    background: var(--gray-200);
    color: var(--primary);
}

/* ========================================
   Footer
   ======================================== */
.main-footer {
    background: var(--dark);
    color: var(--gray-300);
    padding: 40px 0 0;
    margin-top: 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-brand .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.footer-brand .brand-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--white);
}

.footer-brand .brand-name span {
    color: var(--primary);
}

.footer-desc {
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 15px;
    line-height: 1.6;
}

.footer-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 15px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--gray-400);
    font-size: 13px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--gray-400);
    font-size: 13px;
}

.footer-contact i {
    color: var(--primary);
    width: 16px;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    background: var(--gray-800);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: all 0.2s;
}

.footer-social a:hover {
    background: var(--primary);
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding: 15px 0;
    margin-top: 30px;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
}

/* ========================================
   Empty & Error State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: 8px;
}

.empty-state i {
    color: var(--gray-300);
}

.empty-state h4 {
    margin-top: 12px;
    color: var(--gray-700);
    font-weight: 600;
}

.error-page {
    background: var(--white);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
}

/* ========================================
   Admin Button
   ======================================== */
.btn-admin {
    background: var(--dark);
    color: var(--white);
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

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

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 991px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-right {
        display: none;
    }
    
    .featured-main {
        height: 260px;
    }
    
    .featured-main h2 {
        font-size: 16px;
    }
}

@media (max-width: 767px) {
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .logo-text .brand {
        font-size: 18px;
    }
    
    .main-content {
        padding: 15px 0;
    }
    
    .article-detail {
        padding: 15px;
    }
    
    .article-header h1 {
        font-size: 18px;
    }
    
    .featured-main {
        height: 220px;
    }
    
    .featured-main h2 {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 14px;
    }
}

@media (max-width: 575px) {
    .news-card .card-thumb {
        height: 120px;
    }
    
    .news-card h5 {
        font-size: 12px;
    }
    
    .news-card .card-body {
        padding: 10px;
    }
}

/* ========================================
   Article Detail - Author & Image Caption
   ======================================== */
.author-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.author-info {
    flex: 1;
}

.author-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 2px;
}

.article-date {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.article-date .source {
    color: var(--primary);
    font-weight: 500;
}

.featured-image-wrapper {
    margin-bottom: 20px;
}

.featured-image-wrapper img {
    width: 100%;
    border-radius: 8px;
}

.image-caption {
    font-size: 12px;
    color: var(--gray-500);
    font-style: italic;
    margin-top: 8px;
    padding: 0 5px;
}

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

@media (max-width: 767px) {
    .article-title {
        font-size: 20px;
    }
    
    .author-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .author-name {
        font-size: 13px;
    }
    
    .article-date {
        font-size: 11px;
    }
}
