/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    background: #1e1e2f;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.header {
    background: rgba(42, 42, 60, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #5865f2;
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.nav-brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #5865f2;
    text-shadow: 0 0 10px rgba(88, 101, 242, 0.3);
}

.nav-brand a {
    color: inherit;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #b9bbbe;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #5865f2;
    background: rgba(88, 101, 242, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #5865f2;
    border-radius: 1px;
}

/* Hero Section */
.hero {
    margin-top: 80px;
    padding: 4rem 0;
    text-align: center;
    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="%23ffffff" opacity="0.1"><polygon points="0,100 1000,0 1000,100"/></svg>');
    background-size: cover;
    background-position: bottom;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    font-weight: 400;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.main {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: #2a2a3c;
    color: #b9bbbe;
    border: 2px solid transparent;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    border-color: #5865f2;
    background: rgba(88, 101, 242, 0.1);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.2);
}

.filter-btn.active {
    background: #5865f2;
    color: #ffffff;
    border-color: #5865f2;
}

.filter-btn i {
    font-size: 1rem;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.news-card {
    background: #2a2a3c;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: #5865f2;
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.2);
}

.news-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image {
    transform: scale(1.05);
}

.news-card-content {
    padding: 1.5rem;
}

.news-card-category {
    display: inline-block;
    background: rgba(88, 101, 242, 0.1);
    color: #5865f2;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.news-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
    line-height: 1.4;
}

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #b9bbbe;
}

.news-card-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.news-card-publisher {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
}

.news-card-excerpt {
    color: #b9bbbe;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Loading and Error States */
.loading,
.no-results,
.error-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #b9bbbe;
}

.loading i,
.no-results i,
.error-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #5865f2;
}

.loading span,
.no-results span {
    font-size: 1.1rem;
}

/* Article Styles */
.back-button-container {
    margin-top: 80px;
    padding: 1rem 0;
    background: rgba(42, 42, 60, 0.3);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #5865f2;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(88, 101, 242, 0.1);
}

.article-main {
    padding: 2rem 0;
}

.article {
    background: #2a2a3c;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 3rem;
}

.article-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.article-content {
    padding: 2rem;
}

.article-category {
    display: inline-block;
    background: rgba(88, 101, 242, 0.1);
    color: #5865f2;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.article-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #404040;
    margin-bottom: 2rem;
    color: #b9bbbe;
}

.article-date,
.article-publisher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.article-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e3e5e8;
}

.article-text p {
    margin-bottom: 1.5rem;
}

.article-text h2,
.article-text h3 {
    color: #ffffff;
    margin: 2rem 0 1rem 0;
}

.article-text h2 {
    font-size: 1.5rem;
}

.article-text h3 {
    font-size: 1.3rem;
}

.article-text ul,
.article-text ol {
    margin: 1rem 0;
    padding-right: 2rem;
}

.article-text li {
    margin-bottom: 0.5rem;
}

.article-text blockquote {
    background: rgba(88, 101, 242, 0.1);
    border-right: 4px solid #5865f2;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    font-style: italic;
}

/* Related Articles */
.related-articles {
    margin-top: 3rem;
}

.related-articles h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
    color: #ffffff;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    background: #5865f2;
    color: #ffffff;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}

.btn:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

/* Footer */
.footer {
    background: #1a1a2e;
    border-top: 1px solid #404040;
    margin-top: 3rem;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p {
    color: #b9bbbe;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #b9bbbe;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #5865f2;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #2a2a3c;
    color: #b9bbbe;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #5865f2;
    color: #ffffff;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #404040;
    color: #b9bbbe;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .news-card-content {
        padding: 1rem;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeIn 0.6s ease forwards;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e1e2f;
}

::-webkit-scrollbar-thumb {
    background: #5865f2;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4752c4;
}

/* Selection Styling */
::selection {
    background: rgba(88, 101, 242, 0.3);
    color: #ffffff;
}

/* Focus Styles for Accessibility */
button:focus,
a:focus,
input:focus {
    outline: 2px solid #5865f2;
    outline-offset: 2px;
}