* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0a0c0f;
    color: #e0e0e0;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
}

/* خلفية متحركة */
#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.25;
    pointer-events: none;
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    background: rgba(10, 12, 15, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(0, 255, 204, 0.2);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
}

.logo .highlight {
    color: #00ffcc;
    text-shadow: 0 0 10px #00ffcc;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #ccc;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    padding: 0.5rem 0;
}

.nav-links a:hover, .nav-links a.active {
    color: #00ffcc;
    border-bottom: 2px solid #00ffcc;
}

.theme-toggle {
    background: #1e2a2f;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #00ffcc;
    transition: 0.3s;
}

.theme-toggle:hover {
    background: #00ffcc;
    color: #000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.section {
    padding: 4rem 0;
    border-bottom: 1px solid rgba(0, 255, 204, 0.1);
}

.section:last-child {
    border-bottom: none;
}

/* ========== HERO SECTION جديد ========== */
.hero-left-right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    min-height: 70vh;
}

.hero-left {
    flex: 1;
    text-align: left;
}

.hero-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #fff;
}

.hero-name .highlight {
    color: #00ffcc;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.hero-badge {
    display: inline-block;
    background: rgba(0, 255, 204, 0.2);
    padding: 0.3rem 1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    color: #00ffcc;
    margin-bottom: 1rem;
}

.hero-description-left {
    font-size: 1.2rem;
    max-width: 500px;
    margin-bottom: 1.5rem;
    color: #ccc;
}

/* الصورة المربعة المتحركة */
.animated-square {
    width: 300px;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid #00ffcc;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
    transition: all 0.4s ease;
    animation: float 3s ease-in-out infinite;
}

.animated-square:hover {
    transform: scale(1.02);
    border-color: #00ffcc;
    box-shadow: 0 0 40px rgba(0, 255, 204, 0.6);
    border-radius: 50px;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

#profileImg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 1.8rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    border: none;
}

.btn-primary {
    background: #00ffcc;
    color: #0a0c0f;
    border: 2px solid #00ffcc;
}

.btn-primary:hover {
    background: transparent;
    color: #00ffcc;
    box-shadow: 0 0 15px #00ffcc;
}

.btn-secondary {
    border: 2px solid #00ffcc;
    color: #00ffcc;
    background: transparent;
}

.btn-secondary:hover {
    background: #00ffcc;
    color: #0a0c0f;
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 3rem 0;
}

.stat-card {
    background: rgba(20, 30, 40, 0.6);
    backdrop-filter: blur(5px);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
    min-width: 150px;
    border: 1px solid rgba(0, 255, 204, 0.3);
}

.stat-card i {
    font-size: 2rem;
    color: #00ffcc;
    margin-bottom: 0.5rem;
}

.stat-card h3 {
    font-size: 1.8rem;
    color: #fff;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2.5rem;
    border-left: none;
    padding-left: 0;
}

.page-header p {
    color: #aaa;
}

h2, h3 {
    margin: 1.5rem 0 1rem;
    color: #fff;
}

h2 i, h3 i {
    color: #00ffcc;
    margin-right: 10px;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.about-card {
    background: rgba(20, 30, 40, 0.6);
    backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(0, 255, 204, 0.2);
}

.about-card i {
    font-size: 2.5rem;
    color: #00ffcc;
    margin-bottom: 1rem;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.skill-card {
    background: rgba(20, 30, 40, 0.6);
    backdrop-filter: blur(5px);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(0, 255, 204, 0.3);
    transition: 0.3s;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: #00ffcc;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.3);
}

/* Training Card */
.training-card {
    background: rgba(0, 20, 30, 0.7);
    padding: 1.5rem;
    border-radius: 20px;
    border-left: 5px solid #00ffcc;
    margin: 1.5rem 0;
}

.date {
    color: #00ffcc;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Projects Page */
.projects-showcase {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-card-full {
    background: rgba(10, 20, 25, 0.8);
    backdrop-filter: blur(5px);
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    border: 1px solid rgba(0, 255, 204, 0.2);
    transition: 0.3s;
}

.project-card-full:hover {
    border-color: #00ffcc;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
}

.project-icon-large {
    font-size: 4rem;
    color: #00ffcc;
}

.project-details {
    flex: 1;
}

.project-details h3 {
    font-size: 1.8rem;
    margin-top: 0;
}

.project-list ul {
    margin: 0.8rem 0 0.8rem 1.5rem;
}

.tools-used {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.tools-used span {
    background: rgba(0, 255, 204, 0.15);
    padding: 0.3rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
}

/* Contact Page */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.contact-info-card {
    background: rgba(20, 30, 40, 0.6);
    backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 24px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: #00ffcc;
    width: 40px;
}

.contact-item a {
    color: #ccc;
    text-decoration: none;
}

.contact-item a:hover {
    color: #00ffcc;
}

.contact-form-card {
    background: rgba(20, 30, 40, 0.6);
    backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 24px;
}

form input, form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
}

form input:focus, form textarea:focus {
    outline: none;
    border-color: #00ffcc;
}

form button {
    width: 100%;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Light Mode */
body.light-mode {
    background: #f0f4f8;
    color: #111;
}

body.light-mode nav {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: #00ffcc;
}

body.light-mode .logo {
    color: #111;
}

body.light-mode .hero-name {
    color: #111;
}

body.light-mode .hero-description-left {
    color: #333;
}

body.light-mode .skill-card,
body.light-mode .about-card,
body.light-mode .project-card-full,
body.light-mode .training-card,
body.light-mode .contact-info-card,
body.light-mode .contact-form-card,
body.light-mode .stat-card {
    background: rgba(255, 255, 255, 0.8);
    color: #111;
}

body.light-mode h2, 
body.light-mode h3,
body.light-mode .stat-card h3 {
    color: #111;
}

body.light-mode .btn-secondary {
    color: #111;
    border-color: #111;
}

body.light-mode .btn-secondary:hover {
    background: #111;
    color: #fff;
}

body.light-mode .contact-item a {
    color: #111;
}

body.light-mode .contact-item a:hover {
    color: #00ffcc;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
    }
    .nav-links {
        gap: 1rem;
    }
    .hero-left-right {
        flex-direction: column-reverse;
        text-align: center;
    }
    .hero-left {
        text-align: center;
    }
    .hero-right {
        justify-content: center;
    }
    .hero-description-left {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-buttons {
        justify-content: center;
    }
    .hero-name {
        font-size: 2.5rem;
    }
    .animated-square {
        width: 220px;
        height: 220px;
    }
    .container {
        padding: 1rem;
    }
    .project-card-full {
        flex-direction: column;
        text-align: center;
    }
    .project-list ul {
        text-align: left;
    }
    .section {
        padding: 2rem 0;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}