/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&family=Cairo:wght@400;600;700&display=swap');

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: #0a0a1a;
    color: white;
    line-height: 1.6;
    font-weight: 400;
}

/* Three.js Galaxy Background Canvas */
#bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

/* Arabic font support */
html[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

/* Header and Navigation */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

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

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 50px;
    width: 50px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: filter 0.3s ease;
}

.logo:hover .logo-img {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.7;
}

.lang-toggle {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 2rem;
}

.container {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 600px;
    width: 100%;
}

.hint-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    transform: rotate(-3deg);
    transition: all 0.3s ease;
    cursor: pointer;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.hint-badge:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    transform: rotate(-3deg) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.badge-emoji {
    font-size: 1.3rem;
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

.badge-text {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.9;
}

.badge-text a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.badge-text a:hover {
    opacity: 0.7;
}

/* Typography */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin: 0 0 1rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.4rem);
    margin: 1rem 0 2rem 0;
    opacity: 0.9;
    font-weight: 500;
}

.description {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    margin: 1rem 0;
    opacity: 0.8;
    line-height: 1.8;
    font-weight: 400;
}

/* Buttons */
.cta-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-block;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.9);
        flex-direction: column;
        padding: 1rem 0;
        gap: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav {
        padding: 0 1rem;
    }

    .hero {
        padding: 1rem;
    }

    .container {
        padding: 2rem;
        margin: 1rem;
    }

    .hint-badge {
        margin: 1rem 0;
        padding: 0.8rem 1.2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
    }
}

/* Quote Section */
.quote-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.developer-quote {
    font-style: italic;
    font-size: 1.1rem;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    opacity: 0.9;
}

.developer-quote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: normal;
    text-align: right;
}

/* Social Links */
.social-links {
    margin-top: 2rem;
}

.social-links h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 400;
    opacity: 0.9;
}

.links-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
    min-width: 120px;
    justify-content: center;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.social-link .icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Platform-specific hover colors */
.social-link.github:hover {
    background: rgba(51, 51, 51, 0.3);
    border-color: #333;
}

.social-link.linkedin:hover {
    background: rgba(0, 119, 181, 0.3);
    border-color: #0077b5;
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        border-radius: 15px;
    }

    .nav {
        padding: 0 0.5rem;
    }

    .links-container {
        flex-direction: column;
        align-items: center;
    }

    .social-link {
        width: 100%;
        max-width: 200px;
    }

    .quote-section {
        padding: 1rem;
    }

    .developer-quote {
        font-size: 1rem;
    }
}

/* Services Section */
.services-section {
    padding: 6rem 2rem;
    background: rgba(255, 255, 255, 0.08);
}

.services-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 3rem;
    align-items: start;
}

.services-content h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.services-content .section-subtitle {
    margin-bottom: 2.5rem;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.service-item {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.service-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateX(5px);
}

.service-item .service-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.service-item h3 {
    margin: 0 0 1rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.3;
}

.service-item p {
    margin: 0;
    opacity: 0.85;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Services Sidebar CTAs */
.services-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 120px;
}

.cta-card {
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
}

.cta-card h3 {
    margin: 0 0 0.8rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.cta-card p {
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
    line-height: 1.6;
    font-size: 0.9rem;
}

.primary-cta {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    border: 2px solid rgba(102, 126, 234, 0.6);
}

.primary-cta:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.5) 100%);
    border-color: rgba(102, 126, 234, 0.8);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
}

.secondary-cta {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.secondary-cta:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-5px);
}

.btn-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid transparent;
    color: white;
    font-weight: 600;
    padding: 1rem 1.8rem;
    border-radius: 30px;
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.btn-secondary-cta {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
    padding: 1rem 1.8rem;
    border-radius: 30px;
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.btn-secondary-cta:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

/* Articles Section */
.articles-section {
    padding: 6rem 2rem;
    background: rgba(255, 255, 255, 0.05);
}

.articles-container {
    max-width: 1000px;
    text-align: left;
    background: transparent;
    padding: 0 3rem;
    margin: 0 auto;
}

.articles-section h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.articles-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 600;
}

