/* 
=============================
CSS for Mohammed Hadi's Portfolio
=============================
*/

/* ===== CSS RESET & BASE STYLES ===== */
:root {
    --primary-color: #1F2937;
    --accent-color: #3B82F6;
    --bg-color: #F9FAFB;
    --text-dark: #111827;
    --text-muted: #6B7280;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--accent-color);
    transition: var(--transition);
}

a:hover {
    color: #2563EB;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-padding {
    padding: 5rem 0;
}

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

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.underline {
    height: 4px;
    width: 60px;
    background-color: var(--accent-color);
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.btn-primary:hover {
    background-color: #2563EB;
    border-color: #2563EB;
    color: white;
}

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

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
}

.btn-outline:hover {
    background-color: var(--text-muted);
    color: white;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(249, 250, 251, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 15px;
}

.logo a {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-menu ul {
    display: flex;
    list-style: none;
}

.nav-menu ul li {
    margin-left: 1.5rem;
}

.nav-menu ul li a {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem;
    position: relative;
}

.nav-menu ul li a:hover,
.nav-menu ul li a.active {
    color: var(--accent-color);
}

.nav-menu ul li a.active::after,
.nav-menu ul li a:hover::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    margin-bottom: 5px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: var(--transition);
}

@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: white;
        transition: 0.4s;
        padding: 2rem;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu ul {
        flex-direction: column;
    }

    .nav-menu ul li {
        margin: 1.5rem 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

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

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
}

/* ===== HERO SECTION ===== */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background-color: var(--primary-color);
    color: white;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero h1 span {
    color: var(--accent-color);
    display: inline-block;
}

.typing-text {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    min-height: 30px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

@media screen and (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .typing-text {
        font-size: 1.25rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-buttons .btn {
        width: 100%;
    }
}

/* ===== ABOUT SECTION ===== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: center;
}

.about-image {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-image img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

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

.quick-facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.fact {
    display: flex;
    flex-direction: column;
}

.fact-title {
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.fact-value {
    color: var(--text-muted);
}

@media screen and (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
    }

    .about-image {
        max-width: 300px;
        margin: 0 auto;
    }
}

/* ===== SKILLS SECTION ===== */
.skills-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.skills-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

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

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.skill-circle {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
}

.skill-circle .progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--accent-color) var(--percent), #e6e6e6 var(--percent));
}

.inner-circle {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 80px;
    height: 80px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.percent {
    font-weight: 700;
    color: var(--accent-color);
}

.skill-item h4 {
    font-size: 1rem;
    color: var(--text-dark);
}

@media screen and (max-width: 992px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 576px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== PROJECTS SECTION ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.project-img {
    height: 200px;
    overflow: hidden;
}

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

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

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.project-info p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tags span {
    background-color: #EEF2FF;
    color: var(--accent-color);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

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

/* ===== BLOG SECTION ===== */
.blog-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.blog-img {
    height: 200px;
    overflow: hidden;
}

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

.blog-card:hover .blog-img img {
    transform: scale(1.05);
}

.blog-info {
    padding: 1.5rem;
}

.blog-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.blog-info p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.read-more {
    font-weight: 500;
    display: inline-block;
    position: relative;
}

.read-more::after {
    content: '→';
    margin-left: 0.25rem;
    transition: var(--transition);
}

.read-more:hover::after {
    margin-left: 0.5rem;
}

/* ===== RESUME SECTION ===== */
.resume-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.resume-actions {
    margin-bottom: 1rem;
}

.resume-preview {
    width: 100%;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.resume-preview iframe {
    width: 100%;
    height: 100%;
}

/* ===== CONTACT SECTION ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    background-color: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.contact-item .icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.contact-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.contact-form {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #E5E7EB;
    border-radius: 5px;
    font-family: var(--font-body);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

@media screen and (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
    }

    .contact-info {
        order: 2;
    }

    .contact-form {
        order: 1;
    }
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 3rem 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    color: white;
    font-weight: 500;
}

.footer-social a:hover {
    color: var(--accent-color);
}

.footer-text {
    text-align: center;
}

.footer-text p {
    margin-bottom: 0.5rem;
}

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background-color: var(--accent-color);
    width: 0;
    z-index: 1001;
    transition: width 0.1s;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #2563EB;
}