*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Custom scroll-behavior for smooth scrolling */
html {
    scroll-behavior: smooth;
    /* This rule prevents horizontal scrolling on all screen sizes */
    overflow-x: hidden;
}

/* Scroll to home button styling */
#scrollToHomeBtn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
}

#scrollToHomeBtn i {
    font-size: 20px;
}

/* Up-down animation for scroll button */
@keyframes float-up-down {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }
}

.scroll-btn-animate {
    animation: float-up-down 2s ease-in-out infinite;
}

/* Responsive positioning and sizing for scroll button on small screens */
@media (max-width: 768px) {

    #navbar-menu a:hover,
    #navbar-menu a:focus {
        color: #34d399;
        /* Text color change on hover/tap */
        /* You can add a subtle glow effect if desired, for example: */
        box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
    }

    #scrollToHomeBtn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    #scrollToHomeBtn i {
        font-size: 18px;
    }

    @keyframes float-up-down {
        50% {
            transform: translateY(-4px);
        }
    }
}

@media (max-width: 480px) {
    #scrollToHomeBtn {
        bottom: 15px;
        right: 15px;
        width: 48px;
        height: 48px;
    }

    #scrollToHomeBtn i {
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    #scrollToHomeBtn {
        bottom: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }

    #scrollToHomeBtn i {
        font-size: 15px;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #1a1a1a;
    /* Darker, almost black background */
    color: #e0e0e0;
    /* Lighter text for contrast */
    overflow-x: hidden;
    /* This line prevents horizontal scrolling */
}

.section {
    min-height: 100vh;
    /* Use min-height to allow content to expand if needed */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    /* text-align: center; Removed to allow individual content blocks to control alignment */
    width: 100%;
    /* Ensure section takes full width */
    box-sizing: border-box;
    /* Include padding in width calculation */
}

.home-section {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
    padding: 0;
}

.home-flex-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    height: 100vh;
    gap: 0;
}

.home-left,
.home-right {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.home-left {
    justify-content: flex-end;
}

.home-right {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-left: 2rem;
    min-width: 400px;
}

.home-image-frame {
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: linear-gradient(135deg, #23272f 60%, #34d399 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px 0 rgba(52, 211, 153, 0.15);
    transition: box-shadow 0.4s, border 0.4s, transform 0.4s;
    border: 6px solid #23272f;
    position: relative;
    animation: frame-rotate 10s linear infinite;
    will-change: transform;
}

@keyframes frame-rotate {
    0% {
        box-shadow: 0 0 40px 0 rgba(52, 211, 153, 0.15);
    }

    50% {
        box-shadow: 0 0 80px 10px rgba(52, 211, 153, 0.25);
    }

    100% {
        box-shadow: 0 0 40px 0 rgba(52, 211, 153, 0.15);
    }
}

.home-image-frame:hover {
    box-shadow: 0 0 120px 20px #34d399, 0 0 60px 10px #23272f;
    border: 6px solid #34d399;
    animation-play-state: paused;
    transform: scale(1.08);
    /* Border moves out */
}

.profile-pic {
    width: 95%;
    height: 95%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
    transition: box-shadow 0.3s, transform 0.4s;
    border: 0;
    background: #23272f;
    will-change: transform;
}

.home-image-frame:hover .profile-pic {
    transform: scale(1.03);
    /* Pic grows a bit more than frame */
    box-shadow: 0 0 30px 5px #34d399;
}

.hello-line {
    font-size: 3.2rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.12em;
    line-height: 1.1;
    text-align: left;
    width: 100%;
}

.home-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: #34d399;
    margin-bottom: 0.12em;
    line-height: 1.1;
    min-height: 3.2rem;
    text-align: left;
    width: 100%;
}

#name-typewriter {
    color: #34d399;
    display: inline-block;
    min-width: 220px;
    min-height: 1.5em;
    vertical-align: top;
}

.home-bio {
    color: #e0e0e0;
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 1.3rem;
    min-height: 1.5em;
    text-align: left;
    width: 100%;
}

.home-buttons {
    display: flex;
    gap: 0.7rem;
    justify-content: flex-start;
    width: 100%;
}

