* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

:root {
  /* Theme Colors */
  --theme-primary: #0d6efd;
  --theme-primary-dark: #0a58ca;
  --theme-primary-light: #0dcaf0;
  --theme-secondary: #6c757d;
  --theme-success: #198754;
  --theme-danger: #dc3545;
  --theme-warning: #ffc107;
  --theme-info: #0dcaf0;
  
  /* Background Colors */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8f9fa;
  --color-bg-dark: #212529;
  --color-bg-hero-start: #667eea;
  --color-bg-hero-end: #764ba2;
  
  /* Text Colors */
  --color-text-primary: #212529;
  --color-text-secondary: #6c757d;
  --color-text-light: #ffffff;
  --color-text-muted: #adb5bd;
  
  /* Border Colors */
  --color-border: #dee2e6;
  --color-border-light: #e9ecef;
  
  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
  --shadow-navbar: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-navbar-scroll: 0 4px 20px rgba(0, 0, 0, 0.2);
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Typography */
  --font-family-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* Layout */
  --navbar-height: 56px;
  --section-padding: 80px 0;
  --section-padding-mobile: 50px 0;
}

/* Dark Theme */
[data-theme="dark"] {
  --color-bg-primary: #1a1a1a;
  --color-bg-secondary: #2d2d2d;
  --color-bg-dark: #0d1117;
  --color-bg-hero-start: #1e1e2e;
  --color-bg-hero-end: #2d1b4e;
  
  --color-text-primary: #f0f0f0;
  --color-text-secondary: #b0b0b0;
  --color-text-light: #ffffff;
  --color-text-muted: #808080;
  
  --color-border: #404040;
  --color-border-light: #333333;
  
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-navbar: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-navbar-scroll: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  padding-top: var(--navbar-height);
  line-height: 1.6;
}

/* ============================================
 Header
 ============================================ */

header {
  position: relative;
}

/* ============================================
 Main
 ============================================ */
main {
  position: relative;
}

/* ============================================
 Footer
 ============================================ */
footer {
  margin-top: var(--spacing-xxl);
  background-color: var(--color-bg-dark) !important;
  position: relative;
}

footer p {
  color: var(--color-text-light);
}

/* Sections */
section {
  padding: var(--section-padding);
}

section.bg-light {
  background-color: var(--color-bg-secondary) !important;
}

/* ============================================
 Navigation
 ============================================ */

.navbar {
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-navbar);
  background-color: var(--color-bg-dark) !important;
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
}

.nav-link {
  font-weight: 500;
  transition: color var(--transition-normal);
  margin: 0 var(--spacing-sm);
}

.nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--theme-primary) !important;
}

.navbar-nav .nav-link.active {
  font-weight: bold;
}

/* ============================================
 Hero Section
 ============================================ */

.hero-section {
  /* background: linear-gradient(135deg, var(--color-bg-hero-start) 0%, var(--color-bg-hero-end) 100%); */
  background-image: url('../images/hero/programming-coding-language-wallpaper-2560x1440_51.jpg');
  color: var(--color-text-light);
  min-height: calc(90vh - var(--navbar-height));
  display: flex;
  align-items: center;
}

.hero-content {
  min-height: calc(90vh - var(--navbar-height));
}

.hero-section .display-4 {
  color: var(--color-text-light);
}

.hero-image {
  animation: float 3s ease-in-out infinite;
}

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

/* Speech Bubble */
.speech-bubble {
  position: relative;
  background-color: rgba(255, 255, 255, 0.95);
  padding: var(--spacing-xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--color-text-light);
  margin-bottom: var(--spacing-lg);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  right: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-left: 20px solid rgba(255, 255, 255, 0.95);
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.speech-bubble::before {
  content: '';
  position: absolute;
  right: -23px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 23px solid transparent;
  border-bottom: 23px solid transparent;
  border-left: 23px solid var(--color-text-light);
  z-index: -1;
}

.speech-bubble h1,
.speech-bubble p {
  color: var(--color-text-primary);
}

@media (max-width: 768px) {
  .speech-bubble::after,
  .speech-bubble::before {
    display: none;
  }
}

/* ============================================
 Components - Cards
 ============================================ */

.card {
  background-color: var(--color-bg-primary);
  border-color: var(--color-border-light);
  color: var(--color-text-primary);
}

.card-title {
  color: var(--color-text-primary);
}

.card-text {
  color: var(--color-text-secondary);
}

/* Skill Cards */
.skill-card {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg) !important;
}

