/* Global Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4; /* Light gray background */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

a {
    color: #3498db; /* Blue accent */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9; /* Darker blue on hover */
}

h1, h2, h3 {
    color: #333;
    margin-bottom: 15px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    color: #333;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #3498db;
}

.button {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.button:hover {
    background-color: #2980b9;
}

/* Header */
header {
    background-color: #fff;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

header h1 {
    margin: 0;
    font-size: 1.8em;
    color: #3498db;
}

header nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

header nav ul li a {
    color: #333;
    font-weight: bold;
    padding: 5px 0;
    position: relative;
}

header nav ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: #3498db;
    transition: width 0.3s ease;
}

header nav ul li a:hover::after,
header nav ul li a.active::after {
    width: 100%;
}

.admin-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px; /* Space from nav on smaller screens */
}

.admin-controls .button {
    padding: 8px 15px;
    font-size: 0.9em;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none; /* Hidden by default on desktop */
    font-size: 1.8em;
    cursor: pointer;
    color: #333;
}

/* Hero Section */
.hero-section {
    background-color: #3498db;
    color: #fff;
    padding: 80px 20px;
    text-align: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* For potential background image/video */
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Overlay for readability */
    z-index: 1;
}

.hero-section .container {
    z-index: 2;
}

.hero-section h2 {
    font-size: 3.5em;
    margin-bottom: 10px;
    color: #fff;
}

.hero-section p {
    font-size: 1.5em;
    opacity: 0.9;
}

/* Work Section */
.work-section {
    padding: 60px 0;
    background-color: #fff;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

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

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.project-info {
    padding: 20px;
    flex-grow: 1; /* Allow content to push footer down */
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #333;
}

.project-info p {
    font-size: 0.95em;
    color: #555;
    flex-grow: 1; /* Make description take available space */
}

.project-link-button {
    display: inline-block;
    margin-top: 15px;
    background-color: #3498db;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
}

.project-link-button:hover {
    background-color: #2980b9;
}


/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 15px;
}

.pagination button {
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background-color: #2980b9;
}

.pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#pageInfo {
    font-weight: bold;
    color: #555;
}

/* About Section */
.about-section {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.about-content {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 40px;
    align-items: flex-start;
}

#profileImage {
    width: 180px; /* Adjust size as needed */
    height: 180px; /* Keep height same as width for perfect circle */
    border-radius: 50%; /* Makes the image round */
    object-fit: cover; /* Ensures image covers the area without distortion */
    border: 5px solid #3498db; /* A nice border around the image */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-right: 25px; /* Space between image and text */
    flex-shrink: 0; /* Prevents image from shrinking in flex container */
    /* display: none; will be toggled by JS if image is available */
}

.about-content p {
    flex: 2; /* Takes more space */
    font-size: 1.1em;
    line-height: 1.8;
    color: #555;
}

.skills-list {
    flex: 1; /* Takes less space */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.skills-list h3 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.skills-list ul {
    list-style: none;
}

.skills-list ul li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    color: #666;
}

.skills-list ul li:last-child {
    border-bottom: none;
}

/* Testimonials Section */
.testimonials-section {
    padding: 60px 0;
    background-color: #eaf6fd; /* Lighter blue background */
    text-align: center;
}

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

.testimonial-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.testimonial-card p {
    font-style: italic;
    color: #555;
    margin-bottom: 15px;
    flex-grow: 1;
}

.testimonial-card .author {
    font-weight: bold;
    color: #3498db;
    font-size: 1.1em;
}

/* Contact Section */
.contact-section {
    padding: 60px 0;
    background-color: #fff;
}

