* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tahoma', 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #1a1a2e;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

header h1 {
    font-size: 2em;
    font-weight: bold;
}

.btn-scrape {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-scrape:hover {
    background-color: #45a049;
}

.btn-scrape:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Categories Bar */
.categories-bar {
    background: white;
    padding: 15px 0;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.category-btn {
    background-color: #f0f0f0;
    border: 2px solid transparent;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    color: #333;
}

.category-btn:hover {
    background-color: #e0e0e0;
}

.category-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

/* American News Tab - Special Brilliant Design */
.category-btn.category-america {
    background: linear-gradient(135deg, #B22234 0%, #3C3B6E 50%, #B22234 100%);
    color: white;
    border: 2px solid #FFFFFF;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(178, 34, 52, 0.4);
    animation: shine-america 3s infinite;
}

.category-btn.category-america::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: flag-shine 2s infinite;
}

.category-btn.category-america:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(178, 34, 52, 0.6);
}

.category-btn.category-america.active {
    background: linear-gradient(135deg, #B22234 0%, #3C3B6E 50%, #B22234 100%);
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 4px 15px rgba(178, 34, 52, 0.6);
    animation: shine-america-active 2s infinite;
}

@keyframes shine-america {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(178, 34, 52, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(178, 34, 52, 0.8), 0 0 30px rgba(255, 255, 255, 0.3);
    }
}

@keyframes shine-america-active {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 4px 15px rgba(178, 34, 52, 0.6);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 4px 25px rgba(178, 34, 52, 0.8), 0 0 40px rgba(255, 255, 255, 0.5);
    }
}

@keyframes flag-shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* American News Section - Special Container */
.america-news-section {
    position: relative;
    background: linear-gradient(135deg, #B22234 0%, #3C3B6E 100%);
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.america-news-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.1) 2px,
            rgba(255, 255, 255, 0.1) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.1) 2px,
            rgba(255, 255, 255, 0.1) 4px
        );
    opacity: 0.3;
    pointer-events: none;
    animation: flag-pattern 10s linear infinite;
}

.america-news-section::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 70%
    );
    animation: flag-glow 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes flag-pattern {
    0% {
        background-position: 0 0, 0 0;
    }
    100% {
        background-position: 20px 20px, 20px 20px;
    }
}

@keyframes flag-glow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.america-news-section .news-grid {
    position: relative;
    z-index: 1;
}

.america-news-section .news-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.america-news-section .news-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 8px 30px rgba(178, 34, 52, 0.4);
    border-color: #FFD700;
}

.america-news-section .news-category {
    background: linear-gradient(135deg, #B22234 0%, #3C3B6E 100%);
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(178, 34, 52, 0.5);
}

/* News Grid - Yahoo-like layout */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.news-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #e0e0e0;
}

.news-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-source {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: bold;
}

.news-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1a1a2e;
    line-height: 1.4;
    flex-grow: 1;
}

.news-title a {
    color: inherit;
    text-decoration: none;
}

.news-title a:hover {
    color: #667eea;
    text-decoration: underline;
}

.news-excerpt {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
    margin-top: auto;
}

.news-category {
    background-color: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
}

/* Opinion Section */
.opinion-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.opinion-question {
    font-size: 13px;
    margin-bottom: 10px;
    color: #333;
    font-weight: bold;
}

.opinion-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.opinion-btn {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    background-color: white;
}

.opinion-btn.agree {
    color: #4CAF50;
    border-color: #4CAF50;
}

.opinion-btn.agree:hover,
.opinion-btn.agree.active {
    background-color: #4CAF50;
    color: white;
}

.opinion-btn.disagree {
    color: #f44336;
    border-color: #f44336;
}

.opinion-btn.disagree:hover,
.opinion-btn.disagree.active {
    background-color: #f44336;
    color: white;
}

.opinion-stats {
    display: flex;
    justify-content: space-around;
    font-size: 12px;
    color: #666;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.opinion-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-count {
    font-weight: bold;
    color: #333;
}

/* Loading */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

