:root {
    --primary: #6300ff;
    --primary-dark: #4a00cc;
    --primary-light: #7d1aff;
    --primary-lighter: #9d3aff;
    
    --gradient-1: linear-gradient(135deg, #4a00cc 0%, #6300ff 50%, #7d1aff 100%);
    --gradient-2: linear-gradient(180deg, #6300ff 0%, #7d1aff 50%, #9d3aff 100%);
    --gradient-radial: radial-gradient(circle at center, #9d3aff 0%, #6300ff 50%, #4a00cc 100%);
    
    --bg-light: #ffffff;
    --bg-light-secondary: #f5f5f5;
    --bg-dark: #000000;
    --bg-dark-secondary: #0a0a0a;
    
    --text-light: #000000;
    --text-light-secondary: #333333;
    --text-dark: #ffffff;
    --text-dark-secondary: #999999;
    
    --card-bg-light: #ffffff;
    --card-bg-dark: #111111;
    --card-border-light: rgba(99, 0, 255, 0.25);
    --card-border-dark: rgba(99, 0, 255, 0.3);
    
    /* Sharp shadows for light mode */
    --shadow-sm: 0 2px 4px rgba(99, 0, 255, 0.15);
    --shadow-md: 0 4px 8px rgba(99, 0, 255, 0.2);
    --shadow-lg: 0 8px 16px rgba(99, 0, 255, 0.25);
    --shadow-xl: 0 12px 24px rgba(99, 0, 255, 0.3);
    --shadow-glow: 0 0 30px rgba(99, 0, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Readex Pro', 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Light mode specific enhancements */
body:not(.dark-mode) {
    --card-border: var(--card-border-light);
    --shadow-sm: 0 2px 6px rgba(99, 0, 255, 0.25);
    --shadow-md: 0 4px 12px rgba(99, 0, 255, 0.3);
    --shadow-lg: 0 8px 20px rgba(99, 0, 255, 0.35);
    --text-light-secondary: #2a2a2a;
}

body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-light);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

body.dark-mode .loading-screen {
    background: var(--bg-dark);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-logo {
    width: 150px;
    height: auto;
    animation: logoLoading 2s ease-in-out infinite;
    filter: drop-shadow(0 8px 40px rgba(99, 0, 255, 0.6)) drop-shadow(0 4px 20px rgba(99, 0, 255, 0.4));
}

@keyframes logoLoading {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

h1, h2, h3, h4, h5, h6,
.hero-title,
.filter-title,
.project-title {
    font-family: 'Readex Pro', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #FFFFFF;
}

/* Navigation - Modern 2025 Style */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 2px solid rgba(99, 0, 255, 0.2);
    padding: 1rem 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 0, 255, 0.15);
}

body.dark-mode .navbar {
    background: rgba(0, 0, 0, 0.7);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    height: 65px;
    display: flex;
    align-items: center;
}

.logo {
    height: 100%;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

body.dark-mode .control-btn {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
}

.control-btn:hover {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-icon {
    font-size: 1.1rem;
}

/* Hero Section */
.hero {
    margin-top: 70px;
    padding: 8rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--gradient-1);
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 25s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #9d3aff 0%, transparent 70%);
    top: -200px;
    left: -200px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #7d1aff 0%, transparent 70%);
    bottom: -300px;
    right: -300px;
    animation-delay: 5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #bd5aff 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, -50px) scale(1.1);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.title-gradient {
    color: #ffffff !important;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

body:not(.dark-mode) .title-gradient {
    color: #ffffff !important;
}

@keyframes shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-weight: 400;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Filter Section */
.filter-section {
    padding: 3rem 0;
    background: var(--bg-light-secondary);
    position: relative;
    z-index: 100;
    border-bottom: 2px solid rgba(99, 0, 255, 0.15);
}

body:not(.dark-mode) .filter-section {
    box-shadow: 0 2px 12px rgba(99, 0, 255, 0.15);
    background: #f8f8f8;
}

body.dark-mode .filter-section {
    background: var(--bg-dark-secondary);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.filter-header {
    margin-bottom: 2rem;
}

.filter-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.filter-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    color: var(--text-light);
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .filter-title {
    color: var(--text-dark);
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.filter-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: var(--gradient-1);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(99, 0, 255, 0.3);
}

body:not(.dark-mode) .filter-count {
    box-shadow: 0 4px 16px rgba(99, 0, 255, 0.4);
}

.count-number {
    font-size: 1.25rem;
    font-weight: 700;
}

.filter-buttons-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.filter-buttons-wrapper::-webkit-scrollbar {
    height: 4px;
}

.filter-buttons-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.filter-buttons-wrapper::-webkit-scrollbar-thumb {
    background: var(--gradient-1);
    border-radius: 2px;
}

.filter-buttons {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 0.75rem;
    justify-content: flex-start;
    min-width: max-content;
    visibility: visible !important;
    opacity: 1 !important;
}

.filter-btn {
    position: relative;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--card-border-light);
    background: var(--card-bg-light);
    color: var(--text-light);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: 'Readex Pro', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 2px 4px rgba(99, 0, 255, 0.1);
}

body.dark-mode .filter-btn {
    background: var(--card-bg-dark);
    color: var(--text-dark);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(99, 0, 255, 0.25);
}

body:not(.dark-mode) .filter-btn:hover {
    box-shadow: 0 4px 8px rgba(99, 0, 255, 0.3);
}

.filter-btn.active {
    background: var(--gradient-1);
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(99, 0, 255, 0.4), 0 0 20px rgba(99, 0, 255, 0.3);
    font-weight: 700;
    transform: translateY(-2px);
}

body:not(.dark-mode) .filter-btn.active {
    box-shadow: none;
}

.filter-btn.active:hover {
    transform: translateY(-3px);
}

body:not(.dark-mode) .filter-btn.active:hover {
    box-shadow: none;
}

body.dark-mode .filter-btn.active:hover {
    box-shadow: 0 8px 20px rgba(99, 0, 255, 0.5), 0 0 40px rgba(99, 0, 255, 0.5);
}

.btn-text {
    position: relative;
    z-index: 1;
}

/* Projects Section */
.projects-section {
    padding: 4rem 0;
    min-height: 60vh;
    background: var(--bg-light);
}

body.dark-mode .projects-section {
    background: var(--bg-dark);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* Project Card - Modern 2025 Style */
.project-card {
    background: var(--card-bg-light);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(99, 0, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid var(--card-border-light);
    position: relative;
    opacity: 1;
    transform: translateY(0);
}

body:not(.dark-mode) .project-card {
    box-shadow: 0 4px 12px rgba(99, 0, 255, 0.2);
}

body.dark-mode .project-card {
    background: var(--card-bg-dark);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
}

body:not(.dark-mode) .project-card:hover {
    box-shadow: 0 12px 24px rgba(99, 0, 255, 0.35), 0 0 40px rgba(99, 0, 255, 0.3);
}

body.dark-mode .project-card:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.project-card.hidden {
    display: none;
}

.project-image-container {
    width: 100%;
    height: 240px;
    background: var(--gradient-1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-image {
    transform: scale(1.1);
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    color: white;
    font-size: 4rem;
    font-weight: 700;
}

.project-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 0.4rem 0.9rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Readex Pro', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    border: 1px solid rgba(99, 0, 255, 0.2);
}

body.dark-mode .project-type-badge {
    background: rgba(17, 17, 17, 0.95);
    color: var(--primary-lighter);
    border-color: rgba(99, 0, 255, 0.3);
}

[dir="rtl"] .project-type-badge {
    left: auto;
    right: 12px;
}

.project-info {
    padding: 1.5rem;
}

.project-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.3;
    margin: 0;
    flex: 1;
}

body.dark-mode .project-title {
    color: var(--text-dark);
}

.project-type-label {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    background: var(--gradient-1);
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(99, 0, 255, 0.3);
    font-family: 'Readex Pro', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

body:not(.dark-mode) .project-type-label {
    box-shadow: 0 2px 8px rgba(99, 0, 255, 0.4);
}

.project-category {
    font-size: 0.85rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 0;
}

[dir="rtl"] .project-link::after {
    content: '←';
    font-size: 1.2rem;
}

[dir="ltr"] .project-link::after {
    content: '→';
    font-size: 1.2rem;
}

.project-link:hover {
    gap: 0.75rem;
    color: var(--primary-dark);
}

[dir="rtl"] .project-link:hover {
    transform: translateX(-5px);
}

[dir="ltr"] .project-link:hover {
    transform: translateX(5px);
}

/* Footer */
.footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--bg-light-secondary);
    margin-top: 4rem;
}

body.dark-mode .footer {
    border-top-color: rgba(255, 255, 255, 0.1);
    background: var(--bg-dark-secondary);
}

.footer-text {
    color: var(--text-light-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

body.dark-mode .footer-text {
    color: var(--text-dark-secondary);
}

/* No Projects Message */
.no-projects {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light-secondary);
    background: var(--bg-light-secondary);
    border-radius: 20px;
    border: 1px dashed var(--card-border);
}

body.dark-mode .no-projects {
    color: var(--text-dark-secondary);
    background: var(--bg-dark-secondary);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .nav-container,
    .container {
        padding: 0 1.5rem;
    }

    .logo-container {
        height: 50px;
    }

    .hero {
        padding: 5rem 1.5rem;
        margin-top: 60px;
        min-height: 40vh;
    }

    .filter-section {
        top: 60px;
        padding: 2.5rem 0;
    }

    .filter-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-image-container {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .nav-controls {
        gap: 0.5rem;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .hero {
        padding: 4rem 1rem;
    }
}
