@font-face {
    font-family: myFirstFont;
    src: url('/fonts/me_quran.woff') format('woff'), 
         url('/fonts/me_quran.ttf') format('truetype');
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    top: 0;
    z-index: 100;
    direction: ltr;
}

#title {
    font-family: myFirstFont;
    font-size: 6.8vw;
    color: white;
    text-decoration: none;
    display: block;
    text-align: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -khtml-user-select: none;
    background-color: transparent;
}

@media (min-width: 768px) {
    #title {
        font-size: 3.5rem;
    }
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.back-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateX(5px);
}

.back-button::before {
    content: '→';
    font-size: 1.2rem;
}

.site-title {
    font-family: myFirstFont;
    font-size: 2rem;
    color: white;
    text-decoration: none;
}

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



/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Article Card */
.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.article-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    padding: 20px;
    color: white;
}

.article-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    font-size: 0.85rem;
    opacity: 0.9;
}

.article-body {
    padding: 20px;
    flex-grow: 1;
}

.article-excerpt {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.read-more {
    color: #3498db;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 10px;
}

.read-more::after {
    content: '←';
    font-size: 1.2rem;
}

/* Article Container */
.article-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Article Content */
.article-content {
    padding: 40px;
    font-size: 1.1rem;
    color: #2c3e50;
}

.article-content h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin: 40px 0 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
}

.article-content h2 {
    font-size: 1.6rem;
    color: #34495e;
    margin: 35px 0 15px;
    padding-right: 15px;
    border-right: 4px solid #3498db;
}

.article-content h3 {
    font-size: 1.3rem;
    color: #34495e;
    margin: 25px 0 15px;
}

.article-content p {
    line-height: 1.9;
    margin: 20px 0;
    text-align: justify;
}

.article-content ul,
.article-content ol {
    padding-right: 30px;
    margin: 20px 0;
}

.article-content li {
    margin: 12px 0;
    line-height: 1.8;
}

.article-content blockquote {
    background: #f8f9fa;
    border-right: 4px solid #3498db;
    padding: 20px 30px;
    margin: 30px 0;
    font-style: italic;
    color: #555;
}

.article-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.article-content em {
    color: #7f8c8d;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px;
}

.meta-icon {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

/* Sidebar Actions */
.sidebar-actions {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 50;
}

.action-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #34495e;
}

.action-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.action-button.liked {
    color: #e74c3c;
    background: #fee;
}

/* Related Articles */
.related-articles {
    margin-top: 60px;
}

.section-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.related-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.related-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.related-excerpt {
    color: #7f8c8d;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.3rem;
    color: #7f8c8d;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.error {
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.error-page {
    background: #fee;
    color: #c33;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    margin: 40px auto;
    max-width: 600px;
}

.error-page h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.error-page p {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 1.1rem;
    background: white;
    margin-top: 60px;
    border-top: 1px solid #e0e0e0;
}

/* Timestamp */
.timestamp {
    color: #666;
    font-size: 0.9em;
    margin-top: 20px;
    text-align: left;
    direction: ltr;
    padding: 20px 40px;
    border-top: 1px solid #eee;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar-actions {
        position: static;
        transform: none;
        flex-direction: row;
        justify-content: center;
        padding: 20px 0;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .article-title {
        font-size: 1.1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .article-header {
        padding: 30px 20px;
    }
    
    .article-content {
        padding: 30px 20px;
        font-size: 1rem;
    }
    
    .article-content h1 {
        font-size: 1.6rem;
    }
    
    .article-content h2 {
        font-size: 1.3rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}