/* ===== المتغيرات العامة ===== */
:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a463f5;
    --accent-color: #00cec9;
    --dark-bg: #0a0a0f;
    --card-bg: rgba(30, 30, 46, 0.7);
    --text-primary: #ffffff;
    --text-secondary: #b8b8d0;
    --glass-border: rgba(108, 92, 231, 0.2);
    --gradient-1: linear-gradient(135deg, #6c5ce7, #a463f5);
    --gradient-2: linear-gradient(135deg, #00cec9, #6c5ce7);
    --shadow-1: 0 10px 30px -15px rgba(0, 0, 0, 0.5);
    --shadow-2: 0 20px 40px -20px rgba(108, 92, 231, 0.5);
}

/* ===== الإعدادات الأساسية ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    direction: rtl;
}

/* ===== الخلفية المتحركة ===== */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-sphere {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.15) 0%, transparent 70%);
    animation: float-sphere 20s infinite ease-in-out;
}

.gradient-sphere:nth-child(1) {
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.gradient-sphere:nth-child(2) {
    bottom: -200px;
    right: -200px;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 206, 201, 0.1) 0%, transparent 70%);
    animation-delay: -5s;
}

.gradient-sphere:nth-child(3) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, rgba(164, 99, 245, 0.1) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float-sphere {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(5%, 5%) scale(1.05); }
    50% { transform: translate(-5%, 10%) scale(0.95); }
    75% { transform: translate(-10%, -5%) scale(1.1); }
}

/* ===== مؤشر مخصص ===== */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.2s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.custom-cursor::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ===== شريط التنقل ===== */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    z-index: 1000;
    padding: 0.8rem 1.5rem;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-highlight {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--text-primary);
}

.nav-menu a:hover::before,
.nav-menu a.active::before {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* ===== القسم الرئيسي ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 2rem 2rem;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    margin-bottom: 2rem;
    backdrop-filter: blur(5px);
}

.hero-badge i {
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-family: 'Cairo', sans-serif;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 10px 20px -10px var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -10px var(--primary-color);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.hero-image {
    position: relative;
}

.image-wrapper {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    border: 3px solid var(--primary-color);
    animation: morph 10s infinite;
    box-shadow: 0 20px 40px rgba(108, 92, 231, 0.3);
}

@keyframes morph {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 50% 50% 30% 70% / 50% 50% 50% 50%; }
    50% { border-radius: 70% 30% 50% 50% / 40% 60% 40% 60%; }
    75% { border-radius: 40% 60% 70% 30% / 60% 40% 60% 40%; }
}

.image-decoration {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px dashed var(--primary-color);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 10s infinite reverse;
    opacity: 0.3;
}

.floating-card {
    position: absolute;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-1);
    animation: float 5s infinite ease-in-out;
}

.floating-card i {
    color: var(--primary-color);
}

.card-1 {
    top: 20%;
    right: -20px;
    animation-delay: 0s;
}

.card-2 {
    bottom: 20%;
    left: -20px;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* ===== قسم المهارات ===== */
.skills {
    padding: 6rem 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 2rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-1);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-2);
}

.skill-card:hover::before {
    transform: translateX(0);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ألوان خاصة لكل لغة */
.skill-card.html .skill-icon { color: #e34c26; }
.skill-card.css .skill-icon { color: #264de4; }
.skill-card.bootstrap .skill-icon { color: #563d7c; }
.skill-card.sass .skill-icon { color: #cc6699; }
.skill-card.php .skill-icon { color: #777bb4; }
.skill-card.mysql .skill-icon { color: #00758f; }
.skill-card.java .skill-icon { color: #007396; }
.skill-card.dart .skill-icon { color: #0175c2; }
.skill-card.js .skill-icon { color: #f7df1e; }
.skill-card.react .skill-icon { color: #61dafb; }

.skill-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.skill-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 10px;
    width: 0;
    transition: width 1.5s ease;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tags span {
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid var(--glass-border);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== قسم المشاريع ===== */
.projects {
    padding: 6rem 2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    overflow: hidden;
    transition: all 0.3s;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-2);
}

.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-tech {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-tech span {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: gap 0.3s;
}

.project-link:hover {
    gap: 1rem;
}

/* ===== قسم الاتصال ===== */
.contact {
    padding: 6rem 2rem;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 4rem;
}

.contact-info h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-details {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-item i {
    width: 40px;
    height: 40px;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 45px;
    height: 45px;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--gradient-1);
    transform: translateY(-3px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s;
}

.form-group label {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: all 0.3s;
    pointer-events: none;
}

.form-group textarea ~ label {
    top: 1rem;
    transform: none;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
}

.form-group input:focus ~ label,
.form-group textarea:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
    top: -10px;
    right: 0.5rem;
    font-size: 0.8rem;
    background: var(--dark-bg);
    padding: 0 0.5rem;
    color: var(--primary-color);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ===== تذييل الصفحة ===== */
.footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--glass-border);
}

/* ===== التجاوب مع الشاشات ===== */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-container {
        gap: 2rem;
    }
    
    .image-wrapper {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 80%;
        height: calc(100vh - 80px);
        background: var(--card-bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.3s;
        border-radius: 30px 0 0 30px;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        grid-row: 1;
    }
    
    .floating-card {
        display: none;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
        padding: 2rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .image-wrapper {
        width: 250px;
        height: 250px;
    }
    
    .section-title {
        font-size: 2rem;
    }
}