/* Theme variables */
:root {
    /* Default dark theme */
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: rgba(31, 41, 55, 0.5);
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --border-color: rgba(75, 85, 99, 0.6);
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: rgba(243, 244, 246, 0.7);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --border-color: rgba(209, 213, 219, 0.6);
}

/* Apply theme variables */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-menu {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

#nav-menu button,
#nav-menu .border-t,
#nav-menu .border-b {
    border-color: var(--border-color) !important;
}

#nav-arrow,
#nav-toggle {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

@keyframes bounce-letter {

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

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

.animate-bounce-letter {
    animation: bounce-letter 1.2s infinite;
}

@keyframes spin-slow {
    100% {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 2.5s linear infinite;
}

@keyframes pulse-particle {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.4);
    }
}

.animate-pulse-particle {
    animation: pulse-particle 1.8s infinite;
}

/* Active link indicator */
.nav-link.active {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.05) 100%);
    color: #f97316;
    border-left: 3px solid #f97316;
}

/* Hero Section Animations */
@keyframes hero-bg {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.05);
    }
}

@keyframes hero-bg2 {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(20px) scale(1.08);
    }
}

@keyframes hero-title {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hero-name {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

@keyframes hero-fadein {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hero-float {
    0%,
    100% {
        transform: translateY(0);
    }

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

.animate-hero-bg {
    animation: hero-bg 7s ease-in-out infinite alternate;
}

.animate-hero-bg2 {
    animation: hero-bg2 9s ease-in-out infinite alternate;
}

.animate-hero-title {
    animation: hero-title 0.9s cubic-bezier(.4, 0, .2, 1) 0.1s both;
}

.animate-hero-fadein {
    animation: hero-fadein 1s cubic-bezier(.4, 0, .2, 1) both;
}

.animate-hero-float {
    animation: hero-float 3.5s ease-in-out infinite;
}

/* Hero Section Dot Animations */
@keyframes hero-dot1 {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-18px) scale(1.2);
    }
}

@keyframes hero-dot2 {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(12px) scale(1.1);
    }
}

@keyframes hero-dot3 {
    0%,
    100% {
        transform: translateX(0) scale(1);
    }

    50% {
        transform: translateX(-18px) scale(1.15);
    }
}

@keyframes hero-dot4 {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.08);
    }
}

@keyframes hero-dot5 {
    0%,
    100% {
        transform: translateX(0) scale(1);
    }

    50% {
        transform: translateX(14px) scale(1.12);
    }
}

.animate-dot1 {
    animation: hero-dot1 2.8s ease-in-out infinite;
}

.animate-dot2 {
    animation: hero-dot2 3.2s ease-in-out infinite;
}

.animate-dot3 {
    animation: hero-dot3 2.5s ease-in-out infinite;
}

.animate-dot4 {
    animation: hero-dot4 3.5s ease-in-out infinite;
}

.animate-dot5 {
    animation: hero-dot5 2.9s ease-in-out infinite;
}

/* Mobile nav menu */
@media (max-width: 768px) {
    .nav-menu {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 80% !important;
        max-width: 280px;
    }

    .nav-menu.open {
        transform: translateX(0);
    }

    /* Ensure the toggle button is always visible */
    #nav-toggle {
        z-index: 9999;
    }

    /* Hero Section Responsive Tweaks */
    .hero-text {
        padding-bottom: 0;
    }
    .hero .w-44, .hero .h-44 {
        width: 11rem !important;
        height: 11rem !important;
    }
    .hero .w-60, .hero .h-60 {
        width: 15rem !important;
        height: 15rem !important;
    }
    .hero .w-40, .hero .h-40 {
        width: 9rem !important;
        height: 9rem !important;
    }
    .hero .w-56, .hero .h-56 {
        width: 13rem !important;
        height: 13rem !important;
    }
}

@media (max-width: 400px) {
    .hero-text h1 {
        font-size: 1.2rem !important;
    }
    .hero .w-44, .hero .h-44 {
        width: 7rem !important;
        height: 7rem !important;
    }
    .hero .w-40, .hero .h-40 {
        width: 5.5rem !important;
        height: 5.5rem !important;
    }
}

/* Navbar toggle styles */
.nav-menu {
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
    transform: translateX(0);
    /* Start visible */
    overflow-y: auto;
}

.nav-menu.collapsed {
    transform: translateX(-100%);
    /* Hide with transform instead of width */
    overflow: hidden;
}

