/* Author: kimdevhere */
/* Version: 4.0 - Mobile First Refactor */

/* ========== CSS VARIABLES ========== */



:root {
    --primary: #8b5cf6;
    --secondary: #f472b6;
    --accent: #60a5fa;
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --t/* === Responsive Layout Adjustments --- */
@media (max-width: 1023px) {
 
  /* General layout */
  .container {
    width: 100%;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Section spacing */
  section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  section:first-of-type {
    padding-top: 2rem;
  }

  /* Typography */
  h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    line-height: 1.1;
  }

  h2 {
    font-size: clamp(1.5rem, 6vw, 2.25rem);
    line-height: 1.2;
  }

  p {
    font-size: 1rem;
    line-height: 1.6;
  }

  /* Grid layouts */
  .grid {
    gap: 1.5rem;
  }

  /* Card styles */
  .card, .project-item, .service-card {
    padding: 1.25rem;
    border-radius: 1rem;
  }

  /* Hide desktop-only elements */
  .hero-canvas-container,
  .desktop-only {
    display: none;
  }

  /* Button adjustments */
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
  }

  /* Form elements */
  input, textarea, select {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
}on-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1023px) {
  body {
        padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0em));
    }
  }
/* ========== BASE STYLES ========== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 4rem;
    height: -webkit-fill-available;
    overflow-x: hidden;
}

body {
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    
}

@supports (-webkit-touch-callout: none) {
    body {
        /* Fix for iOS Safari viewport height */
        min-height: -webkit-fill-available;
    }
}

/* Improved touch interactions */
@media (hover: none) {
    a:active,
    button:active,
    .tab-item:active {
        transform: scale(0.96);
        transition: transform 0.2s;
    }
}
body {
    font-family: 'Exo 2','Noto Sans JP', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== HERO SECTION ANIMATION ========== */
.hero-content h1 {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 3s ease infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========== CUSTOM COMPONENT STYLES ========== */

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.25);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

@media (hover: hover) {
    .btn-primary:hover {
        background: #7c3aed;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px 0 rgba(139, 92, 246, 0.35);
    }
    
    .btn-secondary:hover {
        background: var(--primary);
        color: white;
        transform: translateY(-2px);
    }
}


/* Project Item Styles */
.project-item {
    background: white;
    border-radius: 1rem;
    /* overflow: hidden; */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all var(--transition);
    border: 2px solid transparent;
    width: 100%;
    /* height: 100%; */
    display: flex;
    flex-direction: column;
}

.project-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.75rem 0.75rem 0 0;
}

.project-item .content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dark .project-item {
    background: #1e293b;
}

@media (hover: hover) {
    .project-item:hover {
        transform: translateY(-12px) scale(1.02);
        border-color: var(--primary);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    }

    .project-item:hover img {
        transform: scale(1.1);
    }
}


.project-item img {
    transition: transform var(--transition-slow);
}

/* Filter Button Styles */
.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.dark .filter-btn {
    border-color: #475569;
    color: #94a3b8;
}

@media (hover: hover) {
    .filter-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Skill Item Styles */
#skills{
  
}
.skill{
  display: none;
}
.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
}


@media (hover: hover) {
    .skill-item:hover {
        transform: translateY(-5px);
    }
}

.service-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: all var(--transition);
    height: auto;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 767px) {
    .service-card {
        min-height: unset;
        margin-bottom: 1.25rem;
    }
    
    #services .grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.25rem;
    }
}

.service-card-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.service-card p {
    color: #64748b;
    line-height: 1.6;
}

.dark .service-card {
    background: #1e293b;
    border-color: #475569;
}

.dark .service-card p {
    color: #94a3b8;
}

@media (hover: hover) {
    .service-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    }
}

/* ========== SPOTLIGHT EFFECT (Desktop) ========== */
#spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.15) 0%, rgba(167, 139, 250, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transition: transform 0.1s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}
.dark #spotlight {
    background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, rgba(124, 58, 237, 0) 70%);
}

/* ========== MODERN MOBILE UI STYLES ========== */

/* --- Language Switcher Styles --- */
.lang-switcher {
    position: relative;
    width: 100%;
}

.lang-switcher-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #64748b;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dark .lang-switcher-button {
    border-color: #475569;
    color: #94a3b8;
}

.lang-switcher-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.dark .lang-switcher-button:hover {
    background: #1e293b;
    border-color: #64748b;
}

.lang-switcher-dropdown {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    opacity: 1;
    transform-origin: bottom;
    transition: all 0.2s ease;
}

