/* ===================================
   MERDEKA NEWS - Main Stylesheet
   Modern News Portal Design
   =================================== */

/* CSS Variables */
:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --secondary: #ec4899;
    --accent: #f97316;
    --danger: #dc2626;
    --success: #059669;
    --warning: #d97706;
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --radius: 8px;
    --radius-lg: 12px;
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    --container-width: 1200px;
    --header-height: 70px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   HEADER
   =================================== */

/* Top Bar (Purple Banner) */
.top-bar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-display {
    opacity: 0.9;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Main Header */
.main-header {
    background: var(--bg-primary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Logo */
.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--secondary);
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 0;
}

.main-nav a {
    display: block;
    padding: 0 16px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    height: var(--header-height);
    line-height: var(--header-height);
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--primary);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.main-nav a:hover::after {
    transform: scaleX(1);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 40px 8px 16px;
    border: 2px solid var(--border);
    border-radius: 25px;
    width: 200px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    width: 250px;
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-badge {
    background: var(--danger);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ===================================
   MAIN CONTENT
   =================================== */

.main-content {
    padding: 30px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* ===================================
   FEATURED ARTICLE
   =================================== */

.featured-article {
    margin-bottom: 40px;
}

.featured-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-primary);
}

.featured-image {
    position: relative;
    height: 450px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-card:hover .featured-image img {
    transform: scale(1.05);
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    padding: 40px 30px 30px;
    color: white;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.featured-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
}

.featured-excerpt {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 15px;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    opacity: 0.8;
}

.featured-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===================================
   ARTICLE GRID
   =================================== */

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--border);
}

.section-title h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 12px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.see-all {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.see-all:hover {
    gap: 10px;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.article-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.article-card.horizontal {
    flex-direction: row;
}

.article-card.horizontal .article-image {
    width: 140px;
    height: 100px;
    flex-shrink: 0;
}

.article-card.horizontal .article-content {
    padding: 15px;
}

.article-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

.article-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-category {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.article-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card:hover .article-title {
    color: var(--primary);
}

.article-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: var(--text-light);
    margin-top: auto;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===================================
   SIDEBAR
   =================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* Popular Topics */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.topic-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.topic-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.topic-info {
    flex: 1;
}

.topic-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.topic-count {
    font-size: 12px;
    color: var(--text-light);
}

/* Recommended Posts */
.recommended-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommended-item {
    display: flex;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.recommended-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recommended-image {
    width: 80px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.recommended-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommended-content {
    flex: 1;
}

.recommended-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 5px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommended-item:hover .recommended-title {
    color: var(--primary);
}

.recommended-date {
    font-size: 12px;
    color: var(--text-light);
}

/* ===================================
   FOOTER
   =================================== */

.main-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    margin-top: 60px;
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-about .logo {
    margin-bottom: 15px;
}

.footer-about p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.footer-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===================================
   SINGLE ARTICLE PAGE
   =================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--primary);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.single-article {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.single-header {
    padding: 30px;
}

.single-category {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.single-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.single-meta {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.single-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.single-featured-image {
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.single-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-content {
    padding: 40px;
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-primary);
}

.single-content p {
    margin-bottom: 20px;
}

.single-content h2,
.single-content h3,
.single-content h4 {
    margin: 30px 0 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.single-content h2 { font-size: 28px; }
.single-content h3 { font-size: 24px; }
.single-content h4 { font-size: 20px; }

.single-content img {
    margin: 25px 0;
    border-radius: var(--radius);
}

.single-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 20px 30px;
    margin: 30px 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.single-content ul,
.single-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.single-content li {
    margin-bottom: 10px;
}

.share-buttons {
    display: flex;
    gap: 10px;
    margin: 30px 0;
}

.share-btn {
    padding: 10px 20px;
    border-radius: var(--radius);
    color: white;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }

/* Related Posts */
.related-posts {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-primary);
        box-shadow: var(--shadow-lg);
        padding: 20px;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
    }
    
    .main-nav a {
        height: auto;
        line-height: 1.6;
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .search-box {
        display: none;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-title {
        font-size: 24px;
    }
    
    .single-title {
        font-size: 24px;
    }
    
    .single-content {
        padding: 20px;
        font-size: 16px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .featured-image {
        height: 300px;
    }
    
    .featured-overlay {
        padding: 20px;
    }
    
    .featured-title {
        font-size: 20px;
    }
    
    .section-title h2 {
        font-size: 20px;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.hidden { display: none; }

/* Loading spinner */
.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}