* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-color: #333;
    --bg-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --text-color: #ffffff;
    --bg-color: #0f0f23;
    --card-bg: rgba(15, 15, 35, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    opacity: 0.1;
    z-index: -2;
    animation: gradientShift 15s ease-in-out infinite;
}

.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.shape:nth-child(3) {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(30px) rotate(240deg); }
}

@keyframes gradientShift {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.btn-icon {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    transform: scale(1.1);
    background: var(--primary-color);
    color: white;
}

.page {
    display: none;
    min-height: calc(100vh - 80px);
}

.page.active {
    display: block;
}

.hero {
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-btn {
    font-size: 1.1rem;
    padding: 1rem 2rem;
    animation: fadeInUp 1s ease-out 0.6s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem 0;
}

.feature-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin: 8px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.blog-content {
    padding: 2rem 0;
}

.article {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.article:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
}

.article h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.article-meta {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}



.keyword { color: #569cd6; }
.string { color: #ce9178; }
.comment { color: #6a9955; }
.number { color: #b5cea8; }

.language-selector {
    position: relative;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    min-width: 120px;
    z-index: 1000;
}

.dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px;
    margin: 0.2rem;
}

.dropdown-item:hover {
    background: var(--primary-color);
    color: white;
}

.search-container {
    width: 100%;
    max-width: 400px; /* تحديد أقصى عرض للصندوق */
    margin: 0 auto; /* تمركز الصندوق أفقياً */
    padding: 10px;
    box-sizing: border-box;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl; /* لأن النص عربي */
}

.search-input::placeholder {
    color: #999;
    opacity: 1; /* لتوحيد المظهر */
}

.search-input:focus {
    border-color: #007BFF; /* لون أزرق لما المستخدم يضغط على الصندوق */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.articles {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.article a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.article a:hover {
    color: var(--primary-color);
}

footer {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.articles-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-title {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.article-title a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: var(--primary-color);
}

/* شريط التقدم في الأعلى */
#progressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: #e16cd0;
  width: 0%;
  z-index: 9999;
  transition: width 0.2s ease-out;
}

/* زر العودة للأعلى */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 30px;
  padding: 10px 14px;
  font-size: 20px;
  background-color: #f6f8f600;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: #e890ea85;
}


@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .controls {
        gap: 0.5rem;
    }
}
