/* ========================================
   PORTFOLIO - MOHAMMED AMINE KHEZOUR
   UI/UX Designer
   ======================================== */

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0faae7;
    --accent-light: #ff6b6b;
    --text: #f1f1f1;
    --text-muted: #a0a0a0;
    --bg: #0f0f1a;
    --card-bg: rgba(255,255,255,0.03);
    --card-border: rgba(255,255,255,0.08);
    --gradient-1: #166fe4;
    --gradient-2: #533483;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

/* ========================================
   NAVIGATION
   ======================================== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--gradient-2) 0%, transparent 70%);
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

.hero-bg-2 {
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    opacity: 0.2;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgb(77, 74, 74);
    border: 1px solid rgba(11, 99, 230, 0.3);
    border-radius: 50px;
    color: rgb(255, 255, 255);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 4rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.6s both;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--card-border);
}
.btn-primary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}


.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--card-border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   SECTIONS GENERAL
   ======================================== */
section {
    padding: 6rem 5%;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.section-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    margin: 1.5rem auto 0;
    border-radius: 2px;
}

/* ========================================
   ABOUT SECTION
   ======================================== */
.about {
    background: linear-gradient(180deg, var(--bg) 0%, rgba(22, 33, 62, 0.3) 50%, var(--bg) 100%);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-family: 'Playfair Display', serif;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #166fe4;
    display: block;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.about-visual {
    position: relative;
}

.about-visual::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 20px;
    opacity: 0.3;
}

.about-img {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    position: relative;
    overflow: hidden;
}

.about-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(233,69,96,0.1)" stroke-width="0.5"/></svg>');
    background-size: 20px 20px;
}

/* ========================================
   SKILLS SECTION
   ======================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.skill-card:hover::before {
    transform: scaleX(1);
}

.skill-card:hover {
    transform: translateY(-10px);
    border-color: rgba(233, 69, 96, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.skill-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.1), rgba(83, 52, 131, 0.1));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    color: #166fe4;
}

.skill-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   PROJECTS SECTION
   ======================================== */
.projects {
    background: linear-gradient(180deg, var(--bg) 0%, rgba(22, 33, 62, 0.2) 50%, var(--bg) 100%);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.7rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(233, 69, 96, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.project-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay span {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-content {
    padding: 1.8rem;
}

.project-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.project-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.project-tools {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-tag {
    padding: 0.3rem 0.7rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   PROJECT DETAIL MODAL
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem;
}

.modal-overlay.active {
    display: block;
}

.modal-container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--primary);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.modal-close-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 1.3rem;
    transition: all 0.3s ease;
    z-index: 2001;
    backdrop-filter: blur(10px);
}

.modal-close-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: rotate(90deg);
}

.modal-header {
    padding: 3rem 3rem 2rem;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-bottom: 1px solid var(--card-border);
}

.modal-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.modal-title-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.modal-title-section .project-tag {
    margin-bottom: 0;
}

.modal-tools {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-tool-tag {
    padding: 0.4rem 1rem;
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

.modal-body {
    padding: 2.5rem 3rem;
}

.modal-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.info-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.8rem;
}

.info-box h4 {
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box p, .info-box ul {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.info-box ul {
    list-style: none;
}

.info-box ul li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.info-box ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* ========================================
   IMAGE GALLERY - FIXED!
   ======================================== */
.gallery-section {
    margin-top: 2rem;
}

.gallery-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.gallery-section h3 i {
    color: var(--accent);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* REAL IMAGE STYLING */
.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* PLACEHOLDER STYLING */
.gallery-item-placeholder {
    width: 100%;
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: var(--text-muted);
    gap: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.gallery-item-placeholder i {
    font-size: 2.5rem;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.gallery-item-placeholder span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.gallery-item-placeholder small {
    font-size: 0.75rem;
    opacity: 0.6;
    word-break: break-all;
}

.gallery-item-caption {
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    background: var(--card-bg);
}

/* ========================================
   LIGHTBOX
   ======================================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.lightbox-prev { left: 2rem; }
.lightbox-next { right: 2rem; }

/* ========================================
   CONTACT SECTION
   ======================================== */
.contact {
    text-align: center;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 3rem auto 0;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.1), rgba(83, 52, 131, 0.1));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
    color: var(--accent);
}

.contact-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    text-align: center;
    padding: 3rem 5%;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer span {
    color: var(--accent);
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--card-border);
    }

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

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .modal-info-grid {
        grid-template-columns: 1fr;
    }

    .modal-header {
        padding: 2rem 1.5rem 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .modal-overlay {
        padding: 0.5rem;
    }

    .lightbox-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
