/* ===== ROOT VARIABLES ===== */
:root {
    /* Color Palette */
    --primary: #2aa8a8;         /* Sophisticated teal - main brand color */
    --primary-light: #5bc0c0;   /* Lighter teal - for highlights */
    --primary-dark: #1e7d7d;    /* Darker teal - for hover states */
    --secondary: #3a506b;       /* Deep blue-gray - secondary color */
    --accent: #4db6ac;         /* Muted aqua accent - for accents */
    --dark: #0f1a25;           /* Dark blue background - main bg color */
    --light: #e0f2f1;          /* Light teal - for text on dark bg */
    --card-bg: rgba(21, 42, 53, 0.6); /* Semi-transparent card background */
    
    /* Animation */
    --transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0a1929, #0f1a25);
    color: var(--light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== LAYOUT STRUCTURE ===== */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    max-height: 100vh;
}

/* ===== SIDEBAR COMPONENT ===== */
.sidebar {
    background: rgba(12, 30, 40, 0.95);
    border-right: 1px solid rgba(42, 168, 168, 0.1);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px); /* <-- blur happens here */
  -webkit-backdrop-filter: blur(10px); /* Safari support */
}

/* Profile Section */
.profile-section {
    text-align: center;
    padding: 20px 0 10px;
    border-bottom: 1px solid rgba(42, 168, 168, 0.15);
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: 600;
    overflow: hidden;
    background-image: url('Pics/moi.jpg');
    background-size: cover;
    background-position: 100% 0%;
    background-repeat: no-repeat;
}

.name {
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.title {
    color: var(--primary-light);
    font-size: 1.1rem;
}

/* Navigation Items */
.nav-items {
    padding: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    padding: 14px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--light);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(42, 168, 168, 0.15);
}

.nav-item.active {
    background: rgba(42, 168, 168, 0.25);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    font-size: 1.2rem;
    color: var(--primary-light);
    width: 24px;
    text-align: center;
}

.nav-item.active i {
    color: var(--accent);
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid rgba(42, 168, 168, 0.15);
    margin-top: auto; /* Push to bottom of sidebar */
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(42, 168, 168, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

/* ===== MAIN CONTENT AREA ===== */
.content {
    padding: 40px;
    overflow-y: auto;
    position: relative;
}

/* Section Styling - Base */
.section {
    min-height: 100vh;
    display: none;
    padding: 40px 0;
}

.section.active {
    display: block;
    animation: fadeIn 0.6s ease;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    color: white;
    text-align: center;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), transparent);
}

/* ===== HOME SECTION ===== */
.home-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 80vh;
}

.home-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animated Subtitle Component */
.home-subtitle {
    position: relative;
    height: 1.5em; /* Fixed height to prevent layout shift */
    overflow: hidden;
    display: inline-block;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary-light);
}

.home-subtitle span {
    position: absolute;
    left: 0;
    right: 0;
    white-space: nowrap;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Subtitle animation states */
.title-visible {
    opacity: 1;
    transform: translateY(0);
}

.title-hidden {
    opacity: 0;
    transform: translateY(100%);
}

.title-out {
    opacity: 0;
    transform: translateY(-100%);
}

.title-in {
    opacity: 1;
    transform: translateY(0);
}

.home-description {
    font-size: 1.2rem;
    max-width: 700px;
    margin-bottom: 40px;
    line-height: 1.8;
}

.home-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.home-buttons>*{
    flex-grow: 1;
}

/* ===== BUTTON COMPONENT ===== */
.btn {
    background: var(--primary);
    border: none;
    padding: 14px 35px;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(42, 168, 168, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(42, 168, 168, 0.15);
}

/* ===== ABOUT SECTION ===== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: flex-start;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 20px;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.skill-category h3 {
    color: var(--primary-light);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.skill-item {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.skill-item i {
    color: var(--primary);
    margin-right: 10px;
    width: 20px;
}

/* ===== PORTFOLIO SECTION ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.portfolio-item {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(42, 168, 168, 0.15);
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

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

.portfolio-img {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.portfolio-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.portfolio-img i {
    position: relative;
    z-index: 2;
}

.portfolio-img-content {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.portfolio-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: white;
}

.portfolio-description {
    color: var(--primary-light);
    margin-bottom: 20px;
    flex-grow: 1;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.tag {
    background: rgba(42, 168, 168, 0.15);
    color: var(--primary-light);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.portfolio-actions {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

.portfolio-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
    font-size: 0.95rem;
}

.demo-btn {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}

.demo-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(42, 168, 168, 0.3);
}

.github-btn {
    background: transparent;
    color: var(--primary-light);
    border: 2px solid var(--primary);
}

.github-btn:hover {
    background: rgba(42, 168, 168, 0.15);
    transform: translateY(-3px);
}

/* ===== CONTACT SECTION ===== */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 30px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
    text-decoration: none;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    text-decoration: none;
    align-items: center;
    padding: 20px;
    transition: var(--transition);
    position: relative;
    border-radius: 8px;
    background: var(--card-bg);
}

.contact-item:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 12px 25px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(74, 216, 216, 0.4);
    background: linear-gradient(135deg, rgba(21, 42, 53, 0.8), rgba(21, 42, 53, 0.9));
    z-index: 10;
}

