.resumer {
    background-color: var(--button-bg, #333333);
    color: white;
    font-size: 15px;
    font-weight: 900;
    border: var(--project-border, 1px solid rgba(255, 255, 255, 0.3));
    border-radius: 15px;
    cursor: pointer; 
    margin-top: 40px;
    transition: all 0.5s;
}

.resumer:hover {
    background-color: var(--button-hover-bg, #666666);
    transform: scale(1.05);
}

.sound {
    background-color: transparent;
    font-size: 12px;
    transition: all 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

@keyframes audio-wave {
    0% { height: 20px; transform: translate(0px); background-color: var(--animation-color-1, #333333); }
    25% { height: 65px; transform: translateY(-5px); background-color: var(--animation-color-2, #666666); }
    50% { height: 20px; transform: translateY(0px); background-color: var(--animation-color-3, #999999); }
    100% { height: 0px; transform: translateY(0px); background-color: var(--animation-color-4, #cccccc); }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--cursor-color, white); }
}

.dive {
    display: inline; /* Changed from inline-block to inline */
    overflow: hidden;
    white-space: normal; /* Allow wrapping */
    border-right: 0.15em solid var(--cursor-color, white); /* Cursor */
    animation: typing 4s steps(40, end), blink-caret 0.75s step-end infinite;
    font-size: 1em; font-family: "Prompt", sans-serif; font-weight: 900;
}

.cursor {
    border-right: none; 
}

.rocket-animate {
    display: inline-block;
    animation: rocket-animation 2s infinite;
    cursor: pointer;
    transition: transform 1s ease-in-out, opacity 1s ease-in-out;
}

.rocket-animate:hover {
    transform: scale(1.2);
}

.rocket-animate.move {
    transform: translateY(-100px) scale(0.5);
    opacity: 0;
}

@keyframes rocket-animation {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

.lightning-animate {
    display: inline-block;
    animation: lightning-animation 1.5s infinite;
}

@keyframes lightning-animation {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    10% {
        opacity: 0.9;
        transform: scale(1.3) rotate(8deg);
    }
    20% {
        opacity: 1;
        transform: scale(1) rotate(-5deg);
    }
    30% {
        opacity: 0.8;
        transform: scale(1.2) rotate(3deg);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.sound-wave {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 6rem;
    width: 9rem;
    gap: 0.5rem;
}

.sound-wave div {
    width: 1rem;
    height: 6rem;
    background-color: var(--animation-color-1, white);
    animation: audio-wave 2.2s infinite ease-in-out;
    display: block;
    border-radius: 0.5rem;
}

.sound-wave div:nth-child(2) {
    animation-delay: 0.2s;
    left: 11px;
}

.sound-wave div:nth-child(3) {
    animation-delay: 0.4s;
    left: 22px;
}

.sound-wave div:nth-child(4) {
    animation-delay: 0.6s;
    left: 33px;
}

.sound-wave div:nth-child(5) {
    animation-delay: 0.8s;
    left: 44px;
}

.sound-wave:hover div {
    animation-play-state: initial;
}

.project-grid {
    display: flex;
    overflow-x: hidden;
    gap: 40px;
    padding: 20px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

.project-grid::-webkit-scrollbar {
    display: none;
}

.project-grid .project {
    flex: 0 0 85%; /* Slightly more longer width */
    height: 420px; /* Reduced from 78vh */
    border-radius: 10px;
    padding: 30px; /* Added padding */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease, box-shadow 0.5s ease; 
    display: flex; 
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
    background-color: rgba(255, 255, 255, 0.05);
}

.project-grid .project:nth-child(1),
.project-grid .project:nth-child(2),
.project-grid .project:nth-child(3),
.project-grid .project:nth-child(4),
.project-grid .project:nth-child(5) {
    background-image: none;
}

.project-grid .project:hover {
    box-shadow: 0 8px 16px var(--project-shadow, #666666); /* Deeper box-shadow on hover */
}

.project-grid .project:not(:focus) {
    transform: scale(0.95);
}

.project-grid .project:focus {
    transform: scale(1.1);
}

.project h3 {
    font-family: 'Georgia', serif;
    font-size: 22px;
    margin-bottom: 10px;
}

.project p {
    font-family: 'Verdana', sans-serif;
    margin-bottom: 10px;
}

.project a {
    color: var(--text-color, #333);
    text-decoration: none;
    font-family: 'Verdana', sans-serif;
}

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

.project-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    width: 100%;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.project-buttons button {
    font-family: 'Poppins', sans-serif;
    border: 2px solid transparent;
    background: linear-gradient(90deg, transparent 50%, var(--button-bg, #333333) 50%);
    background-size: 200% 100%;
    color: var(--text-color, #ffffff);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: visible;  /* Changed from hidden to visible */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    /* box-shadow: 0 2px 4px rgba(255, 142, 58, 0.1); */
}

.project-buttons button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, var(--button-bg, #333333), var(--button-hover-bg, #666666));
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.project-buttons button:hover {
    color: var(--text-color, #ffffff);
    transform: translateY(-3px) scale(1.02);
    background-position: -100% 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.5);
}

.project-buttons button:hover::before {
    opacity: 1;
}

.project-buttons button:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .project-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .project-buttons button {
        width: 100%;
        padding: 10px 20px;
        font-size: 12px;
    }
}

.project-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.project-indicators .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--dot-color, #ccc);
    transition: background-color 0.3s;
}

.project-indicators .dot.active {
    background-color: var(--dot-active-color, #333);
}

.project-navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.project-navigation .prev-button,
.project-navigation .next-button {
    padding: 10px 20px; /* Adjusted padding */
    background-color: var(--button-bg, #333);
    color: var(--text-color, #fff);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center; /* Center text */
}

.project-navigation .prev-button:hover,
.project-navigation .next-button:hover {
    background-color: var(--button-hover-bg, #666);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px; /* Reduced margin-top */
    justify-content: center; /* Center the buttons */
}

@media (max-width: 768px) {
    .project-grid .project {
        flex: 0 0 100%; /* Full width on small screens */
        height: auto; /* Adjust height */
    }

    .project h3 {
        font-size: 18px; /* Smaller font size */
    }

    .project p {
        font-size: 14px; /* Smaller font size */
    }

    .project-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .project-buttons button {
        width: 100%;
        padding: 10px 20px;
        font-size: 12px;
    }
}

.skillbox {
    display: flex;
    flex-wrap: wrap;  /* Allow wrapping on smaller screens */
    justify-content: center;
    gap: 20px;
    padding: 20px;
    margin: 0 auto;
    max-width: 1200px;
}

@keyframes wave-animation {
    0% {
        background: linear-gradient(45deg, 
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.1) 25%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.1) 75%,
            rgba(255, 255, 255, 0.05) 100%
        );
        background-size: 400% 400%;
        background-position: 0% 50%;
    }
    50% {
        background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%,
            rgba(255, 255, 255, 0.1) 100%
        );
        background-size: 400% 400%;
        background-position: 100% 50%;
    }
    100% {
        background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.1) 25%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.1) 75%,
            rgba(255, 255, 255, 0.05) 100%
        );
        background-size: 400% 400%;
        background-position: 0% 50%;
    }
}

.skill {
    flex: 0 0 120px;  /* Fixed width for consistency */
    min-width: auto;  /* Remove min-width constraint */
    max-width: none;  /* Remove max-width constraint */
    padding: 15px 10px;  /* Adjust padding */
    margin-bottom: 50px;  /* Increased margin to prevent tooltip overlap */
    position: relative;
    z-index: 1;
}

.skill:hover {
    transform: translateY(-5px);
}

.skill img {
    width: 3em;
    height: 3em;
    object-fit: contain;
    margin-bottom: 10px;
}

.skill p {
    margin: 0;
    font-weight: bold;
    color: var(--text-color, #ffffff);
}

.button.primary {
    position: relative;
    overflow: visible;  /* Changed from hidden to visible */
}

.button.primary .icon-up,
.button.primary .icon-rocket {
    margin-right: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    vertical-align: middle;
}

.button.primary .icon-up {
    color: var(--text-color, white);  /* Changed from orange to white */
}

.button.primary .icon-rocket {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%) translateY(20px);
    opacity: 0;
    color: var(--button-hover-bg, #666);  /* Keeping the rocket gray */
}

.button.primary:hover .icon-up {
    opacity: 0;
    transform: translateY(-20px);
}

.button.primary:hover .icon-rocket {
    opacity: 1;
    transform: translateY(-50%);  /* Keep it vertically centered */
}

.spotlight .image {
    border-radius: 50%;
    overflow: hidden;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    transition: all 0.3s ease;
    border: 2px solid transparent; /* Prepare for glowing border */
    margin-left: 2em;  /* Add space between image and text */
}

.spotlight .image:hover {
    transform: scale(1.05); /* Smaller scale for subtle pop */
    box-shadow: 0 0 20px var(--project-shadow, #666); /* Match your site's glow color */
    border-color: var(--project-shadow, #666); /* Glowing border color */
}

.spotlight .image img {
    border-radius: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: 300px;
    transition: transform 0.3s ease;
}

/* Remove the img transform since we're handling it in the container */
.spotlight .image:hover img {
    transform: none;
}

.spotlight .content {
    padding-right: 2em;  /* Add padding on the right side of the text */
}

.spotlight .content p {
    text-align: justify;
    line-height: 1.6;
    hyphens: auto;
    margin-top: 1.5em;  /* Add space above the paragraph */
}

.skill-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: -50px;  /* Increased distance from icon */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(45, 45, 45, 0.95);
    color: var(--text-color, white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75em;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    box-shadow: 0 0 10px rgba(156, 115, 248, 0.3);
    pointer-events: none;
    border: 1px solid rgba(237, 80, 158, 0.3);
    width: max-content;
    max-width: 250px;  /* Increased max-width */
    white-space: normal;  /* Allow text wrapping */
    text-align: center;
    line-height: 1.4;  /* Improve readability */
}

.skill-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent rgba(45, 45, 45, 0.95) transparent;  /* Match new background */
}

.skill:hover .skill-tooltip {
    visibility: visible;
    opacity: 1;
    transition-delay: 0.5s;
}

@keyframes gradient-line {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.major h2::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    margin-top: 10px;
    background: linear-gradient(90deg, 
        var(--button-bg, #333333), 
        var(--button-hover-bg, #666666), 
        var(--animation-color-3, #999999), 
        var(--animation-color-4, #cccccc), 
        var(--button-bg, #333333)
    );
    background-size: 200% 100%;
    animation: gradient-line 3s ease infinite;
}

/* Contact Section Layout */
.contact-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    padding: 2em;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-form {
    max-width: 800px;  /* Increased width */
    margin: 2em auto;
    padding: 30px 40px;  /* Increased padding */
    background: rgba(45, 45, 45, 0.3);
    border-radius: 6px;  /* Reduced border radius for more rectangular look */
    backdrop-filter: blur(5px);
    border: 1px solid rgba(237, 80, 158, 0.2);
}

.form-group {
    margin-bottom: 1.2em;  /* Slightly reduced margin */
}

.contact-form input,
.contact-form select {
    height: 45px;  /* Set consistent height for inputs */
}

.contact-form textarea {
    min-height: 120px;  /* Adjusted height */
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid rgba(156, 115, 248, 0.3);
    border-radius: 4px;  /* Reduced border radius */
    background: rgba(45, 45, 45, 0.7);
    color: var(--text-color, white);
    font-family: inherit;
    transition: all 0.3s ease;
}

.submit-btn {
    position: relative;
    height: 45px;
    margin-top: 10px;
    background: linear-gradient(90deg, var(--button-bg, #333333), var(--button-hover-bg, #666666));
    color: var(--text-color, white);
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(90deg, var(--button-hover-bg, #666666), var(--animation-color-3, #999999));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Placeholder styling */
.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Animation for form elements */
.form-group {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

/* Responsive adjustments for different screen sizes */
@media screen and (max-width: 1200px) {
    .skillbox {
        padding: 15px;
        gap: 15px;
    }
    
    .skill {
        flex: 0 0 110px;
    }
}

@media screen and (max-width: 768px) {
    .skillbox {
        padding: 10px;
        gap: 10px;
    }
    
    .skill {
        flex: 0 0 100px;
    }

    .skill img {
        width: 2.5em;  /* Slightly smaller icons on mobile */
        height: 2.5em;
    }

    .skill-tooltip {
        font-size: 0.7em;
        padding: 6px 10px;
        bottom: -45px;
        max-width: 200px;  /* Slightly smaller on mobile */
    }
    
    .skill {
        margin-bottom: 45px;
    }

    /* Improve contact form on mobile */
    .contact-form {
        padding: 20px;
        margin: 1em auto;
    }

    .form-group {
        margin-bottom: 1em;
    }

    /* Adjust spotlight section for mobile */
    .spotlight {
        flex-direction: column-reverse;  /* Stack image above text on mobile */
        text-align: center;
    }

    .spotlight .image {
        margin: 2em auto;  /* Center image */
        width: 250px;  /* Slightly smaller on mobile */
        height: 250px;
    }

    .spotlight .content {
        padding-right: 0;  /* Remove padding on mobile */
    }
}

@media screen and (max-width: 480px) {
    .skillbox {
        gap: 8px;
    }
    
    .skill {
        flex: 0 0 90px;  /* Even smaller on very small screens */
        padding: 10px 8px;
    }

    .skill img {
        width: 2em;
        height: 2em;
    }

    .skill p {
        font-size: 0.9em;
    }

    /* Adjust project cards for mobile */
    .project-grid .project {
        padding: 15px;
        height: 70vh;
    }

    .project h3 {
        font-size: 1.2em;
    }

    /* Improve button layout on mobile */
    .project-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .project-buttons button {
        width: 100%;
    }

    .skill-tooltip {
        font-size: 0.65em;
        padding: 5px 8px;
        bottom: -40px;
        max-width: 180px;
    }
    
    .skill {
        margin-bottom: 40px;
    }
}

/* Improve navigation on mobile */
@media screen and (max-width: 768px) {
    #nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    #nav ul li {
        margin: 5px;
    }
}

/* Optimize header for mobile */
@media screen and (max-width: 480px) {
    .hims {
        font-size: 1.5em;  /* Smaller heading on mobile */
    }

    .button-group {
        flex-direction: column;
        align-items: center;
    }

    .resumer {
        width: 80%;  /* Wider buttons on mobile */
        margin: 5px 0;
    }
}

/* Improve form inputs on mobile */
@media screen and (max-width: 768px) {
    .contact-form input,
    .contact-form select,
    .contact-form textarea {
        font-size: 16px;  /* Prevent zoom on mobile */
        padding: 8px 12px;
    }

    .submit-btn {
        width: 100%;
        height: 40px;
    }
}

.contact-form select {
    height: 45px;
    width: 100%;
    padding: 10px 15px;
    border: 1px solid rgba(156, 115, 248, 0.3);
    border-radius: 4px;
    background: rgba(45, 45, 45, 0.7);
    color: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 0.9em;  /* Reduced font size */
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5em;
}

.contact-form select option {
    background: rgba(45, 45, 45, 0.9);
    color: var(--text-color, white);
    padding: 10px;
    font-size: 0.9em;  /* Match the select font size */
}

/* Ensure placeholder matches the new size */
.contact-form select option[value=""][disabled] {
    font-size: 0.9em;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .contact-form select {
        font-size: 16px;  /* Prevent zoom on mobile */
    }
}
