* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: #f8f9fa;
    color: #2b2b2b;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    z-index: 1000;
}

.navbar .logo {
    color: #007bff;
    font-size: 1.5rem;
    font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #444;
    margin-left: 20px;
    font-weight: 600;
    transition: color 0.3s ease;
}

[dir="rtl"] .nav-links a {
    margin-left: 0;
    margin-right: 20px;
}

.nav-links a:hover {
    color: #007bff;
}

/* Control Buttons (Language & Theme) */
.theme-btn, .lang-btn {
    background: #f1f3f5;
    border: 1px solid #ced4da;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 15px;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #333;
}

[dir="rtl"] .theme-btn, [dir="rtl"] .lang-btn {
    margin-left: 0;
    margin-right: 15px;
}

.theme-btn:hover, .lang-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
    color: #007bff;
}

/* Dark Mode Harmonization */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background-color: rgba(30, 30, 30, 0.95);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
}

body.dark-mode .navbar .nav-links a {
    color: #bbb;
}

body.dark-mode .theme-btn, 
body.dark-mode .lang-btn {
    border-color: #444;
    color: #e0e0e0;
    background: #2a2a2a;
}

body.dark-mode .content-box,
body.dark-mode .con {
    background: rgba(30, 30, 30, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .content-box h2,
body.dark-mode .contact h3,
body.dark-mode .section-title {
    color: #4dabf7;
}

/* Content Layout */
section {
    padding: 100px 20px 60px;
    max-width: 1050px;
    margin: 0 auto;
}

.content-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 45px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    border: 1px solid #e9ecef;
}

[dir="rtl"] .content-box {
    flex-direction: row-reverse;
}

.text-content {
    flex: 1;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.text-content:hover {
    opacity: 1;
}

.content-box h2 {
    color: #007bff;
    margin-bottom: 20px;
    font-size: 2rem;
}

.content-box p {
    color: #495057;
    margin-bottom: 0;
    text-align: justify;
}

body.dark-mode .content-box p {
    color: #ced4da;
}

/* Tilted Images with Shadows */
.image-wrapper {
    flex: 0 0 220px;
    display: flex;
    justify-content: center;
}

.tilted-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 20px;
    transform: rotate(5deg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 4px solid #007bff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tilted-img:hover {
    transform: rotate(0deg) scale(1.03);
    box-shadow: 0 15px 35px rgba(0, 123, 255, 0.3);
}

/* Home Section (متناسق مع تصميم الصفحة) */
.home {
    height: 100vh;
    background: linear-gradient(135deg, #007bffa4 0%, #0057b3bf 100%);
    color: #d0d0d2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

body.dark-mode .home {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d1b2a 100%);
}

.home h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.home p {
    font-size: 1.25rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.home .name {
    font-weight: bold;
    text-decoration: underline;
}

.home a {
    display: inline-block;
    background: #fff;
    color: #007bff;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, background 0.3s ease;
}

.home a:hover {
    transform: translateY(-3px);
    background: #f8f9fa;
}

/* Contact Section */
.contact h3 {
    text-align: center;
    color: #007bff;
    font-size: 2.2rem;
    margin-bottom: 40px;
}

.con {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
}

.contact-info {
    flex: 1;
    min-width: 280px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.contact-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    background: #eef2f7;
    padding: 10px;
    border-radius: 50%;
}

[dir="rtl"] .contact-icon {
    margin-right: 0;
    margin-left: 15px;
}

body.dark-mode .contact-icon {
    background: #2c2c2c;
}

.contact-item h4 {
    font-size: 0.9rem;
    color: #6c757d;
}

.contact-item a {
    text-decoration: none;
    color: #007bff;
    font-weight: 600;
}

.qr-box {
    flex: 0 0 220px;
    text-align: center;
    background: rgba(248, 249, 250, 0.9);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

body.dark-mode .qr-box {
    background: rgba(36, 36, 36, 0.7);
    border-color: #444;
}

.qr-box img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .content-box {
        flex-direction: column;
        text-align: center;
    }

    [dir="rtl"] .content-box {
        flex-direction: column;
    }

    .con {
        flex-direction: column;
        align-items: center;
    }
}

/* تنسيقات قسم الشهادات */
.certificates {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    color: #007bff;
    font-size: 2.5rem;
    margin-bottom: 50px;
}

.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.cert-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, background 0.3s ease;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cert-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.cert-image-wrapper {
    margin-bottom: 25px;
    perspective: 1000px;
}

.cert-card .tilted-img {
    width: 100%;
    max-width: 250px;
    height: 160px;
    border-radius: 12px;
    transform: rotate(-3deg);
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.15);
    border: 3px solid #007bff;
    transition: all 0.3s ease;
}

.cert-card:hover .tilted-img {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 123, 255, 0.2);
}

.cert-level {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.cert-company {
    font-size: 1.4rem;
    color: #212529;
    margin-bottom: 10px;
}

.cert-desc {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.5;
}

/* تعديلات الوضع المظلم للشهادات */
body.dark-mode .cert-card {
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .cert-company {
    color: #fff;
}

body.dark-mode .cert-desc {
    color: #bbb;
}

body.dark-mode .cert-card:hover {
    background: rgba(40, 40, 40, 0.9);
}