:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --success-color: #4bb543;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --sidebar-width: 250px;
}

/* Universal box-sizing for consistent layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Add smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Utility class to completely hide elements */
.hidden {
    display: none !important;
}

/* Base body styles */
body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    /* No overflow-x hidden here initially if you want overlay behavior
       unless you specifically need it for something else. */
}

/* Prevents scrolling when the mobile menu is open */
body.no-scroll {
    overflow: hidden;
}

/* Central container for content */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sidebar styling for desktop */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: white;
    box-shadow: var(--box-shadow);
    z-index: 1000; /* Ensure sidebar is above main content on desktop */
    transition: transform var(--transition); /* Using transform for consistency */
}

.sidebar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

#logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.sidebar-image {
    text-align: center;
    padding: 1rem;
}

.sidebar-image img {
    max-width: 80%;
    border-radius: 50%;
    box-shadow: var(--box-shadow);
}

.sidebar ul {
    list-style: none;
    padding: 1rem;
    text-align: center;
}

.sidebar ul li {
    margin: 1rem 0;
}

.sidebar ul li a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: var(--transition);
}

.sidebar ul li a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* Hamburger menu icon - hidden by default on desktop */
.hamburger {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--dark-color);
    border-radius: 5px;
    transition: var(--transition);
}

/* Hamburger active state transforms into an 'X' */
.hamburger.active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg); /* Adjusted for 'X' */
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg); /* Adjusted for 'X' */
}


/* Main content area - shifted for desktop sidebar */
.main-content {
    margin-left: var(--sidebar-width); /* Desktop: shifts content to the right */
    transition: margin-left var(--transition);
}

/* Hero section */
.hero {
    padding: 4rem 0;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hero-text {
    flex: 1;
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

/* Headings */
h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--dark-color);
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    margin-top: 1rem;
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Work section */
.work {
    padding: 4rem 0;
    background-color: white;
}

.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: var(--box-shadow);
    transition: var(--transition);
}

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

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.project-info p {
    color: var(--gray-color);
    margin-bottom: 1rem;
}

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

.tag {
    background-color: var(--light-color);
    color: var(--dark-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* About section */
.about {
    padding: 4rem 0;
    background-color: var(--light-color);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.about-text {
    flex: 1;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.skill-item {
    background-color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    font-weight: 500;
}

/* Testimonials section */
.testimonials {
    padding: 4rem 0;
    background-color: white;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.testimonial-card {
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.author-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.author-info h4 {
    margin-bottom: 0.2rem;
}

.author-info p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* Footer section */
footer {
    padding: 3rem 0;
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: var(--sidebar-width); /* Adjusted for desktop sidebar */
    transition: padding-left var(--transition); /* Transition for footer shift */
}

.footer-content {
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
}

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

/* Specific button styles */
.edit-btn {
    background-color: var(--success-color);
    margin-right: 1rem;
}

.load-btn {
    background-color: var(--gray-color);
}

/* Portfolio Form (for editing) */
#portfolio-form {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin: 2rem 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="color"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="color"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.form-row > div {
    flex: 1;
}

.form-row .remove-btn {
    background-color: #dc3545;
    margin-left: auto;
    flex: 0 0 auto;
}

.form-row .remove-btn:hover {
    background-color: #c82333;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    margin-top: 0; /* Override generic .btn margin-top for form actions */
}

.nav-item,
.project-item,
.testimonial-item,
.social-link-item,
.skill-item {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 15px;
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.pagination-btn:hover:not(.active) {
    background: var(--light-color);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
}

.pagination-ellipsis {
    padding: 8px 5px;
    color: var(--gray-color);
}

/* -------------------- Media Queries for Mobile -------------------- */
@media (max-width: 768px) {
    /* Mobile Sidebar - Initial hidden state */
    .sidebar {
        left: 0;
        transform: translateX(-100%);
        visibility: hidden;
        opacity: 0;
        transition: transform 0.3s ease-out, opacity 0.3s ease-out, visibility 0s linear 0.3s;
        width: var(--sidebar-width);
        /* Ensure it's above content when active */
        z-index: 1000;
    }

    /* Mobile Sidebar - Active (visible) state */
    .sidebar.active {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
        transition: transform 0.3s ease-out, opacity 0.3s ease-out, visibility 0s linear;
    }

    /* Main content area - NO SHIFTING ON MOBILE */
    .main-content {
        margin-left: 0; /* Reset to default */
        transition: none; /* No transition needed as it doesn't move */
    }

    /* Main content does NOT shift when sidebar is active */
    .main-content.active {
        transform: none; /* Reset to default */
    }

    /* Hamburger menu - visible on mobile */
    .hamburger {
        display: flex;
        position: fixed; /* Keep hamburger accessible regardless of scroll */
        top: 20px;
        left: 20px;
        z-index: 1002; /* Ensure it's above both main content AND sidebar */
    }

    /* Hamburger active state transforms into an 'X' (already defined, kept for completeness) */
    .hamburger.active span:nth-child(1) {
        transform: translateY(11px) rotate(45deg);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
        transform: translateY(-11px) rotate(-45deg);
    }

    /* Hero section adjustments for mobile */
    .hero-content {
        flex-direction: column;
    }

    .hero-text,
    .hero-image {
        text-align: center;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    /* Projects grid for mobile */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Form adjustments for mobile */
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .form-row > div {
        width: 100%;
    }

    .form-row .remove-btn {
        margin-left: 0;
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Contact section adjustments for mobile */
    .contact-section h2 {
        font-size: 2em;
    }

    .contact-section p {
        font-size: 1em;
        margin-bottom: 30px;
    }

    #contact-form {
        padding: 20px;
    }

    #contact-form .btn {
        width: 100%;
        align-self: center;
    }

    /* Footer adjustments for mobile - NO SHIFTING */
    footer {
        padding-left: 0; /* Reset to default */
        transition: none; /* No transition needed as it doesn't move */
    }

    /* Footer does NOT shift when sidebar is active */
    .main-content.active + footer {
        padding-left: 0; /* Reset to default */
        transform: none; /* Reset to default */
    }

    /* Add a semi-transparent overlay when sidebar is open */
    body.no-scroll::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5); /* Dark semi-transparent overlay */
        z-index: 999; /* Below sidebar, above content */
        pointer-events: auto; /* Allow clicking to close */
    }
}
/* Contact Section (General, not specifically mobile only) */
.contact-section {
    padding: 60px 0;
    background-color: var(--light-color);
    text-align: center;
}

.contact-section h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.contact-section p {
    font-size: 1.1em;
    margin-bottom: 40px;
    color: var(--gray-color);
}

#contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid grey;
    border-radius: 5px;
    font-size: 1em;
    font-family: var(--font-main);
    color: var(--dark-color);
    background-color: var(--light-color);
    box-shadow: var(--box-shadow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contact-form input[type="text"]:focus,
#contact-form input[type="email"]:focus,
#contact-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
    outline: none;
}

#contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

#contact-form .btn {
    align-self: flex-start;
    background-color: var(--primary-color);
    color: white;
    border: none;
}

#contact-form .btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.success-message {
    color: var(--success-color);
    font-weight: bold;
    margin-top: 15px;
    text-align: center;
    padding: 10px;
    background-color: rgba(75, 181, 67, 0.1);
    border-radius: 5px;
}
