/* =====================================================
   KiniJani.com - Main Stylesheet
   Portal Berita Nasional Indonesia
   ===================================================== */

/* CSS Variables - Can be overridden by admin settings */
:root {
    --primary-color: #dc3545;
    --secondary-color: #6c757d;
    --accent-color: #007bff;
    --header-bg: #1a1a2e;
    --header-text: #ffffff;
    --footer-bg: #1a1a2e;
    --footer-text: #ffffff;
    --body-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --link-color: #007bff;
    --border-color: #dee2e6;
    --breaking-bg: #dc3545;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --heading-font: 'Merriweather', Georgia, serif;
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,.175);
    --transition: all 0.3s ease;
    --radius: 8px;
    --radius-lg: 12px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--body-bg);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: var(--transition);
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Top Bar */
.top-bar {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 8px 0;
    font-size: 13px;
}

.top-bar a {
    color: rgba(255,255,255,0.8);
}

.top-bar a:hover {
    color: #fff;
}

.top-bar .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    margin-left: 5px;
}

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

/* Header */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-main {
    padding: 15px 0;
}

.logo img {
    max-height: 50px;
}

.logo-text {
    font-family: var(--heading-font);
    font-size: 32px;
    font-weight: 900;
    color: var(--primary-color);
}

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

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 45px 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: #fff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--header-bg);
}

/* Main Navigation */
.main-nav {
    background: var(--header-bg);
}

.main-nav .navbar-nav .nav-link {
    color: var(--header-text);
    font-weight: 500;
    padding: 15px 18px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.main-nav .navbar-nav .nav-link:hover,
.main-nav .navbar-nav .nav-link.active {
    background: var(--primary-color);
    color: #fff;
}

.main-nav .dropdown-menu {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px 0;
}

.main-nav .dropdown-item {
    padding: 8px 20px;
    font-size: 14px;
}

.main-nav .dropdown-item:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Breaking News Ticker */
.breaking-news {
    background: var(--breaking-bg);
    color: #fff;
    padding: 10px 0;
    overflow: hidden;
}

.breaking-label {
    background: rgba(0,0,0,0.3);
    padding: 5px 15px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    border-radius: 3px;
}

.breaking-label i {
    margin-right: 8px;
    animation: pulse 1s infinite;
}

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

.ticker-wrap {
    overflow: hidden;
    flex: 1;
    margin-left: 15px;
}

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

.ticker-item {
    white-space: nowrap;
    padding: 0 50px;
}

.ticker-item a {
    color: #fff;
}

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

/* News Cards */
.news-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
}

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

.news-card .card-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.news-card .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.news-card .category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    color: #fff;
}

.news-card .card-body {
    padding: 20px;
}

.news-card .card-title {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-card .card-title a {
    color: var(--text-color);
}

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

.news-card .card-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
}

.news-card .card-meta {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.news-card .card-meta span {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
}

.news-card .card-meta i {
    margin-right: 5px;
    color: var(--primary-color);
}

/* Featured News */
.featured-news {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 100%;
    min-height: 400px;
}

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

.featured-news .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: #fff;
}

.featured-news .category-badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    margin-bottom: 15px;
}

.featured-news h2 {
    color: #fff;
    font-size: 28px;
    margin-bottom: 15px;
}

.featured-news h2 a {
    color: #fff;
}

.featured-news h2 a:hover {
    color: var(--primary-color);
}

.featured-news .meta {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

/* Headline Slider */
.headline-slider {
    position: relative;
    margin-bottom: 40px;
}

.headline-slide {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.headline-slide img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.headline-slide .content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: #fff;
}

.headline-slide h2 {
    color: #fff;
    font-size: 36px;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.sidebar-widget .widget-title {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.sidebar-widget .widget-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50px;
    width: calc(100% - 50px);
    height: 3px;
    background: var(--border-color);
}

/* Popular News Widget */
.popular-news-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.popular-news-item .number {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.popular-news-item .content h4 {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.4;
}

.popular-news-item .content h4 a {
    color: var(--text-color);
}

.popular-news-item .content h4 a:hover {
    color: var(--primary-color);
}

.popular-news-item .meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    color: #fff;
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

.section-title h2 {
    font-size: 22px;
    margin: 0;
}

.section-title .view-all {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
}

/* Article Detail */
.article-header {
    margin-bottom: 30px;
}

.article-header .category-badge {
    margin-bottom: 15px;
}

.article-header h1 {
    font-size: 36px;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
}

.article-meta i {
    margin-right: 8px;
    color: var(--primary-color);
}

.article-featured-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
}

.article-featured-image img {
    width: 100%;
}

.article-featured-image .caption {
    background: var(--body-bg);
    padding: 10px 15px;
    font-size: 13px;
    color: var(--text-muted);
}

.article-content {
    font-size: 17px;
    line-height: 1.8;
}

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

.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content img {
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 20px 30px;
    margin: 2rem 0;
    background: var(--body-bg);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}

/* Tags */
.article-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.article-tags .tag {
    display: inline-block;
    padding: 5px 15px;
    background: var(--body-bg);
    border-radius: 50px;
    font-size: 13px;
    margin: 5px 5px 5px 0;
    color: var(--text-muted);
    transition: var(--transition);
}

.article-tags .tag:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-3px);
    color: #fff;
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }
.share-btn.linkedin { background: #0077b5; }

/* Author Box */
.author-box {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: var(--body-bg);
    border-radius: var(--radius-lg);
    margin: 30px 0;
}

.author-box .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-box .info h4 {
    margin-bottom: 5px;
}

.author-box .info p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* Related News */
.related-news {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

/* Comments */
.comments-section {
    margin-top: 40px;
}

.comment-form {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
}

.comment-form .form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 15px;
}

.comment-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: none;
}

