/* ============================================
   MAIN STYLES - Al Jazeera News
   ============================================ */

/* ---------- RESET & BASE ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #cc0000;
    --primary-dark: #990000;
    --secondary: #1a1a2e;
    --bg: #f0f2f5;
    --white: #ffffff;
    --text: #1a1a2e;
    --text-light: #6c757d;
    --border: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.05);
    --radius: 12px;
    --transition: 0.3s;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a { text-decoration: none; color: var(--text); transition: var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; }

/* ---------- HEADER ---------- */
.site-header {
    background: var(--secondary);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.site-logo .logo-text {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
}
.site-logo .logo-text span { color: #fff; }
.site-logo .logo-tagline {
    display: block;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    font-weight: 400;
    letter-spacing: 1px;
}

/* ---------- SEARCH ---------- */
.header-search form {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: 30px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.header-search input {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    width: 250px;
    outline: none;
}
.header-search input::placeholder { color: rgba(255,255,255,0.4); }
.header-search button {
    padding: 10px 18px;
    background: var(--primary);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}
.header-search button:hover { background: var(--primary-dark); }

/* ---------- LANGUAGE TOGGLE ---------- */
.language-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.08);
    padding: 4px 8px;
    border-radius: 20px;
}
.language-toggle .lang-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.language-toggle .lang-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.language-toggle .lang-btn.active {
    color: #fff;
    background: var(--primary);
}
.language-toggle .divider { color: rgba(255,255,255,0.15); }

/* ---------- NAVIGATION ---------- */
.main-nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 75px;
    z-index: 999;
}
.nav-links {
    display: flex;
    gap: 0;
    list-style: none;
}
.nav-links li a {
    display: block;
    padding: 14px 22px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}
.nav-links li a:hover,
.nav-links li a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.nav-links li a.live-nav-link {
    color: #dc2626;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
}

/* ---------- BREAKING TICKER ---------- */
.breaking-ticker {
    background: linear-gradient(135deg, #1a1a2e, #2d2d44);
    border-bottom: 2px solid var(--primary);
    padding: 8px 0;
}
.ticker-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}
.ticker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
    animation: pulse 1.5s infinite;
}
.ticker-content {
    flex: 1;
    overflow: hidden;
    height: 30px;
}
.ticker-list {
    list-style: none;
    animation: ticker-scroll 20s linear infinite;
    display: flex;
    flex-direction: column;
}
.ticker-list li {
    height: 30px;
    display: flex;
    align-items: center;
}
.ticker-list li a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ticker-list li a:hover { color: #fff; }
.live-badge {
    background: #dc2626;
    color: #fff;
    padding: 1px 10px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
    margin-left: 8px;
    animation: pulse 1s infinite;
}

@keyframes ticker-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* ---------- HERO SECTION ---------- */
.hero-section { padding: 30px 0; }
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
.hero-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow);
}
.hero-card .hero-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
}
.hero-card .hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
}
.hero-card .hero-overlay h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.hero-card .hero-overlay h2 a { color: #fff; }
.hero-card .hero-overlay h2 a:hover { color: var(--primary); }
.hero-card .hero-overlay p {
    opacity: 0.8;
    font-size: 0.95rem;
    margin-bottom: 10px;
}
.hero-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.btn-read {
    background: var(--primary);
    color: #fff;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}
.btn-read:hover { background: var(--primary-dark); color: #fff; }

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.small-card {
    height: 50%;
    min-height: 200px;
}
.small-card .hero-image-small {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.small-card .hero-overlay-small {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
}
.small-card .hero-overlay-small h3 {
    font-size: 1rem;
    font-weight: 700;
}
.small-card .hero-overlay-small h3 a { color: #fff; }
.small-card .hero-overlay-small h3 a:hover { color: var(--primary); }
.hero-date {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ---------- SECTION HEADER ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}
.section-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
}

/* ---------- VIDEO SECTION ---------- */
.video-section { padding: 30px 0; }
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}
.video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.live-indicator {
    background: #dc2626;
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse 1.5s infinite;
}

/* ---------- NEWS GRID ---------- */
.news-section { padding: 30px 0; }
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}
.news-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.card-image {
    position: relative;
    overflow: hidden;
}
.card-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}
.news-card:hover .card-image img { transform: scale(1.03); }
.badge-breaking,
.badge-featured {
    position: absolute;
    top: 10px;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-breaking {
    left: 10px;
    background: #dc2626;
    color: #fff;
    animation: pulse 1.5s infinite;
}
.badge-featured {
    right: 10px;
    background: #f59e0b;
    color: #fff;
}
.card-content { padding: 18px; }
.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.75rem;
}
.card-category {
    background: #f0f0f0;
    padding: 2px 12px;
    border-radius: 4px;
    font-weight: 600;
    color: var(--text-light);
}
.card-date { color: var(--text-light); }
.card-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}
.card-content h3 a:hover { color: var(--primary); }
.card-content p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
}
.btn-read-more:hover { gap: 10px; }