.home-btn {
    padding: 0.5rem 1.0rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s, box-shadow 0.3s, border 0.3s;
    border: 2px solid #2dd4bf;
    /* Emerald-400 border */
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 8px 0 rgba(52, 211, 153, 0.08);
    background: transparent;
}

.home-btn.primary {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

.home-btn.secondary {
    background: #23272f;
    color: #fff;
    border-color: #23272f;
}

.home-btn.primary:hover,
.home-btn.secondary:hover {
    box-shadow: 0 0 10px 2px #34d399;
    filter: brightness(1.02);
    border-color: #34d399;
}

@media (max-width: 1300px) {
    .home-image-frame {
        width: 350px;
        height: 350px;
    }

    .home-right {
        min-width: 250px;
        padding-left: 1rem;
    }

    .hello-line,
    .home-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 900px) {
    .home-section {
        height: auto;
        min-height: 100vh;
        padding: 2rem 0;
    }

    .home-flex-container {
        flex-direction: column;
        gap: 2rem;
        height: auto;
    }

    .home-left,
    .home-right {
        justify-content: center;
        align-items: center;
        min-width: unset;
        padding-left: 0;
    }

    .home-image-frame {
        width: 220px;
        height: 220px;
    }

    .hello-line,
    .home-title {
        font-size: 2rem;
        text-align: center;
    }

    .home-text-flex,
    .home-right {
        align-items: center;
        text-align: center;
    }

    .home-bio,
    .home-buttons {
        text-align: center !important;
        width: 100%;
        justify-content: center;
    }
}

/* Home section image container adjustments (kept for compatibility) */
.home-image-container {
    display: flex;
    /* Use flexbox to center the image */
    justify-content: center;
    align-items: center;
    width: 320px;
    /* Increased size */
    height: 320px;
    /* Increased size */
    flex-shrink: 0;
    /* Prevent shrinking */
    margin: 0 auto;
    /* Center horizontally on small screens */
    position: relative;
    /* Ensure it stays in its place */
    z-index: 1;
    /* Ensure it's on top */
}

@media (min-width: 768px) {

    /* Adjust for medium screens and up */
    .home-image-container {
        width: 400px;
        /* Further increased size for larger screens */
        height: 400px;
        margin-right: auto;
        /* Push to the left on larger screens */
        margin-left: 0;
        /* Override auto margin from smaller screens */
    }
}

/* Fix for name typewriter to prevent layout shift */
#name-typewriter {
    min-height: 1.5em;
    display: inline-block;
    vertical-align: top;
}

/* Custom spinning animation for profile picture frame */
@keyframes spin-slow {
    from {
        transform: rotate(90deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.group:hover .group-hover\:animate-spin {
    animation: spin-slow 2s linear infinite;
}

.group:hover .group-hover\:animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

/* Ensure image stays fixed on left side */
#projects .grid,
#certifications .grid {
    grid-auto-rows: 1fr;
    /* Ensures all grid items in the project and certification sections have the same height */
    align-items: stretch;
}

/* Custom class for rounded buttons */
.custom-button-rounded {
    border-radius: 0.5rem;
    /* Equivalent to Tailwind's rounded-lg */
}

/* Aesthetic dark greenish background for sections matching the image */
#home {
    background-color: #1a1a1a;
}

#about {
    background-color: #282828;
}

/* New About Me section background */
#projects {
    background-color: #1a1a1a;
}

#education {
    background-color: #282828;
}

#certifications {
    background-color: #1a1a1a;
}

#contact {
    background-color: #282828;
}

.navbar-link {
    transition: all 0.3s ease;
    position: relative;
    /* Needed for positioning the hover bar */
    overflow: hidden;
    /* Hide the bar when not hovered */
}

.navbar-link:hover {
    transform: translateY(-2px);
    color: #2ECC71;
    /* Emerald green for hover */
}

/* Styling for the hover bar */
.navbar-hover-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    /* Starts hidden */
    height: 3px;
    /* Small height for the bar */
    background-color: #2ECC71;
    /* Green color */
    opacity: 0;
    /* Starts invisible */
    transition: width 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    /* Smooth transition */
}