.contact-section form {
    max-width: 600px;
    margin: 0 auto;
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-group textarea {
    resize: vertical;
}

.contact-section button[type="submit"] {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px 20px;
    border-radius: 5px;
    margin-top: 20px;
    text-align: center;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 20px;
    border-radius: 5px;
    margin-top: 20px;
    text-align: center;
    border: 1px solid #f5c6cb;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
    text-align: center;
}

footer p {
    margin-bottom: 15px;
}

.social-links {
    font-size: 1.8em;
    display: flex;
    justify-content: center;
    gap: 25px;
}

.social-links a {
    color: #fff;
    transition: color 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; /* Make icons clickable area larger */
    height: 40px;
    border-radius: 50%; /* For a round background if desired */
}

.social-links a:hover {
    color: #3498db;
}

/* By default, hide the fallback text */
.social-links .fallback-text {
    display: none;
}

/* Only show fallback text if JS adds 'no-fontawesome' class */
.social-links .no-fontawesome .fallback-text {
    font-size: 0.5em; /* Smaller text for fallback */
    display: block; /* Show the fallback text */
    color: #ccc;
    font-weight: normal;
}

.social-links .no-fontawesome i {
    display: none; /* Hide icon if Font Awesome fails and fallback text is shown */
}


/* Form specific styles for form.html */
.form-main {
    padding: 40px 20px;
}

#editForm h2 {
    margin-top: 30px;
    margin-bottom: 20px;
    color: #3498db;
    font-size: 1.8em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

#editForm .form-group {
    margin-bottom: 15px;
}

#editForm .form-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #444;
}

#editForm .form-group input[type="text"],
#editForm .form-group input[type="email"],
#editForm .form-group input[type="url"],
#editForm .form-group textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    font-size: 1em;
}

.project-item, .testimonial-item {
    background-color: #f0f8ff; /* Light blue for items */
    border: 1px solid #b3e0ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.project-item h3, .testimonial-item h3 {
    margin-top: 0;
    color: #2980b9;
}

.remove-button {
    background-color: #e74c3c; /* Red for remove */
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 10px;
    float: right; /* Align to the right */
}

.remove-button:hover {
    background-color: #c0392b;
}

.form-actions {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.form-actions .button.primary {
    background-color: #2ecc71; /* Green for save */
}

.form-actions .button.primary:hover {
    background-color: #27ae60;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: row; /* Keep logo and toggle on one line */
        align-items: center;
        justify-content: space-between; /* Space out logo and toggle */
    }

    header h1 {
        flex-grow: 1; /* Allow logo to take available space */
    }

    .menu-toggle {
        display: block; /* Show hamburger icon on mobile */
        order: 2; /* Position toggle after logo, before nav */
    }

    header nav {
        order: 3; /* Push nav to the next row */
        width: 100%; /* Take full width */
        max-height: 0; /* Initially hidden */
        overflow: hidden;
        transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
        opacity: 0;
        flex-basis: 100%; /* Ensure it occupies full width when hidden */
    }

    header nav.active {
        max-height: 300px; /* Adjust as needed based on content */
        opacity: 1;
        transition: max-height 0.5s ease-in, opacity 0.5s ease-in;
    }

    header nav ul {
        flex-direction: column;
        text-align: center;
        width: 100%;
        margin-top: 15px; /* Add some space from header elements */
        border-top: 1px solid #eee; /* Visual separation */
        padding-top: 10px;
        background-color: #fff; /* Ensure background matches header */
    }

    header nav ul li {
        width: 100%;
        margin-bottom: 10px; /* Space between links */
    }

    .admin-controls {
        order: 4; /* Push admin controls to the next row */
        margin-top: 20px;
        flex-direction: column;
        width: 100%;
    }

    .admin-controls .button,
    .admin-controls label.button {
        width: 100%;
        text-align: center;
    }

    .hero-section h2 {
        font-size: 2.5em;
    }

    .hero-section p {
        font-size: 1.2em;
    }

    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Adjust for mobile */
    }

    .about-content {
        flex-direction: column;
        align-items: center; /* Center items when stacked */
    }

    #profileImage {
        margin-right: 0; /* Remove right margin when stacked */
        margin-bottom: 20px; /* Add bottom margin when stacked */
    }

    .about-content p, .skills-list {
        flex: none; /* Reset flex for stacking */
        width: 100%;
        padding: 20px;
    }

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

    .contact-section form {
        padding: 20px;
    }
}

/* Ensure smooth transitions */
body {
    transition: background-color 0.3s ease;
}