:root {
    --terminal-bg: #5a5d7a;
    --text-color: #ffffff;
    --highlight-color: #757fe0;
    --response-color: #e7d184;
    --nav-bg: #f5f9fc;
    --body-bg: #f5f9fc;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&display=swap');

body {
    margin: 0;
    padding: 0;
    background-color: var(--body-bg);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

.nav-links {
    position: absolute;
    top: 1rem;
    left: 65%;
    transform: translateX(-50%);
    padding: 1.5rem 2rem;
    display: flex;
    gap: 7rem;
    background: var(--nav-bg);
    z-index: 1000;
    width: auto;
    justify-content: center;
    box-sizing: border-box;
    right: 0;
    /* Remove the transition that might be causing issues */
    opacity: 1 !important; /* Force opacity to stay at 1 */
}

.nav-links a {
    color: #525f7f;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 35;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--highlight-color);
}

main {
    max-width: 1000px; /* Increased width */
    margin: 0 auto;
    padding: 6rem 1rem 2rem;
}

.hero {
    margin-bottom: 6rem;
    margin-top: 14vh;
}

.main-title {
    font-size: 5rem; /* Increased size */
    color: var(--highlight-color);
    margin: 0 0 0.5rem 0;
    font-weight: 70;
    font-family: 'Roboto Mono', monospace;
    line-height: 1;
}

.subtitle {
    font-size: 1.45rem; /* Increased size */
    margin: 0.5rem 0 1rem 0;
    color: #525f7f;
    line-height: 1.5;
    max-width: 6000px;
    margin-top: 4rem;
    font-family: 'Inter', sans-serif;
    line-height: 2.5;
}

.terminal {
    background-color: var(--terminal-bg);
    border-radius: 25px;
    box-shadow: 0 40px 20px rgba(0, 0, 0, 0.2);
    margin: 2rem 0;
    width: 100%;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem; /* Slightly larger font */
}

.terminal-content {
    padding: 2.5rem; /* Increased padding */
}

.hero p:last-child {
    margin-top: -0.3rem;
    font-size: 1.45rem;
    color: #525f7f;
    font-family: 'Inter', sans-serif;
}


.terminal-header {
    background-color: #dedde0;
    padding: 10px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    align-items: center;
}

.email-link {
    color: #35feff !important; /* Bright blue color */
}

/* LinkedIn link color */
.linkedin-link {
    color: #35feff !important; /* Bright blue color */
}

/* GitHub link color */
.github-link {
    color: #35feff !important; /* Bright blue color */
}

/* Resume link color */
.resume-link {
    color: #35feff !important; /* Bright blue color */
}

/* Make resume clickable with proper styling */
.resume-link:hover {
    text-decoration: underline;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.button {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.red { background-color: #ff5f56; }
.yellow { background-color: #ffbd2e; }
.green { background-color: #27c93f; }

.terminal-content {
    padding: 2rem;
}

.highlight {
    color: var(--highlight-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.highlight:hover {
    text-decoration: underline;
}

.info-section {
    margin-top: 1rem;
}

.info-section p {
    margin: 0.75rem 0;
    font-size: 1rem;
}

.response {
    color: var(--response-color);
    margin-left: 1rem;
    margin-bottom: 1rem;
}

.response a {
    color: var(--response-color);
    text-decoration: none;
}

.response a:hover {
    text-decoration: underline;
}

.recvert {
    color: white;
    animation: blink 1s infinite;
    font-size: 1.5rem; /* Made it a bit bigger */
    margin-left: 0.5rem
}

.vertrec {
    position: relative; /* This is the key property */
    color: var(--highlight-color);
    top: -0.3rem; /* Move it up slightly */
    vertical-align: baseline;
    animation: blink 1s infinite;
    font-size: 5rem; /* Made it a bit bigger */
    margin-left: 0.5rem;
}

/* Updated Projects Section */
.projects-section, .contact-section {
    padding: 4rem 0;
}

.projects-section {
    text-align: center;
}    

.projects-section h2, .contact-section h2 {
    color: #525f7f;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-align: center;
    line-height: 3;
}

.section-underline {
    height: 7px;
    width: 65px;
    background-color: var(--highlight-color);
    margin: 0 auto 3rem;
    border-radius: 2px;
}

.projects-grid {
    display: grid;
    gap: 3rem;
    grid-template-columns: 1fr;
    max-width: 1000px; /* Wider container for cards */
    margin: 6rem auto 0; /* Add top margin to move cards down */
}

.project-card {
    background: white;
    border-radius: 25px; /* More curvy edges */
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: row;
    height: 390px; /* Keep original height */
    width: 100%; /* Use full width of container */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.project-img-container {
    width: 40%;
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    cursor: pointer;
}

.project-img:hover {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
    width: 60%;
    text-align: left;
    display: flex;
    flex-direction: column;
    color: #525f7f;
    
    /* Create a fixed boundary with padding */
    box-sizing: border-box;
    padding: 1.5rem; /* Your existing padding */
    position: relative;
    
    /* Add inner container for content */
    max-height: 100%;
    overflow: hidden;
}

.project-content h3 {
    margin: 0 0 1rem;
    font-size: 1.8rem;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* These will help with very long words */
    hyphens: auto;
}

.project-content p {
    color: #525f7f;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.project-content-inner {
    padding: 4mm; /* Your 3mm buffer on all sides */
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    height: 100%;
}

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

.project-tags span {
    background: white; /* White background */
    color: #525f7f;
    padding: 0.35rem 0.85rem;
    border-radius: 8px; /* Rectangle shape with curvy edges */
    font-size: 0.99rem;
    border: 2px solid #92eac0;
    margin-top: -5px; /* Move up by 5 pixels */
    position: relative; /* Add this for better positioning control */
    top: -5px; /* Bold light green border */
    /* Alternative option if you want even bolder: border: 3px solid #92eac0; */
}

.project-links {
    display: flex;
    justify-content: flex-start;
    margin-top: 1rem;
}

.source-link {
    color: white;
    background-color: #757fe0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s ease, color 0.3s ease;
    border: 1px solid #757fe0;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 0.5rem;
}

.source-link:hover {
    background-color: #6369c3; /* slightly darker shade for hover */
    border-color: #6369c3;
}

/* Modal for project image */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Add these styles to your style.css file */

/* Contact Section Styling */
.contact-section {
    padding: 2rem 0 2rem; /* Reduced padding to move title up */
    text-align: center;
    margin-top: 0.89rem; /* Reduced margin-top to move everything up */
}

.contact-section h2 {
    color: #525f7f;
    font-size: 1.3rem;
    margin-bottom: 0.1rem;
    font-weight: 600;
    text-align: center;
}

/* This uses the same underline style as your projects section */
.contact-section .section-underline {
    height: 7px;
    width: 65px;
    background-color: var(--highlight-color);
    margin: 0 auto 3rem;
    border-radius: 2px;
}

.contact-links-container {
    display: flex;
    justify-content: center;
    margin: 6.89rem 0;
}

.contact-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.contact-links a {
    color: #525f7f;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.contact-links a:hover {
    color: var(--highlight-color);
}

.separator {
    color: var(--highlight-color);
    font-weight: 300;
}

.footer {
    margin-top: 10rem;
    text-align: center;
    padding-bottom: 2rem;
    position: relative;
    bottom: 0;
}

.footer p {
    color: #808797;
    font-size: 0.9rem;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* This pushes the footer toward the bottom but not completely at the bottom */
.contact-section {
    margin-bottom: auto;
}

.certifications-section {
    padding: 2rem 0 2rem;
    text-align: center;
}

.certifications-section h2 {
    color: #525f7f;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-align: center;
    line-height: 3;
}

.certifications-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px; /* Increased max-width for wider content */
    margin: 8rem auto 4.5rem;
    justify-content: center;
}

.certification-card {
    background: white;
    border-radius: 25px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    flex-direction: row;
    width: calc(50% - 1rem); /* Two cards per row as default */
    min-height: 180px; /* Minimum height to ensure consistency */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.certification-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.certification-img-container {
    width: 180px; /* Your existing width */
    height: 180px; /* Your existing height */
    overflow: hidden;
    flex-shrink: 0;
    display: flex; /* Add this */
    align-items: center; /* Add this to center vertically */
    justify-content: center; /* Add this to center horizontally */
}

.certification-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.certification-img:hover {
    transform: scale(1.05);
}

.certification-content {
    padding: 1rem;
    flex: 1; /* Take up remaining space */
    text-align: left;
    display: flex;
    flex-direction: column;
    color: #525f7f;
}

.certification-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #525f7f;
    word-wrap: break-word;
    line-height: 1.3;
}

.certification-info {
    color: #6e7891;
    margin: 0.1rem 0;
    font-size: 0.85rem;
}

.certification-links {
    margin-top: auto;
    padding-top: 0.5rem;
}

.credential-link {
    color: white;
    background-color: #757fe0;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.3s ease, color 0.3s ease;
    border: 1px solid #757fe0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.credential-link:hover {
    background-color: #6369c3;
    border-color: #6369c3;
}

.credential-link i {
    font-size: 0.8rem;
}

[data-aos] {
    pointer-events: none;
}
[data-aos].aos-animate {
    pointer-events: auto;
}

/* Improve animation performance */
.project-card,
.certification-card,
.terminal,
.hero,
.contact-links-container,
.footer {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Add a gentle bobbing animation for key elements on hover */
.project-card:hover,
.certification-card:hover {
    animation: gentle-bob 2s ease infinite;
}

@keyframes gentle-bob {
    0%, 100% {
        transform: translateY(-6px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Add smooth transition for all hover effects */
a, button, .project-card, .certification-card, .source-link, .credential-link {
    transition: all 0.3s ease;
}

/* Improve scroll behavior for all browsers */
html {
    scroll-behavior: smooth;
}

/* Make sure the AOS animations are disabled in prefers-reduced-motion mode */
@media (prefers-reduced-motion: reduce) {
    [data-aos] {
        transition-duration: 0s !important;
        transform: none !important;
        opacity: 1 !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .project-card:hover,
    .certification-card:hover {
        animation: none;
    }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@media (min-width: 1200px) {
    .certification-card {
        width: calc(33.333% - 1.33rem);
    }
}

@media (min-width: 992px) {
    .certification-card {
        width: calc(50% - 1rem);
        max-width: 550px; /* Increased from 450px for wider cards */
    }
}

/* Tablet screens */
@media (max-width: 992px) and (min-width: 769px) {
    .certification-card {
        width: calc(50% - 1rem) !important; /* Force 2 per row on tablet */
    }
    
    .certification-img-container {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 768px) {

    .main-title {
        font-size: 4rem;
        margin-top: -1.4rem;
    }

    .project-card {
        flex-direction: column;
        height: auto;
        max-width: 100%;
    }

    .project-content {
        width: auto; /* Let it adjust to content */
        padding: 1rem; /* Slightly smaller padding on mobile */
    }
    
    .project-content h3 {
        font-size: 1.5rem; /* Slightly smaller heading on mobile */
    }

    .certification-card {
        width: 100% !important; /* Force 1 per row on mobile */
        height: 150px; /* Original setting */
    }
    
    .certification-img-container {
        width: 150px;
        height: 150px;
    }
    
    .certification-content h3 {
        font-size: 1.1rem;
    }
    
    .certification-info {
        font-size: 0.8rem;
    }
    
    .credential-link {
        padding: 0.3rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .project-img-container,
    .project-content {
        width: 100%;
    }
    
    .project-img-container {
        display: none; /* Hide the image container completely */
    }

    .project-img-container {
        height: 200px;
    }
    
    .contact-links {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .separator {
        display: none;
    }

    .project-tags {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .project-tags span {
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
        display: inline-block;
    }

    [data-aos] {
        /* Reduce animation duration for mobile */
        transition-duration: 600ms !important;
        /* Use hardware acceleration for smoother animations */
        transform: translateZ(0);
        will-change: transform, opacity;
        backface-visibility: hidden;
    }
    
    /* Don't disable animations on mobile */
    [data-aos].aos-animate {
        transform: translateZ(0);
        pointer-events: auto;
    }
    
}

@media (max-width: 600px) {
    body {
        overflow-x: hidden; /* Prevent horizontal scrolling */
        width: 100%; /* Ensure body takes exactly 100% width */
        max-width: 100vw; /* Prevent elements from extending beyond viewport */
    }

    main {
        padding: 5rem 1rem 2rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .nav-links {
        gap: 6rem; /* Further reduce gap on smallest screens */
        padding: 1rem 0.5rem;
    }
    
    .nav-links a {
        font-size: 0.95rem; /* Slightly smaller font for menu items */
    }
    
    .main-title {
        font-size: 3.rem; /* Adjust title size for better fit */
        word-break: keep-all;
    }
    
    .subtitle {
        font-size: 1.13rem;
        line-height: 2.5;
    }

    .hero p:last-child {
        font-size: 1.1rem;
    }
    
    .terminal {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .terminal-content {
        padding: 1.5rem; /* Reduce padding in terminal for mobile */
    }
    
    /* Prevent content from extending outside container */
    .projects-grid, 
    .certifications-grid, 
    .contact-section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .projects-section, .contact-section {
        margin-left: 0;
    }
    
    .contact-links {
        flex-direction: column;
        gap: 1.88rem;
        align-items: center; /* This centers the items horizontally */
        width: 100%; /* Ensure full width */
        text-align: center; /* Center the text within each link */
    }
    
    .contact-links a {
        width: 100%; /* Make links take full width */
        text-align: center; /* Center the text within each link */
    }
    
    .separator {
        display: none;
    }
    
    .nav-links {
        position: absolute;
        top: 2rem;
        left: 50%;
        transform: translateX(-50%);
        padding: 1rem 1.5rem;
        width: auto;
        right: auto;
        display: flex;
        justify-content: center;
        gap: 5rem;
        z-index: 1000;
    }

    .hero {
        margin-top: 15vh;
    }

    .certifications-grid {
        gap: 1.5rem;
    }
    
    .certification-card {
        height: auto; /* Adjust height automatically */
        min-height: 120px;
    }
}

@media (max-width: 380px) {

    .main-title {
        font-size: 2.5rem; /* Adjust title size for better fit */
        word-break: keep-all;
    }

    .nav-links {
        gap: 4rem; /* Even smaller gap for very small screens */
    }
    
    .nav-links a {
        font-size: 0.9rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
}