.section-subtitle {
    text-align: center;
    opacity: 0.8;
    margin-bottom: 3rem;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    display: block;
}

.articles-header {
    text-align: center;
    margin-bottom: 3rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.article-card {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.article-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.article-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
}

.article-card p {
    margin: 0 0 1.5rem 0;
    opacity: 0.85;
    flex-grow: 1;
    line-height: 1.6;
    font-size: 0.95rem;
}

.article-card-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 1rem;
}

.article-card-date {
    display: flex;
    align-items: center;
}

.article-card-read-time {
    display: flex;
    align-items: center;
}

.article-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 500;
}

.articles-footer {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Article Content */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.article-header {
    margin-bottom: 3rem;
    text-align: center;
}

.article-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.article-date,
.article-read-time {
    font-size: 0.95rem;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.article-content {
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

.article-content h2 {
    font-size: 1.6rem;
    margin: 2rem 0 1rem 0;
    font-weight: 600;
}

.article-content h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.8rem 0;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.8rem;
    opacity: 0.95;
}

.article-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.article-content strong {
    font-weight: 600;
    opacity: 1;
}

.article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.article-navigation {
    margin-bottom: 2rem;
}

.article-tags-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    opacity: 0.8;
}

/* Responsive Services */
@media (max-width: 1024px) {
    .services-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .services-sidebar {
        position: static;
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .services-section {
        padding: 3rem 1rem;
    }

    .services-wrapper {
        gap: 2rem;
    }

    .service-item {
        padding: 1.5rem;
    }

    .service-item h3 {
        font-size: 1.2rem;
    }

    .services-sidebar {
        flex-direction: row;
        gap: 1rem;
    }

    .cta-card {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .services-section {
        padding: 2rem 1rem;
    }

    .services-wrapper {
        gap: 1.5rem;
    }

    .service-item {
        padding: 1rem;
    }

    .service-item .service-icon {
        font-size: 2rem;
    }

    .service-item h3 {
        font-size: 1.1rem;
    }

    .service-item p {
        font-size: 0.9rem;
    }

    .services-sidebar {
        flex-direction: column;
        gap: 1.5rem;
    }

    .cta-card {
        padding: 1.5rem;
    }

    .cta-card h3 {
        font-size: 1.1rem;
    }

    .cta-card p {
        font-size: 0.85rem;
    }
}

/* Responsive Articles */
@media (max-width: 768px) {
    .articles-section {
        padding: 2rem 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .article-container {
        padding: 2rem 1rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    .articles-section {
        padding: 1.5rem 1rem;
    }

    .articles-header h1 {
        font-size: 1.8rem;
    }

    .article-header h1 {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
    }

    .article-card {
        padding: 1.5rem;
    }

    .article-card h3 {
        font-size: 1.2rem;
    }
}

/* RTL Support for Arabic */
html[dir="rtl"] .hint-badge {
    margin-left: auto;
    margin-right: auto;
}

html[dir="rtl"] .developer-quote cite {
    text-align: left;
}

html[dir="rtl"] .quote-section {
    border-left: none;
    border-right: 4px solid rgba(255, 255, 255, 0.3);
}

html[dir="rtl"] .article-content ul,
html[dir="rtl"] .article-content ol {
    padding-left: 0;
    padding-right: 1.5rem;
}

html[dir="rtl"] .links-container {
    flex-direction: row-reverse;
}

html[dir="rtl"] .services-wrapper {
    grid-template-columns: 380px 1fr;
}

html[dir="rtl"] .services-sidebar {
    grid-column: auto;
}

html[dir="rtl"] .article-card-meta {
    flex-direction: row-reverse;
}

html[dir="rtl"] .article-tags-footer {
    flex-direction: row-reverse;
}