/* 
 * Mohamed Abdelkader - Portfolio Styles
 * Theme: Premium, Minimalist, Dark Mode Default
 */

:root {
    /* Color Variables - Dark Mode (Default) */
    --bg-color: #0f172a;
    /* Deep Slate/Navy */
    --surface-color: #1e293b;
    --card-hover-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    /* Sky Blue */
    --accent-hover: #0ea5e9;
    --border-color: #334155;
    --nav-bg: rgba(15, 23, 42, 0.85);
    /* Glassmorphism base */

    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Overrides */
body.light-mode {
    --bg-color: #ffffff;
    --surface-color: #f1f5f9;
    --card-hover-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-color: #0284c7;
    --accent-hover: #0369a1;
    --border-color: #e2e8f0;
    --nav-bg: rgba(255, 255, 255, 0.85);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    /* Always white on accent */
    border: 2px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -10px rgba(56, 189, 248, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-3px);
}

.btn-sm {
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.9rem;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-sm:hover {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-sm.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.btn-sm.disabled:hover {
    background: transparent;
    color: var(--text-secondary);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.nav-links a:hover {
    color: var(--accent-color);
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform var(--transition-fast);
    padding: 8px;
}

#theme-toggle:hover {
    transform: rotate(15deg);
    color: var(--accent-color);
}

/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    transition: all 0.3s ease;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
    overflow: hidden;
}

/* Subtle background accent for hero */
.hero::before {
    content: '';
    position: absolute;
    top: 20%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: var(--accent-color);
    filter: blur(150px);
    opacity: 0.15;
    z-index: -1;
    border-radius: 50%;
}

.hero-content {
    max-width: 800px;
}

.greeting {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.hero-name {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -2px;
    margin-bottom: 16px;
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 32px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 600px;
}

.hero-btns {
    display: flex;
    gap: 16px;
}

/* Sections General */
.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 60px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    align-items: center;
}

.about-text p {
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.image-placeholder {
    width: 300px;
    height: 300px;
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

/* Objective Section */
.objective-box {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
    max-width: 900px;
    margin: 0 auto;
}

.objective-box h3 {
    margin-bottom: 16px;
    color: var(--accent-color);
}

.objective-box p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-category {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast);
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.skill-category h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-category h3 i {
    color: var(--accent-color);
}

.skill-list li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    position: relative;
    padding-left: 20px;
}

.skill-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* Certifications Section */
.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.cert-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.cert-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.cert-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
    /* Fallback */
}

.cert-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Certificates usually have text, contain ensures full visibility or cover if we want to fill */
    object-fit: cover;
    /* cover looks better for cards, but might cut off text. let's try cover as default, user can click to see full */
    transition: transform var(--transition-smooth);
}

.cert-card:hover .cert-image img {
    transform: scale(1.05);
}

.cert-content {
    padding: 24px;
    flex-grow: 1;
}

.cert-content h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.cert-content .issuer {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.cert-content .date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 16px;
    font-style: italic;
}

.cert-content .cert-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Experience Section */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 50px;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    border: 4px solid var(--bg-color);
}

.timeline-content {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.timeline-header {
    margin-bottom: 16px;
}

.timeline-header h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.company {
    color: var(--accent-color);
    font-size: 0.95rem;
    font-weight: 500;
}

.timeline-list li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    list-style-type: disc;
    margin-left: 20px;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

.project-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 32px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-tool {
    font-size: 0.8rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-weight: 600;
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.project-details ul {
    list-style: none;
    margin-bottom: 24px;
}

.project-details ul li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    padding-left: 16px;
    position: relative;
    border-left: 2px solid var(--border-color);
}

.project-links {
    margin-top: auto;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--surface-color);
    padding: 32px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.service-card:hover {
    transform: translateY(-5px);
    background: var(--card-hover-color);
}

.service-card i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    font-size: 1.1rem;
}

.contact-item i {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Form */
.contact-form {
    background: var(--surface-color);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Footer */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.back-to-top {
    width: 40px;
    height: 40px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-fast);
}

.back-to-top:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Animation Utilities */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 991px) {

    /* Layout Adjustments */
    .hero-name {
        font-size: 3rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .image-placeholder {
        margin: 0 auto;
        /* Prevent overflow on small screens */
        max-width: 100%;
        width: 300px;
        height: auto;
        aspect-ratio: 1/1;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    /* Navigation - Switch to Mobile Menu earlier */
    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--surface-color);
        flex-direction: column;
        padding: 20px 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        padding-left: 30px;
    }

    .timeline-dot {
        left: -9px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-name {
        font-size: 2rem;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}

/* Modal/Lightbox Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-md);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--accent-color);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2002;
}

.nav-btn:hover {
    background: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: -70px;
}

.next-btn {
    right: -70px;
}

.modal-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        background: rgba(0, 0, 0, 0.5);
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }

    .close-modal {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }

    .modal-content {
        width: 100%;
    }

    #modal-image {
        max-height: 70vh;
    }
}

/* Profile Image Styles */
.about-image {
    width: 300px;
    height: 300px;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid var(--accent-color);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.about-image:hover .profile-img {
    transform: scale(1.05);
}

@media (max-width: 991px) {
    .about-image {
        margin: 40px auto 0;
    }
}