.dark .lang-switcher-dropdown {
    background: #1e293b;
    border-color: #475569;
}

.lang-switcher-dropdown.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.lang-switcher-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: #64748b;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.dark .lang-switcher-option {
    color: #94a3b8;
}

.lang-switcher-option:hover {
    background: #f8fafc;
    color: #1e293b;
}

.dark .lang-switcher-option:hover {
    background: #334155;
    color: #f8fafc;
}

/* --- Mobile Navigation Links --- */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #64748b;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.dark .nav-link {
    color: #94a3b8;
}

.nav-link:active {
    background: #f1f5f9;
    color: var(--primary);
}

.dark .nav-link:active {
    background: #1e293b;
    color: #a78bfa;
}

/* --- Mobile Header --- */
#mobile-header {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 4rem;
    /* display: flex; */
    align-items: center;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* --- Mobile Navigation Menu --- */
#mobile-nav-menu {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: stretch;
    transition: all 0.3s ease-in-out;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 1rem));
}

.mobile-nav-content {
    height: 100%;
    overflow-y: auto;
    padding-bottom: 5rem;
    -webkit-overflow-scrolling: touch;
}

#mobile-nav-menu.active {
    opacity: 1;
    pointer-events: auto;
}

#mobile-nav-menu.active > div {
    transform: translateX(0);
}
#mobile-nav-menu #skills{
  display: none;
}

/* --- Mobile Tabbar (Navigation) --- */
#mobile-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.dark #mobile-tabbar {
    background: rgba(15, 23, 42, 0.95);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 1rem);
}

.tab-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.25rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.375rem;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dark .tab-item {
    color: #94a3b8;
}

.tab-item svg {
    transition: transform 0.2s ease;
}

.tab-item.active {
    color: var(--primary);
}

.dark .tab-item.active {
    color: #a78bfa;
}

.tab-item.active svg {
    transform: scale(1.1);
    color: var(--primary);
}

.dark .tab-item.active svg {
    color: #a78bfa;
}

.dark #mobile-tabbar {
    background: rgba(15, 23, 42, 0.95);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b; /* slate-500 */
    text-decoration: none;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    height: 4rem; /* Chiều cao cố định */
}

.dark .tab-item {
    color: #94a3b8; /* slate-400 */
}

.tab-item svg {
    width: 1.5rem;
    height: 1.5rem;
    margin-bottom: 2px;
}

.tab-item.active {
    color: var(--primary);
    transform: translateY(-3px);
}

.dark .tab-item.active {
    color: var(--primary-light);
}


/* --- Mobile Grid Layouts --- */
@media (max-width: 767px) {
  #project-grid,
  #services .container > .grid {
    display: block;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.25rem;
    padding: 1.25rem;
  }

  #services {
    padding: 2rem 0;
  }

  #services .service-card {
    margin: 0;
    height: auto;
    min-height: unset;
  }

  #services .grid {
    margin: -1.25rem;
    width: calc(100% + 2.5rem);
  }

  .mobile-snap {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 85%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding: 1rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .mobile-snap::-webkit-scrollbar { 
    display: none; 
  }

  .mobile-snap > * {
    scroll-snap-align: start;
    width: 100%;
  }

  /* Project filters mobile layout */
  #project-filters {
    display: flex;
    overflow-x: auto;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    margin: 0 -1rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  #project-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    scroll-snap-align: start;
  }
}

