/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50; /* Dark Blue */
    --secondary-color: #27ae60; /* Green */
    --accent-color: #2980b9; /* Blue */
    --background-color: #ecf0f1; /* Light Gray */
    --text-color: #2c3e50;
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Roboto', sans-serif;
    --transition-speed: 0.3s;
    --shadow-light: 0 4px 15px rgba(0,0,0,0.05);
    --shadow-heavy: 0 8px 20px rgba(0,0,0,0.1);
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    scroll-behavior: smooth;
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 20px 0;
}

/* Navigation */
nav {
    background: var(--primary-color);
    color: #fff;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background var(--transition-speed), box-shadow var(--transition-speed);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo a {
    color: #fff;
    text-decoration: none;
    font-family: var(--heading-font);
    font-size: 1.8em;
    font-weight: 700;
    transition: color var(--transition-speed);
}

nav .logo a:hover {
    color: var(--secondary-color);
}

nav .nav-links {
    list-style: none;
    display: flex;
}

nav .nav-links li {
    margin-left: 25px;
}

nav .nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    transition: color var(--transition-speed);
    position: relative;
    padding: 5px 0;
}

nav .nav-links a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    background: var(--secondary-color);
    left: 0;
    bottom: 0;
    transition: width var(--transition-speed);
}

nav .nav-links a:hover::after,
nav .nav-links a.active::after {
    width: 100%;
}

nav .hamburger {
    display: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #fff;
    transition: color var(--transition-speed);
}

nav .hamburger:hover {
    color: var(--secondary-color);
}

/* Sections */
.section {
    padding: 100px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    color: var(--primary-color);
    font-family: var(--heading-font);
}

/* Home Section */
.home-section {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.8), rgba(39, 174, 96, 0.8)), url('assets/images/home-bg.jpg') no-repeat center center/cover;
    color: #fff;
    display: flex;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: background var(--transition-speed);
}

.home-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

.home-content {
    position: relative;
    z-index: 1;
}

.home-section h1 {
    font-family: var(--heading-font);
    font-size: 3em;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease-out;
}

.home-section p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #bdc3c7;
    animation: fadeInUp 1s ease-out;
}

.btn {
    display: inline-block;
    background: var(--secondary-color);
    color: #fff;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 25px;
    transition: background var(--transition-speed), transform var(--transition-speed);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.4);
}

/* About Section */
.about-section {
    background: #fff;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
}

.about-text {
    flex: 2;
}

.about-text p {
    font-size: 1.1em;
    color: #555;
    line-height: 1.8;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-speed);
}

.about-image img:hover {
    transform: scale(1.05);
}

/* Skills Section */
.skills-section {
    background: var(--background-color);
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center the items */
    gap: 30px;
}

.skill {
    position: relative;          /* make container for absolute hover-text */
    background: #fff;
    padding: 30px 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    cursor: pointer;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.skill i {
    font-size: 2.5em;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.skill h3 {
    font-size: 1.3em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* hide “Learn More” by default */
.skill .hover-text {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 62, 80, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

/* show it on desktop hover / keyboard focus */
.skill:hover .hover-text,
.skill:focus .hover-text {
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    align-items: center; /* Vertical centering */
    justify-content: center; /* Horizontal centering */
    padding: 20px; /* Padding for small screens */
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: fadeIn 0.5s;
}

.close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 30px;
    font-weight: bold;
    transition: color var(--transition-speed);
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-family: var(--heading-font);
    color: var(--primary-color);
}

.modal-content p {
    font-size: 1em;
    color: #555;
    line-height: 1.6;
}

/* Projects Section */
.projects-section {
    background: #fff;
}

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 30px;
}

.project-card {
    background: #fff;
    border-radius: 10px;
    text-align: center;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
    width: 300px;              /* keep your fixed width */
    /* remove height:350px; let it grow to match tallest */
}

.project-card.blue-top img {
    background-color: #001f3f;
    padding: 10px;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-content h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.project-content p {
    flex: 1;
    color: #555;
    line-height: 1.6;
}

.project-content .btn {
    text-align: center;
    background: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    transition: background var(--transition-speed), box-shadow var(--transition-speed);
}

.project-content .btn:hover {
    background: var(--primary-color);
    box-shadow: var(--shadow-heavy);
}

/* Experience Section */
.experience-section {
    background: var(--background-color);
}

.timeline {
    position: relative;
    margin: 20px 0;
    padding-left: 50px;
    border-left: 4px solid var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    display: flex;
    align-items: flex-start;
}

.timeline-marker {
    position: absolute;
    left: -38px; /* Adjust to position the marker */
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-color);
    transition: background var(--transition-speed), box-shadow var(--transition-speed);
}

.timeline-item:hover .timeline-marker {
    background: var(--secondary-color);
    box-shadow: 0 0 0 2px var(--secondary-color);
}

.timeline-content {
    margin-left: 50px; /* Space for the marker */
}

.timeline-content h3 {
    margin-bottom: 5px;
    font-size: 1.4em;
    color: var(--primary-color);
    font-family: var(--heading-font);
}

.timeline-content span {
    display: block;
    font-size: 0.95em;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.timeline-content p {
    color: #555;
    line-height: 1.6;
}

/* Contact Section */
.contact-section {
    background: #fff;
}

.contact-section form {
    max-width: 1000px; /* Increased width */
    width: 100%; /* Ensure full width within container */
    margin: auto;
    background: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    transition: box-shadow var(--transition-speed);
}

.contact-section form:hover {
    box-shadow: var(--shadow-heavy);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color var(--transition-speed);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
}

#form-message {
    margin-top: 20px;
    text-align: center;
    font-size: 1em;
    color: green;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: #fff;
    padding: 20px 0;
    text-align: center;
    transition: background var(--transition-speed);
}

footer p {
    margin-bottom: 15px;
    font-size: 0.95em;
}

footer .social-links a {
    color: #fff;
    margin: 0 10px;
    font-size: 1.5em;
    transition: color var(--transition-speed);
}

footer .social-links a:hover {
    color: var(--secondary-color);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .about-content,
    .projects-grid {
        flex-direction: column;
    }

    .about-image img,
    .project-card img {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    nav .nav-links {
        position: absolute;
        top: 60px;
        left: -100%;
        flex-direction: column;
        background: var(--primary-color);
        width: 100%;
        transition: left var(--transition-speed);
    }

    nav .nav-links li {
        margin: 15px 0;
        text-align: center;
    }

    nav .nav-links.active {
        left: 0;
    }

    nav .hamburger {
        display: block;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-text,
    .about-image {
        width: 50%;
    }

    .skills-grid {
        justify-content: center; /* Center items */
    }

    .projects-grid {
        justify-content: center; /* Center items */
    }
}

@media (max-width: 480px) {
    .home-section h1 {
        font-size: 2.2em;
    }

    .home-section p {
        font-size: 1em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    nav .logo a {
        font-size: 1.3em;
    }

    nav .nav-links li {
        margin-left: 15px;
    }

    /* Modal Content Adjustments */
    .modal-content {
        width: 90%;
    }

    /* Timeline Adjustments for Small Screens */
    .timeline {
        padding-left: 20px;
    }

    .timeline-marker {
        left: -20px;
    }

    .timeline-content {
        margin-left: 40px;
    }
}

/* Modal Animations */
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Additional Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
