@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* Variables CSS */
:root {
    --primary: #8442ff;
    --secondary: #ff42c6;
    --dark: #1a1a2e;
    --light: #f1f1f1;
    --text-primary: var(--light);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --bg-primary: var(--dark);
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-hover: var(--primary);
    --text-active: var(--secondary);
    --text-heading: rgba(255, 255, 255, 0.9);
    --text-code: #f8f8f2;
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.3);
    --gradient: linear-gradient(45deg, var(--primary), var(--secondary));
    --gradient-transparent: linear-gradient(45deg, var(--primary), transparent);
    --border-radius-sm: 10px;
    --border-radius-md: 15px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;
    --border-radius-circle: 50%;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --article-max-width: 800px;
    --code-bg: #1a1a2e;
    --inline-code-bg: rgba(132, 66, 255, 0.1);
    --header-bg: rgba(26, 26, 46, 0.8);
    --footer-bg: rgba(20, 20, 35, 0.95);
    --search-modal-bg: rgba(20, 20, 35, 0.95);

    --mobile-padding: 15px;
    --tablet-padding: 20px;
    --desktop-padding: 30px
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255, 255, 255, 0.05);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 16px;
    font-weight: 400;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Theme Switching */
body[data-theme="light"] {
    --text-primary: #1a1a2e;
    --text-secondary: rgba(26, 26, 46, 0.7);
    --bg-primary: #ffffff;
    --bg-secondary: rgba(26, 26, 46, 0.05);
    --border-color: rgba(26, 26, 46, 0.1);
    --glass-bg: rgba(26, 26, 46, 0.05);
    --glass-border: rgba(26, 26, 46, 0.1);
    --code-bg: #f5f5f5;
    --header-bg: rgba(255, 255, 255, 0.8);
    --footer-bg: rgba(245, 245, 245, 0.95);
    --search-modal-bg: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(26, 26, 46, 0.7);
    --text-hover: var(--primary);
    --text-active: var(--secondary);
    --text-heading: rgba(26, 26, 46, 0.9);
    --text-code: #1a1a2e;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

p {
    margin-bottom: 1rem;
    max-width: 65ch;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    position: relative;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient);
}

/* Header Styles */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 900;
    font-size: 1.2rem;
    position: relative;
    z-index: 2;
}

.logo h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.logo span {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-actions button {
    background: transparent;
    border: none;
    color: var(--light);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-actions button:hover {
    background: var(--glass-bg);
}

.menu-toggle {
    display: none;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--light);
    margin: 5px 0;
    border-radius: 3px;
    transition: var(--transition);
}

/* Hero Section */
.hero-section {
    padding: 60px 0 40px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, var(--primary), transparent 60%);
    opacity: 0.1;
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.blog-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.blog-meta > div {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.author {
    display: flex;
    align-items: center;
}

.author img {
    width: 30px;
    height: 30px;
    border-radius: var(--border-radius-circle);
    margin-right: 5px;
    object-fit: cover;
}

.blog-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.blog-excerpt {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Blog Content */
.blog-content {
    padding: 60px 0;
}

.article-image {
    margin-bottom: 40px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.content-wrapper {
    display: grid;
    grid-template-columns: minmax(250px, 300px) 1fr;
    gap: 40px;
    position: relative;
}

/* Table of Contents */
.table-of-contents {
    position: sticky;
    top: 100px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 20px;
    height: fit-content;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.toc-header h3 {
    margin-bottom: 0;
    font-size: 1.2rem;
}

.toc-header button {
    background: transparent;
    border: none;
    color: var(--light);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.toc-header button:hover {
    color: var(--primary);
}

#tocList {
    list-style: none;
    transition: max-height 0.3s ease-out;
    overflow: hidden;
    max-height: 500px; /* قيمة افتراضية كبيرة بما يكفي */
}

#tocList.collapsed {
    max-height: 0;
}

#tocList li {
    margin-bottom: 10px;
}

#tocList a {
    display: block;
    padding: 8px 10px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

#tocList a:hover {
    background: var(--glass-bg);
    transform: translateX(-5px);
}

/* Article Content */
.article-text {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: var(--article-max-width);
    margin: 0 auto;
}

.article-text section {
    margin-bottom: 40px;
}

.article-text h2 {
    font-size: 1.8rem;
    margin-top: 30px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.article-text h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 93.3%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--gradient);
    border-radius: 3px;
}


.article-text h3 {
    font-size: 1.4rem;
    margin-top: 25px;
    margin-bottom: 15px;
    color: var(--text-heading);
}

.article-text ul, 
.article-text ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.article-text li {
    margin-bottom: 10px;
}

.code-block {
    position: relative;
    margin: 2rem 0;
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.code-block pre {
    background: var(--code-bg);
    padding: 1.5rem;
    padding-left: 3rem;
    overflow-x: auto;
    direction: ltr;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.line-number {
    display: inline-block;
    width: 2em;
    color: rgba(255, 255, 255, 0.4);
    text-align: right;
    margin-right: 1em;
    user-select: none;
}

.code-block code {
    color: #f8f8f2;
}

.copy-btn {
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--border-radius-sm);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.copy-btn i {
    font-size: 1rem;
}

.copy-btn.copied {
    background: var(--success);
    color: white;
}

.copy-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 1000;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.tip-box {
    background: linear-gradient(to right, rgba(132, 66, 255, 0.05), rgba(255, 66, 198, 0.05));
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: var(--border-radius-md);
    margin: 30px 0;
}

.tip-box h3 {
    margin-top: 0;
    color: var(--primary);
}

.conclusion {
    background: var(--glass-bg);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin-top: 60px;
    border: 1px solid var(--glass-border);
}

/* Reactions Section */
.reactions-section {
    margin-top: 50px;
    text-align: center;
}

.reactions-section h3 {
    margin-bottom: 20px;
}

.reactions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.reaction {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.reaction:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.reaction i {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.reaction-count {
    font-weight: 700;
}

.reaction-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.reaction[data-reaction="like"]:hover {
    color: #4c75f2;
}

.reaction[data-reaction="funny"]:hover {
    color: #ffd700;
}

.reaction[data-reaction="insightful"]:hover {
    color: #00e676;
}

.reaction[data-reaction="surprised"]:hover {
    color: #ff9e80;
}

.reaction[data-reaction="angry"]:hover {
    color: #ff5252;
}

/* Share Section */
.share-section {
    margin-top: 50px;
    text-align: center;
}

.share-section h3 {
    margin-bottom: 20px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    transition: var(--transition);
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.share-btn.twitter {
    background-color: #1da1f2;
    color: white;
}

.share-btn.instagram {
    background-color: #E4405F;
    color: white;
}

.share-btn.telegram {
    background-color: #4087e4;
    color: white;
}

.share-btn.facebook {
    background-color: #4267B2;
    color: white;
}

.share-btn.linkedin {
    background-color: #0e76a8;
    color: white;
}

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

.share-btn.copy-link {
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--light);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Related Posts */
.related-posts {
    margin-top: 80px;
}

.related-posts h2 {
    margin-bottom: 30px;
}

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

.post-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.post-image {
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 20px;
}

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

.post-excerpt {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.1);
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(45deg, var(--secondary), var(--primary));
    width: 0%;
    transition: width 0.3s ease;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    padding: 80px 0 30px;
    position: relative;
    margin-top: 100px;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.1);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient);
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.footer-logo span {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
}

.footer-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.footer-nav-col h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-nav-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--gradient);
}

.footer-nav-col ul {
    list-style: none;
}

.footer-nav-col ul li {
    margin-bottom: 10px;
}

.footer-nav-col ul li a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-nav-col ul li a:hover {
    color: var(--primary);
    transform: translateX(-5px);
}

.social-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-links li a i {
    width: 20px;
}

.newsletter {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 25px;
    border-radius: var(--border-radius-lg);
}

.newsletter h3 {
    margin-bottom: 15px;
}

.newsletter p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px 15px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--light);
}

