/*
  PORTFOLIO STYLESHEET
  Author: Mostafa Hassan (Redesigned by AI)
  Version: 2.2 (Final)
*/

:root {
    --bg-color: #0d1117;
    --primary-color: #58a6ff;
    --secondary-color: #161b22;
    --text-color: #c9d1d9;
    --text-muted: #8b949e;
    --border-color: rgba(255, 255, 255, 0.1);
    --font-family: 'Inter', sans-serif;
}

/* --- GLOBAL & RESET --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

.container {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.5rem;
}

h1, h2, h3, h4 {
    color: #fff;
    line-height: 1.2;
}

p {
    color: var(--text-muted);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}


/* --- CUSTOM CURSOR --- */
.cursor-dot, .cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
}
.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
}
.cursor-outline {
    width: 30px;
    height: 30px;
    border: 2px solid var(--primary-color);
    transition: all 0.1s ease-out;
}
.cursor-outline.large {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: rgba(88, 166, 255, 0.2);
}


/* --- DYNAMIC BACKGROUND --- */
.aurora-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(100px) saturate(1.5);
    opacity: 0.3;
}
.aurora-shape {
    position: absolute;
    border-radius: 50%;
}
.aurora-shape.shape1 {
    width: 400px;
    height: 400px;
    background-color: rgba(88, 166, 255, 0.5);
    top: 10%;
    left: 10%;
    animation: aurora-move 15s infinite alternate ease-in-out;
}
.aurora-shape.shape2 {
    width: 350px;
    height: 350px;
    background-color: rgba(220, 38, 127, 0.5);
    bottom: 5%;
    right: 15%;
    animation: aurora-move 20s infinite alternate ease-in-out 3s;
}
.aurora-shape.shape3 {
    width: 300px;
    height: 300px;
    background-color: rgba(110, 231, 183, 0.5);
    top: 50%;
    left: 40%;
    animation: aurora-move 18s infinite alternate ease-in-out 1s;
}

@keyframes aurora-move {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(100px, 50px) rotate(180deg); }
}


/* --- HEADER --- */
.site-header {
    position: fixed;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
}
.main-nav a:hover {
    color: var(--primary-color);
}

.btn-outline {
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}
.btn-outline:hover {
    background-color: rgba(88, 166, 255, 0.1);
}


/* --- GENERAL CARD STYLING & HOVER EFFECT --- */
.card {
    background: rgba(22, 27, 34, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* The "Lift" effect on hover */
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

/* The "Shine" effect on hover */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%; /* Start off-screen */
    width: 60%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: left 0.6s ease-in-out;
}

.card:hover::before {
    left: 150%; /* Sweep across the card */
}


/* --- HERO SECTION --- */
.hero-section {
    padding: 12rem 0;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-description {
    max-width: 650px;
    margin: 0 auto 2.5rem;
    font-size: 1.1rem;
}

.hero-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1.5rem;
}
.hero-socials a:hover {
    color: #fff;
    transform: translateY(-3px);
}

/* --- SITE SECTIONS --- */
.site-section {
    padding: 6rem 0;
}


/* --- BENTO GRID (ABOUT) --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.bento-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.bento-item h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.bento-item h4 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.bento-item p { font-size: 0.95rem; }
.bento-item i { font-size: 1.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.education-details {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.education-details span {
    background: rgba(88, 166, 255, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
}


/* --- EXPERIENCE TIMELINE --- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 1rem;
    bottom: 1rem;
    width: 2px;
    background-color: var(--border-color);
}
.timeline-item {
    position: relative;
    padding-left: 3rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid var(--secondary-color);
}
.timeline-content { padding: 1.5rem; }
.timeline-date {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.timeline-content h3 { font-size: 1.2rem; }
.timeline-company { font-weight: 500; margin-bottom: 1rem; }
.timeline-content ul {
    list-style-position: inside;
}
.timeline-content li { font-size: 0.95rem; color: var(--text-muted); }


/* --- PROJECTS GRID (WORKS) --- */
.project-filter-menu {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-family);
    font-weight: 500;
}

.filter-btn:hover {
    background-color: var(--secondary-color);
    color: #fff;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-color: var(--primary-color);
    font-weight: 700;
}


.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    /* Removed transition from here to avoid conflict with general card styles */
}
.project-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-icon {
    font-size: 4rem;
    color: var(--text-muted);
    opacity: 0.5;
}
.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.project-content h4 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.project-content p { font-size: 0.9rem; margin-bottom: 1rem; flex-grow: 1; }
.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.project-tags span {
    background: rgba(88, 166, 255, 0.1);
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}
.project-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}
.project-links a {
    font-weight: 600;
}
.project-links a i { font-size: 0.8rem; margin-left: 0.3rem; }


/* --- SKILLS GRID --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.skill-category h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.skill-category ul {
    list-style: none;
}
.skill-category li {
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.skill-category li i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

/* --- GALLERY GRID --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    height: 280px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-content-icon {
    font-size: 3rem;
    color: var(--text-muted);
    transition: transform 0.5s ease;
}
.gallery-item:hover .gallery-content-icon {
    transform: scale(1.2);
}
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}
.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}
.gallery-overlay h3 { font-size: 1.1rem; }
.gallery-overlay p { font-size: 0.9rem; color: var(--text-color); }

/* --- FOOTER --- */
.site-footer {
    padding: 4rem 0 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 6rem;
}
.site-footer h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.site-footer p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}
.footer-email {
    display: inline-block;
    background: var(--secondary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-weight: 500;
    margin-bottom: 2rem;
}
.footer-email:hover {
    border-color: var(--primary-color);
}
.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}
.footer-socials a:hover {
    color: #fff;
    transform: translateY(-3px);
}
.copyright {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.copyright .fa-heart {
    color: var(--primary-color);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .main-nav { display: none; } /* Basic mobile nav, can be enhanced with JS */
    .bento-grid { grid-template-columns: 1fr; }
    .bento-item { grid-column: auto !important; grid-row: auto !important; }
    .timeline::before { left: 0.5rem; }
    .timeline-item { padding-left: 2rem; }
    .timeline-item::before { left: 0; }
}

/* Styles for the 4-2 Gallery layout on large screens */
@media (min-width: 1100px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    /* Target the 5th item and make it span 2 columns */
    .gallery-item:nth-child(5) {
        grid-column: span 2;
    }
    /* Target the 6th item and make it span 2 columns */
    .gallery-item:nth-child(6) {
        grid-column: span 2;
    }
}