.skill-card .display-4 {
  font-size: 3rem;
}

/* Skills Progress Bars */
.skill-category {
  margin-bottom: var(--spacing-xxl);
}

.skill-category-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  border-bottom: 2px solid var(--color-border);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-normal);
  width: 100%;
}

.skill-category-title:hover {
  color: var(--theme-primary);
}

.skill-category-title i:first-child {
  color: var(--theme-primary);
}

.skill-category-title .collapse-icon {
  margin-left: auto;
  transition: transform var(--transition-normal);
}

.skill-category-title[aria-expanded="false"] .collapse-icon {
  transform: rotate(-90deg);
}

.skill-category-title[aria-expanded="true"] .collapse-icon {
  transform: rotate(0deg);
}

.skill-category .collapse {
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.skills-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
  min-height: 0;
  transform: translateZ(0);
}

.skill-item {
  margin-bottom: 0;
}

@media (max-width: 992px) {
  .skills-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .skills-container {
    grid-template-columns: 1fr;
  }
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.skill-name {
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
}

.skill-percentage {
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--theme-primary);
}

.progress {
  height: 12px;
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-primary-light));
  border-radius: var(--radius-sm);
  transition: width 1.5s ease-in-out;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ============================================
 Project Images Scroll (Two Rows: Top RTL, Bottom LTR)
 ============================================ */

.project-images-scroll {
  height: 400px;
  margin-bottom: 3rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  background: var(--color-bg-secondary);
  display: flex;
  flex-direction: column;
}

.project-images-row {
  height: 50%;
  overflow: hidden;
  position: relative;
}

.project-images-track {
  display: flex;
  width: fit-content;
  height: 100%;
  will-change: transform;
}

.track-rtl {
  animation: scrollRightToLeft 60s linear infinite;
}

.track-ltr {
  animation: scrollLeftToRight 60s linear infinite;
}

.project-image-slide {
  height: 100%;
  aspect-ratio: 16 / 9;
  min-width: calc(200px * 16 / 9);
  width: calc(200px * 16 / 9);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-slow);
  overflow: hidden;
}

.project-image-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

@keyframes scrollRightToLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes scrollLeftToRight {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0);
  }
}

/* Pause on hover */
.project-images-scroll:hover .project-images-track {
  animation-play-state: paused;
}

/* ============================================
 Category Tabs
 ============================================ */

.category-tabs {
  margin-bottom: 2rem;
}

.category-tab {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all var(--transition-normal);
  border: 2px solid var(--color-border);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-tab:hover {
  border-color: var(--theme-primary);
  color: var(--theme-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.category-tab.active {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
  color: var(--color-text-light);
  box-shadow: var(--shadow-md);
}

.category-tab.active:hover {
  background-color: var(--theme-primary-dark);
  border-color: var(--theme-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.category-tab i {
  font-size: 1.1rem;
}

/* ============================================
 Projects Carousel Swiper (2 rows x 3 columns)
 ============================================ */

#projects {
  overflow-x: hidden;
}

.projects-carousel-swiper {
  padding: 20px 0 60px 0;
  position: relative;
  overflow: hidden;
}

.projects-carousel-swiper .swiper-wrapper {
  display: flex;
  align-items: stretch;
}

.projects-carousel-swiper .swiper-slide {
  height: auto;
  width: 100%;
  flex-shrink: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 24px;
  height: auto;
  min-height: 0;
}

.projects-carousel-swiper .swiper-button-next,
.projects-carousel-swiper .swiper-button-prev {
  color: var(--theme-primary);
  background-color: var(--color-bg-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  top: 50%;
  margin-top: 0;
  transform: translateY(-50%);
  z-index: 10;
}

.projects-carousel-swiper .swiper-button-next:after,
.projects-carousel-swiper .swiper-button-prev:after {
  font-size: 20px;
  font-weight: bold;
}

.projects-carousel-swiper .swiper-button-next:hover,
.projects-carousel-swiper .swiper-button-prev:hover {
  background-color: var(--theme-primary);
  color: var(--color-text-light);
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--shadow-lg);
}

.projects-carousel-swiper .swiper-pagination {
  bottom: 0;
}

.projects-carousel-swiper .swiper-pagination-bullet {
  background-color: var(--theme-primary);
  opacity: 0.3;
  width: 12px;
  height: 12px;
  transition: all var(--transition-normal);
}

.projects-carousel-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  width: 24px;
  border-radius: 6px;
}

/* Project Cards */
.project-card {
  transition: all var(--transition-normal);
  border: none;
  overflow: hidden;
  background-color: var(--color-bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.project-image {
  height: 220px;
  transition: transform var(--transition-slow);
  position: relative;
  overflow: hidden;
}

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

.project-card:hover .project-image::after {
  opacity: 0.1;
}

.project-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.project-card .card-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-card .card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text-primary);
  min-height: 2.5rem;
}

.project-card .card-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card .badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast);
}

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

.project-card .card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border-light);
}