.newsletter-form button {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.copyright {
    color: rgba(255, 255, 255, 0.6);
}

.footer-links {
    display: flex;
    gap: 15px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
}

.footer-links a:hover {
    color: var(--primary);
}

.separator {
    color: rgba(255, 255, 255, 0.3);
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--search-modal-bg);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 700px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 30px;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-header h2 {
    margin-bottom: 0;
}

#closeSearch {
    background: transparent;
    border: none;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

#closeSearch:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-form input {
    flex: 1;
    padding: 15px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--light);
    font-size: 1.1rem;
}

.search-form button {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.search-form button:hover {
    transform: translateY(-3px);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: var(--border-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Comments Section */
.comments-section {
    margin-top: 80px;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.comment-form {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin-bottom: 40px;
}

.comment-form textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--light);
    margin-bottom: 20px;
    resize: vertical;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.comment {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 25px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-author img {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-circle);
}

.comment-meta {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
}

.comment-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.comment-actions {
    display: flex;
    gap: 15px;
}

.comment-actions button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: var(--transition);
}

.comment-actions button:hover {
    color: var(--primary);
}

.comment-content {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* Accessibility Improvements */
:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: more) {
    :root {
        --text-muted: rgba(255, 255, 255, 0.8);
    }
    
    body[data-theme="light"] {
        --text-muted: rgba(26, 26, 46, 0.8);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
        padding: 0 var(--tablet-padding);
    }
    
    .blog-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .table-of-contents {
        position: relative;
        top: 0;
        margin-bottom: 30px;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 var(--mobile-padding);
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
        z-index: 98;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .menu-toggle {
        display: block;
        z-index: 99;
    }
    
    .blog-title {
        font-size: 1.8rem;
    }
    
    .blog-meta {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .footer-nav {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .blog-title {
        font-size: 1.5rem;
    }
    
    .article-text h2 {
        font-size: 1.5rem;
    }
    
    .article-text h3 {
        font-size: 1.2rem;
    }
    
    .code-block {
        margin: 1rem -15px;
        border-radius: 0;
    }
    
    .back-to-top {
        right: 15px;
        bottom: 15px;
    }
}

/* تحسين قابلية القراءة على الشاشات الصغيرة */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .article-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    pre code {
        font-size: 0.8rem;
    }
}

/* دعم الشاشات عالية الدقة */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* تحسينات لأجهزة اللمس */
@media (hover: none) {
    .nav-links a:hover::after {
        width: 0;
    }
    
    .post-card:hover {
        transform: none;
    }
    
    .reaction:hover {
        transform: none;
    }
}