/* assets/style.css - Score808 Clean Professional Light Theme (Fixed Sticky Top Stories) */

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f1f5f9;
    color: #334155;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content { 
    flex: 1; 
    padding: 20px 15px; 
    margin: 0 auto; 
    width: 100%; 
}

.homepage-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- TRENDING TICKER --- */
#trends {
    width: 100%;
    height: 46px;
    background: #ffffff;
    display: flex;
    align-items: center;
    border-radius: 10px;
    padding: 0 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    position: relative;
}

#trendicon {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #0284c7;
    border-radius: 6px;
    font-weight: bold;
    font-size: 11px;
    color: #ffffff;
    flex-shrink: 0;
    z-index: 3;
}

.trends-ticker-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    margin-left: 12px;
}

.trends-ticker-track {
    display: inline-block;
    white-space: nowrap;
    animation: smoothMarquee 35s linear infinite;
}

.trends-ticker-track:hover {
    animation-play-state: paused;
}

.trend-item {
    display: inline-block;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-right: 50px;
    transition: color 0.2s ease;
}

.trend-item:hover {
    color: #0284c7;
    text-decoration: underline;
}

@keyframes smoothMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- SMS WIDGET --- */
#sms {
    background: #ffffff;
    color: #0f172a;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

#sms p { margin: 0; font-size: 13px; font-weight: 600; }
#sms span { background-color: #0284c7; color: white; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: bold; }

/* --- NEWSPAPER TOP SECTION (Matches Table + Top Stories side-by-side) --- */
.newspaper-top-section {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    /* ضروري جداً تكون align-items: start باش الـ sticky يخدم ف grid */
    align-items: start; 
}

@media (max-width: 1024px) {
    .newspaper-top-section {
        grid-template-columns: 1fr;
    }
}

.matches-table-section { 
    width: 100% !important; 
    margin: 0 !important; 
    font-family: inherit; 
    background: #ffffff; 
    border: 1px solid #e2e8f0; 
    border-radius: 12px; 
    padding: 18px; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03); 
}

/* TOP STORIES BOX (Fixed Sticky Position accounting for Sticky Header) */
.top-stories-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    
    position: sticky;
    top: 80px; /* المسافة تحت الهيدر الثابت باش ما يتختفاش الصندوق */
    z-index: 10;
}

/* تحسين شكل الـ Scrollbar داخل Top Stories ila kanu 6 dyal lmaqalates kbar */
.top-stories-box::-webkit-scrollbar {
    width: 4px;
}
.top-stories-box::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.top-stories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

.top-stories-header h3 {
    font-size: 16px;
    color: #0f172a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.live-pulse {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 rgba(239, 68, 68, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.stories-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.story-item {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    border-bottom: 1px dashed #f1f5f9;
    padding-bottom: 12px;
}

.story-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.story-thumb {
    width: 85px;
    height: 62px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #e2e8f0;
}

.story-content h4 {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.story-item:hover h4 {
    color: #0284c7;
}

.story-date {
    font-size: 11px;
    color: #94a3b8;
}

/* --- MAIN GRID LAYOUT (Recent Posts + Sidebar) --- */
.homepage-grid-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .homepage-grid-layout {
        grid-template-columns: 1fr;
    }
    .top-stories-box {
        position: static; /* إلغاء الـ Sticky في الموبايل */
        max-height: none;
    }
}

.posts-recent-area {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.section-main-title {
    font-size: 20px;
    color: #0f172a;
    margin-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    font-weight: 700;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card-item {
    display: flex;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.post-card-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.post-card-item a:has(.post-thumb) {
    overflow: hidden;
    border-radius: 8px;
    flex-shrink: 0;
    display: block;
    height: 110px;
}

.post-thumb {
    width: 180px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    background: #cbd5e1;
    display: block;
    transition: transform 0.4s ease;
}

.post-thumb:hover {
    transform: scale(1.05);
}

.post-details { 
    flex: 1; 
    min-width: 0;
}

.post-details h3 a {
    text-decoration: none;
    color: black;
    transition:0.25s;
}
.post-details h3 a:hover{color:#0284c7;}

.post-cat-tag {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
    text-decoration: none;
}

.post-details h2 { 
    font-size: 15px; 
    margin-bottom: 6px; 
}

.post-details h2 a { 
    color: #1e293b; 
    text-decoration: none; 
    transition: 0.2s; 
    word-break: break-word; 
}

.post-details h2 a:hover { 
    color: #0284c7; 
}

.post-excerpt { 
    font-size: 13px; 
    color: #64748b; 
    margin-bottom: 8px; 
    line-height: 1.4; 
    word-break: break-word; 
}

.post-date { 
    font-size: 12px; 
    color: #94a3b8; 
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* SIDEBAR AREA */
.sidebar-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.widget-box h3 {
    font-size: 16px;
    color: #0f172a;
    margin-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    font-weight: 700;
}

.widget-list, .category-tags-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list li, .category-tags-list li {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #f1f5f9;
}

.widget-list li:last-child, .category-tags-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget-list li a, .category-tags-list li a {
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: 0.2s;
    word-break: break-word;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-list li a:hover, .category-tags-list li a:hover {
    color: #0284c7;
}

.comments-widget-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comm-item {
    font-size: 13px;
    color: #475569;
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    word-break: break-word;
}

.comm-item strong { color: #0f172a; }
.comm-item a { color: #0284c7; text-decoration: none; }
.comm-item p { margin-top: 4px; color: #64748b; font-style: italic; }

/* PAGINATION */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.page-btn {
    padding: 7px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: 0.2s ease;
}

.page-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.page-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

@media (max-width: 768px) {
    .post-card-item { flex-direction: column; }
    .post-card-item a:has(.post-thumb) { height: auto; }
    .post-thumb { width: 100%; height: 160px; }
    #sms { display: none !important; }
    #trends { height: 40px; }
    .trend-item { font-size: 12px; }
    .main-content {padding: 3px 0px;!important}
}