.project-card .btn {
  transition: all var(--transition-normal);
  font-weight: 500;
  border-width: 2px;
}

.project-card .btn:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-sm);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
  }
}

@media (max-width: 768px) {
  .project-images-scroll {
    height: 300px;
  }
  
  .project-image-slide {
    min-width: calc(150px * 16 / 9);
    width: calc(150px * 16 / 9);
    font-size: 3rem;
  }
  
  .category-tabs {
    gap: 0.5rem !important;
  }
  
  .category-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .projects-carousel-swiper {
    padding: 10px 0 50px 0;
  }
  
  .projects-carousel-swiper .swiper-button-next,
  .projects-carousel-swiper .swiper-button-prev {
    width: 36px;
    height: 36px;
  }
  
  .projects-carousel-swiper .swiper-button-next:after,
  .projects-carousel-swiper .swiper-button-prev:after {
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  .project-images-scroll {
    height: 250px;
  }
  
  .project-image-slide {
    min-width: calc(125px * 16 / 9);
    width: calc(125px * 16 / 9);
    font-size: 2.5rem;
  }
  
  .track-rtl,
  .track-ltr {
    animation-duration: 40s;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  
  .project-image {
    height: 180px;
  }
  
  .project-card .card-body {
    padding: 1rem;
  }
  
  .project-card .card-title {
    font-size: 1.1rem;
    min-height: 2.2rem;
  }
  
  .project-card .card-text {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

/* ============================================
 Components - Buttons
 ============================================ */

.btn-primary {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
}

.btn-primary:hover {
  background-color: var(--theme-primary-dark);
  border-color: var(--theme-primary-dark);
}

.btn-outline-primary {
  color: var(--theme-primary);
  border-color: var(--theme-primary);
}

.btn-outline-primary:hover {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
  color: var(--color-text-light);
}

/* ============================================
 Components - Forms
 ============================================ */

#contactForm {
  background: var(--color-bg-primary);
  padding: var(--spacing-xxl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.form-control {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.form-control:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
}

.form-label {
  color: var(--color-text-primary);
}

/* ============================================
 Components - Utilities
 ============================================ */

/* Divider */
.divider {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-primary-light));
  margin: var(--spacing-xl) auto;
  border-radius: var(--radius-sm);
}

/* Social Links */
.social-links a {
  transition: transform var(--transition-normal);
  margin: var(--spacing-sm);
}

.social-links a:hover {
  transform: scale(1.1);
}

/* ============================================
 Animations
 ============================================ */

.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
  to {
      opacity: 1;
  }
}

/* ============================================
 Responsive Design
 ============================================ */

@media (max-width: 768px) {
  .hero-section h1 {
      font-size: 2rem;
  }
  
  .display-5 {
      font-size: 2rem;
  }
  
  section {
      padding: var(--section-padding-mobile);
  }
}