/* ---------- CATEGORY FILTER ---------- */
.category-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.filter-btn:hover { background: #f0f0f0; }
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---------- LOAD MORE ---------- */
.btn-load-more {
    padding: 12px 40px;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-load-more:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(204,0,0,0.3);
}

/* ---------- TRENDING SECTION ---------- */
.trending-section { padding: 30px 0; background: #fff; }
.trending-wrapper {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 25px;
}
.trending-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 15px;
}
.trending-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 8px;
    transition: var(--transition);
}
.trending-item:hover { background: #f0f0f0; }
.trending-number {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 30px;
    opacity: 0.5;
}
.trending-content a {
    font-weight: 600;
    font-size: 0.9rem;
}
.trending-views {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
}

/* ---------- CATEGORIES SECTION ---------- */
.categories-section { padding: 30px 0; }
.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.category-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border-radius: 30px;
    border: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}
.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ---------- FOOTER ---------- */
.site-footer {
    background: var(--secondary);
    color: rgba(255,255,255,0.7);
    padding: 40px 0 20px;
    margin-top: 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.footer-col h3 {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--primary);
}
.footer-col h3 span { color: #fff; }
.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 12px;
}
.footer-col p {
    font-size: 0.9rem;
    margin-bottom: 12px;
}
.footer-col ul {
    list-style: none;
}
.footer-col ul li {
    margin-bottom: 6px;
}
.footer-col ul li a {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    transition: var(--transition);
}
.footer-col ul li a:hover { color: #fff; }
.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    color: rgba(255,255,255,0.5);
    transition: var(--transition);
}
.footer-social a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-3px);
}
.subscribe-form {
    display: flex;
    margin-top: 8px;
}
.subscribe-form input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 6px 0 0 6px;
    font-size: 0.9rem;
    outline: none;
}
.subscribe-form button {
    padding: 10px 18px;
    background: var(--primary);
    border: none;
    border-radius: 0 6px 6px 0;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}
.subscribe-form button:hover { background: var(--primary-dark); }
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.3);
}

/* ---------- NEWS DETAIL ---------- */
.news-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    padding: 30px 0;
}
.breadcrumb {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 15px;
}
.breadcrumb a { color: var(--primary); }
.news-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
}
.news-meta {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.news-featured-image {
    margin: 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
}
.news-featured-image img { width: 100%; }
.news-content {
    font-size: 1.05rem;
    line-height: 1.8;
}
.news-content p { margin-bottom: 15px; }
.news-gallery { margin: 30px 0; }
.news-gallery h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-widget {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.sidebar-widget h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}
.related-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.related-item:last-child { border-bottom: none; }
.related-item a {
    font-weight: 600;
    font-size: 0.9rem;
}
.related-date {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
}

/* ---------- CATEGORY PAGE ---------- */
.category-header {
    padding: 30px 0 20px;
}
.category-header h1 {
    font-size: 2rem;
    font-weight: 800;
}
.category-header p { color: var(--text-light); }

/* ---------- SEARCH PAGE ---------- */
.search-header {
    padding: 30px 0 20px;
}
.search-header h1 {
    font-size: 2rem;
    font-weight: 800;
}
.search-header p { color: var(--text-light); }
.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.search-empty i {
    font-size: 3rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 15px;
}

/* ---------- CONTACT PAGE ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 30px 0;
}
.contact-info h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
}
.contact-info p { color: var(--text-light); margin-bottom: 20px; }
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.contact-item i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 50%;
    color: var(--primary);
}
.contact-form form {
    background: #fff;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.contact-form .form-group { margin-bottom: 15px; }
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(204,0,0,0.1);
}
.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}
.form-msg {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}
.form-msg.success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #166534;
}
.form-msg.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #991b1b;
}

/* ---------- PAGINATION ---------- */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 30px;
}
.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--border);
    font-weight: 600;
    transition: var(--transition);
}
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 992px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-side { display: grid; grid-template-columns: 1fr 1fr; }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .trending-list { grid-template-columns: 1fr; }
    .news-detail-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    .header-search { width: 100%; order: 3; }
    .header-search input { width: 100%; }
    .site-logo .logo-text { font-size: 1.4rem; }
    .nav-links { flex-wrap: wrap; }
    .nav-links li a { padding: 10px 15px; font-size: 0.8rem; }
    .news-grid { grid-template-columns: 1fr; }
    .hero-side { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .language-toggle .lang-btn { padding: 4px 10px; font-size: 0.7rem; }
    .hero-card .hero-image { height: 250px; }
    .hero-card .hero-overlay h2 { font-size: 1.2rem; }
    .ticker-label { font-size: 0.7rem; padding: 2px 10px; }
    .ticker-list li a { font-size: 0.8rem; }
    .mobile-menu-toggle { display: block; }
    .main-nav { display: none; }
    .main-nav.open { display: block; }
    .nav-links { flex-direction: column; }
    .nav-links li a { border-bottom: none; border-right: 3px solid transparent; }
    .nav-links li a:hover,
    .nav-links li a.active { border-right-color: var(--primary); border-bottom-color: transparent; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .hero-card .hero-overlay { padding: 15px; }
    .hero-card .hero-overlay h2 { font-size: 1rem; }
    .card-content { padding: 14px; }
    .category-filter { gap: 4px; }
    .filter-btn { padding: 4px 10px; font-size: 0.7rem; }
    .news-title { font-size: 1.4rem; }
    .contact-form form { padding: 20px; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ---------- UTILITY ---------- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }
.no-news {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.no-news i {
    font-size: 3rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 10px;
}