@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4338ca;
    --primary-light: #6366f1;
    --primary-dark: #312e81;
    --blue-bg-dark: #111827;
    --blue-bg-light: #3730a3;
    --text-color: #1f2937;
    --text-grey: #4b5563;
    --text-light-grey: #9ca3af;
    --text-white: #ffffff;
    --bg-light: #f3f4f6;
    --bg-white: #ffffff;
    --font-family: 'Poppins', 'Sarabun', sans-serif;
    --container-width: 1200px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --fb-color: #1877f2;
    --gh-color: #24292e;
    --li-color: #0077b5;
    --line-color: #06c755;
    --map-color: #ea4335;
    --phone-color: #34a853;
    --mail-color: #fbbc05;
    --badge-web: #2563eb;
    --badge-game: #ea580c;
    --badge-cert: #d97706;
    --badge-award: #db2777;
    --badge-desktop: #0d9488;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-white);
    overflow-x: hidden;
    color: var(--text-color);
    line-height: 1.6;
}

.text-center {
    text-align: center;
}

.align-left {
    text-align: left;
}

.section-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-light);
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-transform: uppercase;
    opacity: 0.9;
}

.section-title {
    font-size: 38px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

.section-description {
    font-size: 16px;
    color: var(--text-grey);
    line-height: 1.8;
    margin-bottom: 35px;
    font-weight: 300;
}

.header-desc {
    max-width: 700px;
    margin: 0 auto 60px auto;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    background: transparent;
    transition: all 0.4s ease-in-out;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 0;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-white);
    gap: 12px;
    transition: color 0.3s ease;
}

.header.scrolled .logo {
    color: var(--primary-dark);
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 35px;
}

.nav-link {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.header.scrolled .nav-link {
    color: var(--text-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-light);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--primary-light);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active,
.nav-link:hover {
    color: var(--text-white);
}

.header.scrolled .nav-link.active,
.header.scrolled .nav-link:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-white);
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 8px;
    border-radius: 4px;
}

.hamburger:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.header.scrolled .hamburger {
    color: var(--text-color);
}

.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: radial-gradient(circle at top right, var(--blue-bg-light), var(--blue-bg-dark));
    overflow: hidden;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    z-index: 0;
    opacity: 0.5;
    animation: float 10s infinite ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #4f46e5;
    animation-delay: 0s;
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: #ec4899;
    animation-delay: 5s;
}

.hero-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    gap: 40px;
}

.hero-content {
    flex: 1;
    color: var(--text-white);
}

.greeting-bubble {
    display: inline-block;
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-white);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 16px;
    margin-bottom: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.greeting-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid rgba(255, 255, 255, 0.15);
}

.greeting-bubble::before {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-top: 13px solid rgba(255, 255, 255, 0.25);
}

.wave-emoji {
    display: inline-block;
    font-size: 1.3em;
    animation: wave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(14deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(0deg);
    }
}

.hero-title {
    font-size: 60px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 25px;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-description {
    font-size: 18px;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 40px;
    max-width: 550px;
    color: #e0e7ff;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 50px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 50px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.btn i {
    margin-left: 8px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: var(--text-white);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--text-white);
    transform: translateY(-3px);
}

/* Focus states for accessibility */
.btn:focus,
.nav-link:focus,
.filter-btn:focus,
.social-links a:focus,
.portfolio-links a:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

/* Resume Dropdown */
.resume-dropdown {
    position: relative;
    display: inline-block;
}

.resume-btn i {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.resume-dropdown.active .resume-btn i {
    transform: rotate(180deg);
}

.resume-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    z-index: 100;
    padding: 0;
}

.resume-dropdown.active .resume-dropdown-menu {
    max-height: 200px;
    opacity: 1;
    padding: 8px 0;
}

.resume-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.resume-dropdown-item:last-child {
    border-bottom: none;
}

.resume-dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: var(--text-white);
}

.resume-dropdown-item i {
    font-size: 16px;
    color: var(--primary-color);
    transition: color 0.2s ease;
}

.resume-dropdown-item:hover i {
    color: var(--text-white);
}

.social-links {
    display: flex;
    gap: 25px;
}

.social-links a {
    text-decoration: none;
    color: var(--text-white);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.social-links a i {
    font-size: 18px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 100%;
    position: relative;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    max-height: 85vh;
    z-index: 2;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.3));
    mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
}

.about-section {
    padding: 120px 0;
    background-color: var(--bg-white);
}

.about-container {
    display: flex;
    align-items: center;
    gap: 80px;
}

