/* === Base Styles === */
body {
    font-family: "Arial", sans-serif;
    background: url("images/house.jpg") no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
    font-size: 16px; /* Base font size for rem calculations, added for responsiveness */
    -webkit-font-smoothing: antialiased; /* Improve text rendering on high-DPI screens */
    -moz-osx-font-smoothing: grayscale;
}

/* === Header === */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

header h1 {
    margin: 0;
    font-size: 2em;
    text-shadow: 0 0 8px #1abc9c, 0 0 12px #16a085;
    font-weight: 900;
    letter-spacing: 1.5px;
}

/* === Footer === */
footer {
    width: 100%;
    color: #ecf0f1;
    text-align: center;
    padding: 10px 10px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    font-size: 0.95em;
    line-height: 1.6;
}

.footer-content a {
    color: #1abc9c;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #16a085;
}

/* === GitHub Info in Header === */
.github-info {
    display: flex;
    align-items: center;
}

.github-info a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.github-logo {
    width: 30px;
    height: 30px;
}

/* === Navigation === */
.main-nav {
    display: flex;
    justify-content: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.main-nav li {
    display: flex;
    align-items: center;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
    position: relative;
    overflow: hidden;
    padding: 8px 12px;
}

.main-nav a:hover {
    color: #1abc9c;
}

.main-nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: #1abc9c;
    transform: translateX(-50%);
    transition: all 0.3s ease-in-out;
}

.main-nav a:hover::after {
    width: 100%;
}

.main-nav a.active {
    color: #1abc9c;
}

/* === Main Content === */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* === Profile Container === */
.profile-container {
    position: relative;
    width: 80%;
    max-width: 700px;
    margin: 10px 0;
}

/* === Profile Card === */
.profile {
    position: relative; /* Ensure the profile has relative positioning */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, background-color 0.3s;
    padding-bottom: 20px; /* Add padding at the bottom */
}

.profile:hover {
    transform: translateY(-10px);
    background-color: rgba(255, 255, 255, 1);
}

.profile:hover .nav-button {
    opacity: 0.8; /* Make buttons more visible on hover */
}

.profile img {
    width: 100%;
    height: auto;
    align-items: center;
    border-radius: 40px;
    margin-bottom: 20px;
}

/* === Profile Content === */
.profile-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
}

.profile-content p.name {
    font-size: 2em;
    font-weight: bold;
    margin-top: -30px;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

.profile-content p {
    margin: 0;
    font-size: 1em;
    color: #555;
    margin-bottom: 20px;
    text-align: left; /* Align text to the left */
    width: 100%; /* Ensure text takes full width */
    padding: 0 15px;
    box-sizing: border-box;
}

/* === Audio Controls Fix === */
.profile-content audio {
    width: 50%;
    margin: 10px 0;
    border-radius: 30px;
    height: 40px;
}

/* === Buttons === */
.button-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 15px 0 10px;
}

.button-container button {
    padding: 12px 25px;
    font-size: 1.1em;
    color: #2c3e50;
    background-color: transparent;
    border: 2px solid #2c3e50;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    width: auto;
    min-width: 160px;
    max-width: 300px;
}

.button-container button:hover {
    background-color: #2c3e50;
    color: white;
}

/* === Navigation Arrows === */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(44, 62, 80, 0.5);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0.2; /* Start with low opacity */
}