#nav-arrow {
    transition: all 0.3s ease-in-out;
    z-index: 60;
}

/* Ensure hero section is always full screen height */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* Section spacing for better separation */
section {
    margin-bottom: 0;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 640px) {
    section {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
}
@media (min-width: 768px) {
    section {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

/* Remove bottom margin for last section */
section:last-of-type {
    margin-bottom: 0;
}

/* Section Title Utility */
.section-title {
    margin-bottom: 3rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    letter-spacing: -0.01em;
    line-height: 1.1;
}
@media (max-width: 640px) {
    .section-title {
        font-size: 2rem !important;
        margin-bottom: 1.5rem !important;
        margin-top: 0.5rem !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
}

/* About Section Skill Pills */
.about-skill {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    background: linear-gradient(90deg, #fff7ed 60%, #ffedd5 100%);
    color: #ea580c;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 9999px;
    padding: 0.35em 1em;
    margin: 0.2em;
    box-shadow: 0 1px 6px 0 rgba(251,146,60,0.07);
    transition: background 0.2s, color 0.2s;
}
[data-theme="dark"] .about-skill {
    background: linear-gradient(90deg, #1e293b 60%, #334155 100%);
    color: #fdba74;
    box-shadow: 0 1px 6px 0 rgba(251,146,60,0.09);
}
.about-skill i {
    font-size: 1em;
    opacity: 0.8;
}

/* AboutBox improvements */
.about-section .aboutBox {
    background-color: #fff;
    color: #22223b;
    border-radius: 1.25rem;
    box-shadow: 0 4px 32px 0 rgba(251,146,60,0.06);
    border: 1px solid #ffedd5;
    transition: background-color 0.3s, color 0.3s, border 0.3s;
    box-sizing: border-box;
}
[data-theme="dark"] .about-section .aboutBox {
    background-color: #23272f;
    color: #f3f4f6;
    border: 1px solid #334155;
}

/* About, Github, Contact Section Background Fix for Light Theme */
.about-section,
#contact {
    background-color: #fff !important;
    transition: background-color 0.3s;
}
[data-theme="dark"] .about-section,
[data-theme="dark"] #contact {
    background-color: #1a202c !important;
}

.project-card {
    background-color: #fff;
    border: 1px solid #ffedd5;
    box-shadow: 0 4px 24px 0 rgba(251,146,60,0.06);
    transition: background 0.3s, border 0.3s, box-shadow 0.3s;
}
[data-theme="dark"] .project-card {
    background-color: #23272f;
    border: 1px solid #334155;
}
@media (max-width: 1024px) {
    .projects-section .project-card {
        padding: 1.2rem !important;
    }
}
@media (max-width: 640px) {
    .projects-section .project-card {
        padding: 1rem !important;
    }
    .section-title {
        font-size: 2rem !important;
        margin-bottom: 1.5rem !important;
        margin-top: 0.5rem !important;
    }
}

/* Feedback Section Card and Responsive Fix */
.feedback-section, .license {
    background-color: #fff !important;
    transition: background-color 0.3s;
}
[data-theme="light"] .feedback-section,
[data-theme="light"] .license {
    background-color: #fff !important;
}
[data-theme="dark"] .feedback-section,
[data-theme="dark"] .license {
    background-color: #1a202c !important;
}
.feedback-card {
    background-color: #fff;
    border: 1px solid #ffedd5;
    box-shadow: 0 4px 24px 0 rgba(251,146,60,0.06);
    transition: background 0.3s, border 0.3s, box-shadow 0.3s;
}
[data-theme="dark"] .feedback-card {
    background-color: #23272f;
    border: 1px solid #334155;
}
@media (max-width: 1024px) {
    .feedback-section .feedback-card {
        padding: 1.2rem !important;
    }
}
@media (max-width: 640px) {
    .feedback-section .feedback-card {
        padding: 1rem !important;
    }
}

/* Responsive tweaks for About section */
@media (max-width: 1024px) {
    .about-section .aboutBox {
        padding: 1.5rem !important;
    }
}
@media (max-width: 640px) {
    .about-section .aboutBox {
        padding: 1rem !important;
    }
    .about-section h2 {
        font-size: 2rem !important;
    }
    .about-section .stat-number {
        font-size: 1.5rem !important;
    }
    .about-section .skills {
        gap: 0.25rem !important;
    }
    .about-skill {
        font-size: 0.95rem;
        padding: 0.25em 0.7em;
    }
}