.about-image-wrapper {
    flex: 1;
    position: relative;
}

.about-image-wrapper::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -15px;
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary-light);
    border-radius: 16px;
    z-index: 0;
    opacity: 0.6;
}

.about-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s;
}

.about-image-wrapper:hover img {
    transform: translate(5px, -5px);
}

.about-content {
    flex: 1;
}

.skills-section {
    padding: 100px 0;
    background-color: #f8fafc;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.skill-card {
    text-align: center;
    padding: 40px 20px;
    transition: all 0.3s ease;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.skill-card:hover {
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.1);
    transform: translateY(-5px);
    border-color: transparent;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-icon {
    margin-bottom: 25px;
    transition: transform 0.3s ease;
}

.skill-card:hover .skill-icon {
    transform: scale(1.1);
}

.skill-icon i {
    font-size: 45px;
    color: inherit;
}

.skill-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-color);
}

.skill-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.skill-list li {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-grey);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.skill-list li:hover {
    border-color: var(--color, var(--primary-color));
    color: var(--color, var(--text-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.skill-list li i {
    font-size: 16px;
    margin-right: 2px;
    color: var(--color, var(--text-grey));
    transition: color 0.2s ease;
}

.skill-list li:hover i {
    color: var(--color, var(--primary-color));
}

.resume-section {
    padding: 100px 0;
    background-color: var(--bg-white);
}

.resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
}

.resume-col-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--primary-dark);
    border-left: 5px solid var(--primary-light);
    padding-left: 15px;
    display: inline-block;
}

.timeline {
    border-left: 2px solid #e5e7eb;
    padding-left: 35px;
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-dot {
    position: absolute;
    left: -43px;
    top: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    transition: all 0.3s;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    background-color: var(--primary-light);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 5px;
}

.timeline-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0;
}

.timeline-cert-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-light);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.timeline-cert-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.timeline-cert-link i {
    font-size: 12px;
}

.timeline-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-date {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 15px;
    background: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    opacity: 0.8;
}

.timeline-content {
    color: var(--text-grey);
    font-size: 15px;
    line-height: 1.7;
    background: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    margin-top: 10px;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.timeline-content ul {
    padding-left: 20px;
    margin-top: 10px;
}

.timeline-item:hover .timeline-content {
    background: #fff;
    box-shadow: var(--shadow-md);
    border-color: #e5e7eb;
}

.portfolio-section {
    padding: 100px 0;
    background-color: var(--bg-light);
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    border: none;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--text-grey);
    transition: all 0.3s ease;
    padding: 10px 24px;
    letter-spacing: 0.5px;
    font-family: var(--font-family);
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover,
.filter-btn.active {
    color: #fff;
    background: var(--primary-color);
    box-shadow: 0 5px 15px rgba(67, 56, 202, 0.3);
    transform: translateY(-2px);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 320px;
    gap: 24px;
    grid-auto-flow: dense;
}

.portfolio-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    grid-column: span 1;
    grid-row: span 1;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.25);
}

.portfolio-item.wide {
    grid-column: span 2;
}

.portfolio-item.tall {
    grid-row: span 2;
}

.portfolio-item.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.portfolio-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.portfolio-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    display: block;
    filter: brightness(0.85);
}

.portfolio-item:hover .portfolio-wrap img {
    transform: scale(1.08);
    filter: brightness(0.5);
}

.portfolio-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 70%, transparent);
    color: #fff;
    opacity: 0;
    transition: all 0.4s ease;
    transform: translateY(20px);
}

.portfolio-item:hover .portfolio-info {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portfolio-info p {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portfolio-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.portfolio-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: #fff;
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.portfolio-links a:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.portfolio-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    color: white;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background-color: var(--primary-color);
}

.badge-web {
    background-color: var(--badge-web);
}

.badge-game {
    background-color: var(--badge-game);
}

.portfolio-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.tech-tag {
    font-size: 10px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #e0e0e0;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.tech-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    color: #fff;
}

.badge-cert {
    background-color: var(--badge-cert);
}

.badge-award {
    background-color: var(--badge-award);
}

.badge-desktop {
    background-color: var(--badge-desktop);
}

.badge-freelance {
    background-color: #0ea5e9;
    /* Sky Blue */
}

.badge-internship {
    background-color: #475569;
    /* Slate - Internship Projects */
}

/* Portfolio No Crop - แสดงรูปเต็มโดยไม่ถูกครอป (สำหรับใบ Certificate) */
.portfolio-item.no-crop .portfolio-wrap img {
    object-fit: contain;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* Footer */
.footer-section {
    padding: 80px 0 30px 0;
    background-color: var(--bg-white);
    border-top: 1px solid #e5e7eb;
    position: relative;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--primary-dark);
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-light);
    border-radius: 2px;
}