/* Footer */
footer {
    background-color: #1a1a2e;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    min-height: 100px;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

footer p {
    margin: 5px 0;
}

footer .sponsor-text {
    margin-top: 15px !important;
    font-size: 16px !important;
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

footer .sponsor-link {
    color: #ffffff !important;
    text-decoration: none !important;
    transition: all 0.3s !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

footer .sponsor-link:hover {
    opacity: 1 !important;
    text-decoration: underline !important;
    color: #4CAF50 !important;
}

footer .sponsor-name {
    color: #4CAF50 !important;
    font-weight: bold !important;
    font-size: 18px !important;
    display: inline !important;
    visibility: visible !important;
}

/* Responsive */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .categories-bar {
        padding: 10px;
    }
    
    .category-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Ad Containers */
.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.ad-banner-top {
    min-height: 90px;
    margin: 0;
}

#kala-ad-banner-top {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 728px;
}

/* Main Content Wrapper with Sidebar */
.main-content-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.content-area {
    flex: 1;
    min-width: 0; /* Allows flex item to shrink below content size */
}

/* Sidebar Ad */
.ad-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#kala-ad-sidebar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Responsive: Hide sidebar on mobile */
@media (max-width: 1024px) {
    .main-content-wrapper {
        flex-direction: column;
    }
    
    .ad-sidebar {
        width: 100%;
        position: static;
        margin-top: 20px;
    }
    
    #kala-ad-banner-top {
        max-width: 100%;
    }
    
    .ad-banner-top {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .ad-container {
        padding: 10px 0;
    }
    
    .ad-banner-top {
        min-height: 50px;
    }
    
    #kala-ad-banner-top iframe,
    #kala-ad-sidebar iframe {
        max-width: 100%;
        height: auto;
    }
}

/* News Detail Page */
.news-detail {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 900px;
    margin: 20px auto;
}

.news-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.news-detail-title {
    font-size: 2em;
    color: #1a1a2e;
    margin-bottom: 20px;
    line-height: 1.4;
}

.news-detail-image {
    margin: 20px 0;
    text-align: center;
}

.news-detail-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.news-detail-content {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
    margin: 30px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Original Text Section */
.news-english-article-section {
    margin-top: 40px;
    padding: 25px;
    background: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    direction: ltr;
    text-align: left;
}

.english-article-label {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 15px;
    direction: rtl;
    text-align: right;
}

.english-article-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.english-article-title {
    font-size: 20px;
    font-weight: bold;
    color: #212529;
    margin-bottom: 10px;
    line-height: 1.4;
}

.english-article-link {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    margin-top: 10px;
}

.english-article-link:hover {
    text-decoration: underline;
}

.english-article-content {
    color: #495057;
    line-height: 1.8;
    font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.english-article-content p {
    margin-bottom: 12px;
}

.news-original-text-section {
    margin: 40px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 4px solid #667eea;
}

.original-text-label {
    font-weight: bold;
    font-size: 1.1em;
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.news-original-text {
    font-size: 1em;
    line-height: 1.8;
    color: #555;
    white-space: pre-wrap;
    word-wrap: break-word;
    direction: ltr;
    text-align: left;
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.news-original-link {
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
    text-align: center;
}

.news-original-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.news-original-link a:hover {
    text-decoration: underline;
}

.news-detail-actions {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

/* Share Section */
.share-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.share-label {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.share-btn {
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: white;
    font-weight: 500;
}

.share-telegram {
    background-color: #0088cc;
}

.share-telegram:hover {
    background-color: #006ba3;
}

.share-twitter {
    background-color: #1DA1F2;
}

.share-twitter:hover {
    background-color: #0d8bd9;
}

.share-facebook {
    background-color: #1877F2;
}

.share-facebook:hover {
    background-color: #166fe5;
}

.share-whatsapp {
    background-color: #25D366;
}

.share-whatsapp:hover {
    background-color: #1ebe57;
}

.share-copy {
    background-color: #6c757d;
}

.share-copy:hover {
    background-color: #5a6268;
}

/* Responsive for news detail */
@media (max-width: 768px) {
    .news-detail {
        padding: 20px;
        margin: 10px;
    }
    
    .news-detail-title {
        font-size: 1.5em;
    }
    
    .news-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