.contact-item:hover .contact-icon {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px rgba(74, 216, 216, 0.6);
}

.contact-item:hover .contact-details h3 {
    color: var(--accent);
    text-shadow: 0 0 8px rgba(74, 216, 216, 0.4);
}

.contact-item:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    animation: border-glow 1.5s infinite alternate;
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(42, 168, 168, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
    flex-shrink: 0;
    transition: var(--transition);
}

.contact-details h3 {
    color: white;
    margin-bottom: 5px;
    font-size: 1.2rem;
    transition: var(--transition);
}

.contact-details p {
    color: var(--primary-light);
}

/* Contact Form */
.contact-form {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid rgba(42, 168, 168, 0.15);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-light);
}

.form-control {
    width: 100%;
    padding: 14px;
    background: rgba(15, 45, 55, 0.4);
    border: 1px solid rgba(42, 168, 168, 0.2);
    border-radius: 8px;
    color: var(--light);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 168, 168, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* ===== EDUCATION/EXPERIENCE SECTION ===== */
.education-item,
.internship-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(42, 168, 168, 0.15);
}

.education-item h3,
.internship-item h3 {
    color: white;
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.education-item p,
.internship-item p {
    color: var(--primary-light);
    margin-bottom: 5px;
}

.education-item .date-location,
.internship-item .date-location {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-style: italic;
    font-size: 0.9rem;
}

/* ===== DEMO NOTE COMPONENT ===== */
.demo-note {
    background: rgba(21, 42, 53, 0.8);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 20px;
    margin-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.demo-note h3 {
    color: var(--accent);
    margin-bottom: 10px;
    text-align: center;
}

.demo-note p {
    color: var(--primary-light);
    text-align: center;
    margin-bottom: 15px;
}

.demo-note ul {
    padding-left: 20px;
    margin: 15px 0;
}

.demo-note li {
    margin-bottom: 8px;
    color: var(--primary-light);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 240px 1fr;
    }

    .content {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        transition: transform 0.4s ease;
        z-index: 1000;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        transform: translateX(280px);
    }

    /* Mobile Menu Toggle */
    .menu-toggle {
        display: flex;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1100;
        width: 50px;
        height: 50px;
        background: var(--primary);
        border-radius: 10px;
        border: none;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        justify-content: center;
        align-items: center;
        flex-direction: column;
        gap: 5px;
        padding: 12px;
        transition: var(--transition);
    }

    .menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: white;
        border-radius: 1px;
        transition: var(--transition);
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .about-content,
    .contact-container {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 576px) {
    .content {
        padding: 20px;
    }

    .home-title {
        font-size: 2.8rem;
    }

    .home-subtitle {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }
    
    .portfolio-actions {
        flex-direction: column;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes border-glow {
    from {
        opacity: 0.7;
    }
    to {
        opacity: 1;
    }
}

/* Staggered animations for portfolio items */
.portfolio-item,
.contact-item,
.skill-category {
    animation: fadeIn 0.6s ease forwards;
    opacity: 0;
}

.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.portfolio-item:nth-child(2) { animation-delay: 0.2s; }
.portfolio-item:nth-child(3) { animation-delay: 0.3s; }
.portfolio-item:nth-child(4) { animation-delay: 0.4s; }

.contact-item:nth-child(1) { animation-delay: 0.2s; }
.contact-item:nth-child(2) { animation-delay: 0.3s; }
.contact-item:nth-child(3) { animation-delay: 0.4s; }

.skill-category:nth-child(1) { animation-delay: 0.1s; }
.skill-category:nth-child(2) { animation-delay: 0.2s; }