/* Fixed margin for the second title in footer */
.connect-title {
    margin-top: 30px;
}

.social-icons-footer {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.social-icons-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: var(--bg-light);
    color: var(--text-grey);
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.social-icons-footer a:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.social-icons-footer a.social-fb:hover {
    background-color: var(--fb-color);
}

.social-icons-footer a.social-gh:hover {
    background-color: var(--gh-color);
}

.social-icons-footer a.social-li:hover {
    background-color: var(--li-color);
}

.footer-links,
.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-links li,
.footer-contact li {
    margin-bottom: 12px;
}

.footer-links li a {
    text-decoration: none;
    color: var(--text-grey);
    font-size: 15px;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links li a:hover {
    color: var(--primary-color);
    padding-left: 8px;
    font-weight: 500;
}

.footer-contact li a {
    transition: color 0.2s ease;
}

.footer-contact li a:hover {
    color: var(--primary-color);
}

.footer-contact li {
    color: var(--text-grey);
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-contact li a,
.footer-contact li span {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.icon-map,
.icon-phone,
.icon-mail,
.icon-line {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    margin-top: 4px;
}

.footer-bottom {
    border-top: 1px solid #e5e7eb;
    padding-top: 30px;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-grey);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 992px) {
    .hamburger {
        display: block;
    }

    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        padding: 25px 25px 35px 25px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        gap: 20px;
        border-top: 1px solid #f1f1f1;
        backdrop-filter: blur(10px);
    }

    .nav-list.active {
        display: flex;
    }

    .nav-link {
        color: var(--text-color);
        opacity: 1;
        justify-content: flex-start;
        padding: 5px 0;
        border-radius: 0;
        display: inline-block;
        width: fit-content;
    }

    .nav-link.active,
    .nav-link:hover {
        color: var(--primary-color);
        background: transparent;
    }

    .nav-link::after {
        display: block;
        bottom: 0;
        background-color: var(--primary-color);
        height: 2px;
    }

    .nav-link.active::after {
        width: 100%;
    }

    .hero {
        height: auto;
        min-height: auto;
        padding-bottom: 80px;
        text-align: center;
    }

    .hero-container {
        flex-direction: column-reverse;
        padding-top: 40px;
        gap: 50px;
    }

    .hero-content {
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .hero-title {
        font-size: 42px;
        margin-bottom: 20px;
    }

    .hero-buttons {
        justify-content: center;
        width: 100%;
    }

    .hero-image {
        width: 100%;
    }

    .about-container {
        flex-direction: column;
        text-align: left;
        gap: 50px;
    }

    .about-image-wrapper {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .resume-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
        text-align: left;
    }

    .about-col {
        grid-column: 1 / -1;
        max-width: 80%;
    }

    .footer-title::after {
        left: 0;
        transform: none;
    }

    .social-icons-footer {
        justify-content: flex-start;
    }

    .footer-contact li {
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 20px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-item.wide,
    .portfolio-item.tall {
        grid-column: span 1;
        grid-row: span 1;
    }

    .hero-title {
        font-size: 32px;
    }

    .btn {
        width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .about-col {
        max-width: 100%;
    }

    .footer-grid {
        gap: 40px 20px;
    }

    .portfolio-item,
    .portfolio-wrap {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .portfolio-wrap img {
        height: 100%;
    }
}

/* Wave Animation */
.wave-emoji {
    display: inline-block;
    animation: wave-animation 2.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave-animation {
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(14deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.lightbox-close:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.lightbox-content {
    max-width: 90%;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-caption {
    text-align: center;
    margin-top: 20px;
    color: #fff;
}

.lightbox-caption h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.lightbox-caption p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.lightbox-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    overflow-x: auto;
    max-width: 90%;
    padding: 10px 0;
}

.lightbox-thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.lightbox-thumbnails img:hover {
    opacity: 0.8;
}

.lightbox-thumbnails img.active {
    opacity: 1;
    border-color: var(--primary-light);
    transform: scale(1.1);
}

/* Lightbox Responsive */
@media (max-width: 768px) {

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 32px;
    }

    .lightbox-thumbnails img {
        width: 50px;
        height: 50px;
    }

    .lightbox-content {
        max-height: 70vh;
    }

    .lightbox-content img {
        max-height: 55vh;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.back-to-top:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

@media (max-width: 576px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}