.nav-button:hover {
    background-color: rgba(26, 188, 156, 0.9);
    opacity: 1; /* Full opacity on hover */
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

/* Specific fix for the button that's appearing in the middle */
.profile .nav-button {
    position: absolute;
    /* Ensure it's not inheriting any centering styles */
    margin: 0;
    padding: 0;
    /* Force it to the edges */
    transform: translateY(-50%);
    top: 50%;
}

.profile .nav-button.next {
    right: 10px;
    left: auto; /* Ensure left is not set */
}

.profile .nav-button.prev {
    left: 10px;
    right: auto; /* Ensure right is not set */
}

/* === Sections (Hero, About, etc.) === */
.container {
    max-width: 950px;
    margin: 0 auto;
    padding: 50px 40px;
    border-radius: 20px;
    background: rgba(40, 24, 24, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px #9e9c9c66;
    border: 1px solid rgba(161, 162, 230, 0.08);
    color: #f0e8e3;
    animation: fadeInUp 0.8s ease;
}

section.hero,
section.about {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 1s ease;
}

section h2 {
    font-size: 2.4em;
    text-align: center;
    color: #fafaff;
    margin-bottom: 20px;
    text-shadow: 0 0 6px rgba(249, 196, 107, 0.4);
}

section p {
    font-size: 1.2em;
    line-height: 1.7;
    color: #fafaff;
}

section p strong {
    background-color: rgba(190, 188, 182, 0.9);
    color: #2c3e50;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: bold;
}

/* === Link Styling in Centered Info === */
.centered-info a.link {
    color: #1abc9c;
    font-weight: 600;
    text-decoration: none;
}

.centered-info a.link:hover {
    text-decoration: underline;
}

/* === Fade In Animation === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Responsive: Tablet === */
@media screen and (max-width: 1024px) {
    .profile-container {
        width: 90%;
    }

    .profile-content p.name {
        font-size: 1.8em;
    }

    .profile-content p {
        font-size: 0.9em;
    }

    /* Added for text responsiveness */
    header h1 {
        font-size: 1.75rem;
    }

    .main-nav a {
        font-size: 0.9375rem;
    }

    .profile-content p.name {
        font-size: 1.5rem;
    }

    .profile-content p {
        font-size: 0.8125rem;
    }

    .footer-content {
        font-size: 0.875rem;
    }

    section h2 {
        font-size: 2rem;
    }

    section p {
        font-size: 1rem;
    }

    .centered-info a.link {
        font-size: 0.9375rem;
    }
}

/* === Responsive: Mobile === */
@media screen and (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px;
    }

    .main-nav {
        width: 100%;
    }

    .main-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding-top: 10px;
    }

    .main-nav li {
        margin: 5px 0;
    }

    .github-info {
        margin-bottom: 10px;
    }

    .profile-container {
        flex-direction: column;
        align-items: center;
        padding: 0 40px; /* Adjusted padding for mobile */
    }

    .container,
    .centered-info,
    .profile {
        width: 100%;
        padding: 20px;
        box-sizing: border-box;
    }

    .profile-content {
        padding: 15px;
    }

    .profile-content p.name {
        font-size: 1.5em;
    }

    .profile-content p {
        font-size: 0.9em;
    }

    .nav-button {
        font-size: 1.5em;
    }

    .prev {
        left: -20px;
    }

    .next {
        right: -20px;
    }

    .profile-content audio {
        width: 80%;
        height: 35px;
    }

    .button-container button {
        font-size: 0.9em;
        padding: 10px 20px;
        min-width: 140px;
    }

    /* Added for text responsiveness */
    body {
        font-size: 14px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .main-nav a {
        font-size: 0.875rem;
    }

    .profile-content p.name {
        font-size: 1.25rem;
    }

    .profile-content p {
        font-size: 0.75rem;
        line-height: 1.7;
    }

    .footer-content {
        font-size: 0.8125rem;
    }

    section h2 {
        font-size: 1.5rem;
    }

    section p {
        font-size: 0.875rem;
    }

    .centered-info a.link {
        font-size: 0.875rem;
    }
}

/* === Extra Small Devices === */
@media screen and (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }

    .main-nav ul {
        gap: 5px;
    }

    .main-nav a {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    .profile-container {
        padding: 0 30px; /* Further reduced padding for very small screens */
    }

    .profile-content p.name {
        font-size: 1.2em;
    }

    .profile-content p {
        font-size: 0.8em;
    }

    .nav-button {
        font-size: 1.2em;
    }

    .prev {
        left: -10px;
    }

    .next {
        right: -10px;
    }

    .centered-info h3 {
        font-size: 1.4rem;
    }

    .centered-info p {
        font-size: 1rem;
    }

    .profile-content audio {
        width: 100%;
        height: 30px;
    }

    .button-container button {
        font-size: 0.9em;
        padding: 5px 15px;
        min-width: 120px;
    }

    /* Added for text responsiveness */
    body {
        font-size: 13px;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .main-nav a {
        font-size: 0.75rem;
    }

    .profile-content p.name {
        font-size: 1rem;
    }

    .profile-content p {
        font-size: 0.6875rem;
        line-height: 1.6;
    }

    .footer-content {
        font-size: 0.75rem;
    }

    section h2 {
        font-size: 1.25rem;
    }

    section p {
        font-size: 0.8125rem;
    }

    .centered-info a.link {
        font-size: 0.75rem;
    }
}

/* === Responsive Nav Buttons === */
@media screen and (max-width: 768px) {
    .profile-nav-button {
        width: 36px;
        height: 36px;
        font-size: 0.9em;
    }

    .profile-nav-button.next {
        right: 10px;
    }

    .profile-nav-button.prev {
        left: 10px;
    }

    .nav-button {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
    }

    .profile .nav-button.next {
        right: 5px;
    }

    .profile .nav-button.prev {
        left: 5px;
    }
}

@media screen and (max-width: 480px) {
    .nav-button {
        width: 32px;
        height: 32px;
        font-size: 1em;
    }
}

/* === Ultra-Small Devices (360px and below) === */
@media screen and (max-width: 360px) {
    body {
        font-size: 12px; /* Smallest base font */
    }

    header h1 {
        font-size: 1.125rem;
    }

    .main-nav a {
        font-size: 0.6875rem;
    }

    .profile-content p.name {
        font-size: 0.875rem;
    }

    .profile-content p {
        font-size: 0.625rem;
        line-height: 1.5;
    }

    .footer-content {
        font-size: 0.6875rem;
    }

    section h2 {
        font-size: 1.125rem;
    }

    section p {
        font-size: 0.75rem;
    }

    .centered-info a.link {
        font-size: 0.6875rem;
    }
}

/* === Prevent Text Overflow === */
.profile-content p,
section p,
.footer-content {
    word-wrap: break-word; /* Ensure long words don’t overflow */
}