.comment-item {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-item .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--body-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.comment-item .content .meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.comment-item .content .meta .name {
    font-weight: 600;
    color: var(--text-color);
}

.comment-item .content p {
    margin: 0;
}

.comment-item .reply-btn {
    font-size: 13px;
    margin-top: 10px;
}

/* Live Streaming */
.live-stream-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.live-stream-card .video-wrap {
    position: relative;
    padding-top: 56.25%;
}

.live-stream-card .video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.live-stream-card .live-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #dc3545;
    color: #fff;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 3px;
    z-index: 10;
    animation: pulse 1.5s infinite;
}

.live-stream-card .info {
    padding: 20px;
}

.live-stream-card .info h4 {
    margin-bottom: 5px;
}

/* Radio Player */
.radio-player {
    background: linear-gradient(135deg, var(--header-bg), #16213e);
    border-radius: var(--radius-lg);
    padding: 30px;
    color: #fff;
    text-align: center;
}

.radio-player .station-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
}

.radio-player .controls {
    margin-top: 20px;
}

.radio-player .play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.radio-player .play-btn:hover {
    transform: scale(1.1);
}

/* Newsletter */
.newsletter-box {
    background: linear-gradient(135deg, var(--primary-color), #a71d2a);
    padding: 30px;
    border-radius: var(--radius-lg);
    color: #fff;
    text-align: center;
}

.newsletter-box h3 {
    color: #fff;
    margin-bottom: 10px;
}

.newsletter-box p {
    opacity: 0.9;
    margin-bottom: 20px;
}

.newsletter-box .form-control {
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
}

.newsletter-box .btn {
    border-radius: 50px;
    padding: 12px 30px;
    margin-top: 10px;
    width: 100%;
}

/* Poll Widget */
.poll-widget .poll-option {
    margin-bottom: 15px;
}

.poll-widget .poll-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 15px;
    background: var(--body-bg);
    border-radius: var(--radius);
    transition: var(--transition);
}

.poll-widget .poll-option label:hover {
    background: rgba(var(--primary-color), 0.1);
}

.poll-widget .poll-option input {
    margin-right: 10px;
}

.poll-widget .poll-result {
    margin-bottom: 10px;
}

.poll-widget .poll-result .label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.poll-widget .poll-result .bar {
    height: 8px;
    background: var(--body-bg);
    border-radius: 10px;
    overflow: hidden;
}

.poll-widget .poll-result .bar .fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding-top: 60px;
}

.footer h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 15px;
}

.footer h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
}

.footer a {
    color: rgba(255,255,255,0.7);
}

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

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

.footer-links li a {
    display: inline-flex;
    align-items: center;
}

.footer-links li a i {
    margin-right: 10px;
    color: var(--primary-color);
}

.footer-news-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-news-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
}

.footer-news-item h5 {
    font-size: 14px;
    margin-bottom: 5px;
    color: #fff;
    line-height: 1.4;
}

.footer-news-item h5 a {
    color: #fff;
}

.footer-news-item .date {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    margin-top: 40px;
}

.footer-bottom p {
    margin: 0;
    color: rgba(255,255,255,0.6);
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 40px;
}

.pagination .page-link {
    border: none;
    padding: 10px 18px;
    margin: 0 3px;
    border-radius: var(--radius);
    color: var(--text-color);
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.pagination .page-link:hover,
.pagination .page-item.active .page-link {
    background: var(--primary-color);
    color: #fff;
}

/* Breadcrumb */
.breadcrumb-wrap {
    background: var(--card-bg);
    padding: 15px 0;
    margin-bottom: 30px;
}

.breadcrumb {
    margin: 0;
    padding: 0;
    background: none;
}

.breadcrumb-item a {
    color: var(--text-muted);
}

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

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--header-bg);
    color: #fff;
}

/* Responsive */
@media (max-width: 991px) {
    .header-main {
        text-align: center;
    }
    
    .search-box {
        margin: 15px 0;
    }
    
    .main-nav .navbar-nav .nav-link {
        padding: 10px 15px;
    }
    
    .featured-news {
        min-height: 300px;
    }
    
    .featured-news h2 {
        font-size: 22px;
    }
    
    .article-header h1 {
        font-size: 28px;
    }
}

@media (max-width: 767px) {
    .top-bar {
        display: none;
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    .news-card .card-title {
        font-size: 16px;
    }
    
    .featured-news {
        min-height: 250px;
    }
    
    .featured-news h2 {
        font-size: 18px;
    }
    
    .headline-slide img {
        height: 300px;
    }
    
    .headline-slide h2 {
        font-size: 24px;
    }
    
    .article-header h1 {
        font-size: 24px;
    }
    
    .article-content {
        font-size: 16px;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .sidebar {
        position: relative;
        top: 0;
        margin-top: 30px;
    }
}

/* Print Styles */
@media print {
    .top-bar, .header, .main-nav, .breaking-news, .sidebar, .footer,
    .share-buttons, .comment-form, .related-news, .back-to-top {
        display: none !important;
    }
    
    .article-content {
        font-size: 12pt;
    }
}

/* Dark Mode (Optional) */
@media (prefers-color-scheme: dark) {
    :root.auto-dark {
        --body-bg: #121212;
        --card-bg: #1e1e1e;
        --text-color: #e0e0e0;
        --text-muted: #9e9e9e;
        --border-color: #333;
    }
}