.navbar-link:hover .navbar-hover-bar {
    width: 100%;
    /* Expands on hover */
    opacity: 1;
    /* Becomes visible on hover */
    box-shadow: 0 0 8px #2ECC71, 0 0 12px rgba(46, 204, 113, 0.5);
    /* Glow effect matching project/education sections */
}

/* Styling for contact cards */
.contact-card {
    background-color: #202020;
    /* Dark background for cards */
    border-radius: 0.75rem;
    /* rounded-xl */
    padding: 1.5rem;
    /* p-6 */
    display: flex;
    align-items: center;
    gap: 1rem;
    /* space-x-4 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* shadow-md */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
    /* Ensure content inside card is left-aligned */
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.contact-card-icon {
    background-color: #2ECC71;
    /* Green circle */
    color: #1a1a1a;
    /* Dark text for icon */
    border-radius: 9999px;
    /* rounded-full */
    width: 3rem;
    /* h-12 w-12 */
    height: 3rem;
    min-width: 3rem;
    /* Ensure icon size is fixed */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    /* text-2xl */
}

.contact-card h3 {
    text-align: left;
    /* Explicitly left-align the heading */
}

.contact-card p {
    text-align: left;
    /* Explicitly left-align the paragraph */
}

/* Scroll-triggered sliding animations */
.slide-in-left {
    opacity: 0;
    transform: translateX(-70px);
    transition: all 0.7s cubic-bezier(.4, 0, .2, 1);
}

.slide-in-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(70px);
    transition: all 0.7s cubic-bezier(.4, 0, .2, 1);
}

.slide-in-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.fade-in {
    opacity: 0;
    transition: opacity 0.7s cubic-bezier(.4, 0, .2, 1);
}

.fade-in.animate {
    opacity: 1;
}

/* Certification Section Styles */
.certification-card {
    background-color: #1f2937;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    /* Changed to space-between for better alignment */
    height: 280px;
    /* Fixed height for consistency */
    max-width: 450px;
    margin: 0 auto;
    transform: scale(1);
    transition: all 0.3s ease;
    border: 1px solid rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
}

.certification-card:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 30px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    /* hover:border-emerald-400/40 */
}

.certification-link {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    gap: 1rem;
    /* Reduced gap */
}

.certification-image-container {
    flex: 1;
    /* Allow container to grow */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    border-radius: 0.5rem;
}

.certification-image {
    width: 100%;
    height: auto;
    /* Changed height to auto to maintain aspect ratio */
    object-fit: cover;
    object-position: center;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.certification-card:hover .certification-image {
    opacity: 0.8;
    filter: blur(1px);
    transform: scale(1.02);
}

.certification-text-container {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60px;
    padding: 0 0.75rem;
}

.certification-title {
    color: #10b981;
    /* text-emerald-400 */
    font-weight: 600;
    /* font-semibold */
    font-size: 1.125rem;
    /* Slightly reduced font size */
    line-height: 1.3;
    text-align: center;
    display: block;
    transition: all 0.3s ease;
}

.certification-card:hover .certification-title {
    text-decoration: underline;
    color: #34d399;
    /* Lighter emerald on hover */
}

/* Responsive adjustments for certification cards */
@media (max-width: 768px) {
    .certification-card {
        height: 300px;
        /* Further reduced for mobile */
        max-width: 100%;
        margin: 0;
        padding: 1rem;
    }

    .certification-image {
        height: 140px;
        /* Reduced mobile image height */
    }

    .certification-title {
        font-size: 1rem;
        /* Smaller font for mobile */
    }

    .certification-text-container {
        min-height: 50px;
        padding: 0 0.5rem;
    }
}

/* Ensure certification section fits in viewport */
#certifications {
    padding: 3rem 1rem;
    /* Reduced section padding */
}

#certifications .max-w-6xl {
    max-width: 1200px;
    /* Ensure container doesn't get too wide */
}

#certifications h2 {
    margin-bottom: 1rem;
    /* Reduced heading margin */
}

#certifications p {
    margin-bottom: 2rem;
    /* Reduced description margin */
}

#scrollToHomeBtn:hover {
    box-shadow: 0 0 10px 4px #34d399, 0 0 6px 2px #23272f;
    filter: brightness(1.03);
    border: 1px solid #10b981;
}

#certifications img:hover {
    opacity: 0.6;
    filter: blur(1px);
}