/* --- Responsive Layout Adjustments --- */
@media (max-width: 1023px) {
  .hero-canvas-container {
    display: none;
  }
  
  #main-content {
    margin-left: 0;
    padding-top: 4rem;
  }

  .container {
    max-width: 100%;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

@media (max-width: 767px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .hero-content h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
    line-height: 1.2;
  }
  
  .hero-content p {
    font-size: 1rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }
  
  .skill-item {
    padding: 1rem;
  }
  
  .skill-item svg {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .project-item {
    margin-bottom: 1.5rem;
  }
  
  .service-card {
    padding: 1.5rem;
  }
  
  .about-image-column {
    order: -1;
    margin-bottom: 2rem;
  }
  
  .contact-form {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .skill-item svg {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  #services .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1rem;
  }

  .service-card {
    padding: 1.25rem;
    margin: 0;
    height: auto;
  }
  
  section {
    padding: 3rem 0;
  }
  
  #project-grid {
    height: 38em;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0.5rem;
  }
}



.chibi-bg {
    fill: url(#chibi-bg-gradient-light);
    transition: fill var(--transition);
}
.dark .chibi-bg {
    fill: url(#chibi-bg-gradient-dark);
}

/* ========== SCROLLBAR STYLING (Desktop) ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.5); }
.dark ::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.2); }
.dark ::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.4); }

/* === VOUCHER PAGE STYLES === */
.affiliate-banner {
  background-color: rgba(238, 242, 255, 0.8); /* indigo-50/80 */
  border: 1px solid #c7d2fe; /* indigo-200 */
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.dark .affiliate-banner {
  background-color: rgba(30, 41, 59, 0.7); /* slate-800/70 */
  border-color: #334155; /* slate-700 */
}
.affiliate-banner svg {
  color: #6366f1; /* indigo-500 */
}
.dark .affiliate-banner svg {
  color: #a5b4fc; /* indigo-300 */
}

.how-to-use {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  text-align: center;
}
.dark .how-to-use {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(51, 65, 85, 0.8);
}
.how-to-use h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.how-to-use .steps {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 1.5rem;
}
.how-to-use .steps > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.how-to-use .steps svg {
  width: 2.5rem;
  height: 2.5rem;
  color: #8b5cf6; /* violet-500 */
  background: rgba(139, 92, 246, 0.1);
  padding: 0.5rem;
  border-radius: 50%;
}
.dark .how-to-use .steps svg {
  color: #c4b5fd; /* violet-300 */
  background: rgba(139, 92, 246, 0.2);
}
.how-to-use .steps span {
  font-size: 0.875rem;
  color: #475569; /* slate-600 */
}
.dark .how-to-use .steps span {
  color: #cbd5e1; /* slate-300 */
}
@media (max-width: 767px) {
  .how-to-use .steps {
      flex-direction: column;
      align-items: center;
  }
}


.voucher-card {
  position: relative;
  background-color: #ffffff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e2e8f0;
}

.dark .voucher-card {
  background-color: #1e293b; /* slate-800 */
  border-color: #334155; /* slate-700 */
}

/* Slash background effect */
.voucher-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
      transparent,
      rgba(167, 139, 250, 0.2), /* a78bfa */
      transparent 30%
  );
  animation: rotate 4s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.voucher-card:hover::before {
  opacity: 1;
}

.voucher-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  background-color: #ffffff; /* Re-apply background to cover the gradient */
  border-radius: 0.7rem;
  z-index: 1;
}

.dark .voucher-card::after {
  background-color: #1e293b;
}

.voucher-card > * {
  position: relative;
  z-index: 2;
}


@keyframes rotate {
  100% {
      transform: rotate(1turn);
  }
}


.copy-code-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #f1f5f9; /* slate-100 */
  color: #475569; /* slate-600 */
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0; /* slate-200 */
  cursor: pointer;
  transition: all 0.2s ease;
}

.dark .copy-code-btn {
  background-color: #334155; /* slate-700 */
  color: #cbd5e1; /* slate-300 */
  border-color: #475569; /* slate-600 */
}

.copy-code-btn:hover {
  background-color: #e2e8f0; /* slate-200 */
  border-color: #cbd5e1; /* slate-300 */
}
.dark .copy-code-btn:hover {
  background-color: #475569; /* slate-600 */
  border-color: #64748b; /* slate-500 */
}

.copy-code-btn .copy-icon { display: inline-block; }
.copy-code-btn .check-icon { display: none; }

.copy-code-btn.copied {
  background-color: #10b981; 
  color: white;
  border-color: #10b981;
}
.copy-code-btn.copied .copy-icon { display: none; }
.copy-code-btn.copied .check-icon { display: inline-block; }
/* ========== Desktop Minimum Size ========== */
@media screen and (min-width: 1024px) {
    body {
        min-width: 1280px;
        min-height: 800px;
    }
}

/* ========== REDESIGNED CONTACT SECTION ========== */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem; /* 48px */
    height: 3rem; /* 48px */
    border-radius: 9999px; /* rounded-full */
    background-color: #f1f5f9; /* slate-100 */
    color: #475569; /* slate-600 */
    transition: all 0.3s ease;
}

.dark .social-link {
    background-color: #1e293b; /* slate-800 */
    color: #cbd5e1; /* slate-300 */
}

.social-link:hover {
    background-color: #8b5cf6; /* var(--primary) */
    color: white;
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.2);
}

.social-link svg {
    width: 1.5rem; /* 24px */
    height: 1.5rem; /* 24px */
}

/* ========== COMING SOON MODAL ========== */
#coming-soon-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

#coming-soon-modal.visible #coming-soon-content {
    transform: scale(1);
}