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

/* Light Theme (Default) */
body {
  font-family: 'Open Sans', sans-serif;
  background-color: #f7f8fa;
  color: #2c3e50;
  transition: background 0.3s ease, color 0.3s ease;
  scroll-behavior: smooth;
}

/* Dark Theme */
body.dark {
  background: linear-gradient(to right, #000028, #00003b, #1a0052, #2d006b);
  color: #fff;
}

.left-sidebar {
  width: 240px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  background: #f1f3f6;
  padding: 30px 20px;
  overflow-y: auto;
  border-right: 2px solid rgba(0, 0, 0, 0.1);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  will-change: transform;
  transition: background 0.3s ease, border-right 0.3s ease;
}

body.dark .left-sidebar {
  background: #000028;
  border-right: 2px solid rgba(255, 255, 255, 0.15);
}

.left-sidebar img {
  max-width: 100%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #444, #666);
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Profile image placeholder wrapper */
.profile-placeholder {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ddd, #eee);
  border: 3px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

body.dark .profile-placeholder {
  background: linear-gradient(135deg, #555, #777);
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.profile-placeholder i {
  font-size: 100px;
  color: rgba(0, 0, 0, 0.3);
  transition: color 0.3s ease;
}

body.dark .profile-placeholder i {
  color: rgba(255, 255, 255, 0.4);
}

.left-sidebar h1 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  margin: 0;
  color: #2c3e50;
  transition: color 0.3s ease;
}

body.dark .left-sidebar h1 {
  color: #fff;
}

.left-sidebar p {
  margin: 0.5rem 0 1rem;
  color: #555;
  transition: color 0.3s ease;
}

body.dark .left-sidebar p {
  color: #fff;
}

.left-sidebar ul {
  list-style: none;
  padding: 0;
  margin-top: 30px;
  width: 100%;
}

.left-sidebar li {
  margin: 12px 0;
}

.left-sidebar a {
  text-decoration: none;
  color: #333;
  font-size: 16px;
  transition: color 0.3s ease;
}

body.dark .left-sidebar a {
  color: #fff;
}

.left-sidebar a:hover {
  color: #007bff;
}

body.dark .left-sidebar a:hover {
  color: #ff0199;
}

.left-sidebar a.active {
  color: #007bff;
  font-weight: bold;
}

body.dark .left-sidebar a.active {
  color: #ff0199;
}

#toggle-theme {
  margin-top: auto;
  margin-bottom: 20px;
  background: transparent;
  color: #007bff;
  border: none;
  padding: 8px 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 14px;
}

body.dark #toggle-theme {
  color: #ff0199;
}

#toggle-theme i {
  font-size: 16px;
}

#toggle-theme:hover {
  background: rgba(0, 123, 255, 0.1);
  transform: scale(1.05);
}

body.dark #toggle-theme:hover {
  background: rgba(255, 1, 153, 0.1);
}

.social-links-icons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 20px 0;
}

.social-links-icons a {
  font-size: 22px;
  padding: 12px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.icon-github {
  background-color: #333;
}

.icon-linkedin {
  background-color: #0A66C2;
}

.icon-email {
  background-color: #444;
}

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

/* === MAIN SECTION === */
.content-section {
  margin-left: 260px;
  padding: 60px 40px;
  min-height: 100vh;
  background: transparent;
  transition: background 0.3s ease;
}

body.dark .content-section {
  background: linear-gradient(to right,
    #000028 0%,
    #00003b 30%,
    #0d0045 60%,
    #1a0052 100%);
}

section {
  padding: 80px 20px;
  margin-bottom: 60px;
  scroll-margin-top: 80px;
}

/* === HERO === */
.hero-container {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background: #f0f2f5;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.3s ease;
}

body.dark .hero-container {
  background: #00003b;
}

.hero-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: url('../images/profile.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.06;
  z-index: 0;
}

.hero-swap {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
  pointer-events: none;
}

.hero-swap.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.background-text {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  font-size: 1.6em;
  font-weight: bold;
  color: rgba(200, 200, 200, 0.3);
  z-index: 0;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.3rem;
  line-height: 1.2;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.2);
}

.background-text span {
  white-space: nowrap;
}

body.dark .background-text {
  color: rgba(255, 255, 255, 0.15);
  text-shadow: none;
}

.background-text-bottom {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  font-size: 1.6em;
  font-weight: bold;
  color: rgba(200, 200, 200, 0.3);
  z-index: 0;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.3rem;
  line-height: 1.2;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.2);
}

.background-text-bottom span {
  white-space: nowrap;
}

body.dark .background-text-bottom {
  color: rgba(255, 255, 255, 0.15);
  text-shadow: none;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 12px 30px;
  border: 2px solid #007bff;
  background: #007bff;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  color: #fff;
  margin-top: 1rem;
  border-radius: 45px;
  transition: all 0.5s;
  letter-spacing: 0.05em;
}

body.dark .hero-button {
  border: 2px solid #ff0199;
  background: transparent;
  color: #ff0199;
}

.hero-button:hover {
  background: transparent;
  color: #007bff;
}

body.dark .hero-button:hover {
  background: #ff0199;
  color: #fff;
}

.hero-button i {
  font-size: 1.1rem;
}


/* === TAB NAVIGATION === */
.tab-navigation {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 0.5rem;
}

body.dark .tab-navigation {
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tab-button {
  background: transparent;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  position: relative;
  transition: color 0.3s ease;
}

body.dark .tab-button {
  color: #aaa;
}

.tab-button:hover {
  color: #007bff;
}

body.dark .tab-button:hover {
  color: #ff0199;
}

.tab-button.active {
  color: #007bff;
}

body.dark .tab-button.active {
  color: #ff0199;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -0.6rem;
  left: 0;
  right: 0;
  height: 3px;
  background: #007bff;
  border-radius: 2px;
}

body.dark .tab-button.active::after {
  background: #ff0199;
}

.tab-content-wrapper {
  margin-top: 2rem;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Code Samples Grid */
.code-samples-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2rem;
}

.code-sample-card {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  flex: 0 0 calc(50% - 1rem);
  max-width: calc(50% - 1rem);
  min-width: 280px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

body.dark .code-sample-card {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.code-sample-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 123, 255, 0.15);
}

body.dark .code-sample-card:hover {
  box-shadow: 0 8px 20px rgba(255, 1, 153, 0.15);
}

.code-sample-card .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #007bff;
}

body.dark .code-sample-card .icon {
  color: #ff0199;
}

.code-sample-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

body.dark .code-sample-card h3 {
  color: #fff;
}

.code-sample-card p {
  margin-bottom: 1.5rem;
  color: #666;
  line-height: 1.6;
}

body.dark .code-sample-card p {
  color: #ccc;
}

@media (max-width: 768px) {
  .tab-navigation {
    flex-direction: row;
    gap: 0.5rem;
  }

  .tab-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .code-sample-card {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* === SKILLS TABLE === */
.skills-table {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.skill-category {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark .skill-category {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.skill-category:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.15);
}

body.dark .skill-category:hover {
  box-shadow: 0 4px 15px rgba(255, 1, 153, 0.15);
}

.skill-category h3 {
  color: #007bff;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  border-bottom: 2px solid #007bff;
  padding-bottom: 0.5rem;
}

body.dark .skill-category h3 {
  color: #ff0199;
  border-bottom: 2px solid #ff0199;
}

.skill-subcategory {
  color: #555;
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

body.dark .skill-subcategory {
  color: #ccc;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  background: #e8f4ff;
  color: #007bff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.3s ease, transform 0.2s ease;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

body.dark .skill-tag {
  background: rgba(255, 1, 153, 0.1);
  color: #ff0199;
}

.skill-tag:hover {
  background: #007bff;
  color: #fff;
  transform: translateY(-2px);
}

body.dark .skill-tag:hover {
  background: #ff0199;
  color: #fff;
}

/* Non-clickable skill tags */
.skill-tag-text {
  cursor: default;
}

.skill-tag-text:hover {
  background: #e8f4ff;
  color: #007bff;
  transform: translateY(0);
}

body.dark .skill-tag-text:hover {
  background: rgba(255, 1, 153, 0.1);
  color: #ff0199;
  transform: translateY(0);
}

/* === SERVICES === */
.card-grid,
.grid-cards {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2.5rem;
}

.feature-card {
  background: white;
  padding: 50px 20px;
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  flex: 0 0 calc(33.333% - 1.5rem);
  max-width: calc(33.333% - 1.5rem);
  min-width: 240px;
  box-sizing: border-box;
  text-align: center;
  opacity: 0;
  transform: translateX(-40px);
  animation: fadeInLeft 1s ease-out forwards;
  transition: border 0.5s, background 0.3s ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

body.dark .feature-card {
  background: #000028;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.feature-card:hover {
  border: 2px solid rgba(0, 123, 255, 0.5);
}

body.dark .feature-card:hover {
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.feature-card .icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  color: #007bff;
}

body.dark .feature-card .icon {
  color: #ff0199;
}

.feature-card h3 {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  color: #2c3e50;
}

body.dark .feature-card h3 {
  color: #fff;
}

.feature-card p {
  font-size: 0.95rem;
  color: #555;
}

body.dark .feature-card p {
  color: #fff;
}

.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.4s; }

/* === WORK / SERVICE CARDS === */
.service-card {
  background: white;
  padding: 40px 20px;
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  flex: 0 0 calc(33.333% - 1.5rem);
  max-width: 320px;
  min-width: 240px;
  box-sizing: border-box;
  text-align: center;
  transition: border 0.5s, background 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

body.dark .service-card {
  background: #000028;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.service-card:hover {
  border: 2px solid rgba(0, 123, 255, 0.5);
}

body.dark .service-card:hover {
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.service-card h3 {
  color: #007bff;
  font-weight: 500;
}

body.dark .service-card h3 {
  color: #ff0199;
}

.service-card p {
  color: #555;
}

body.dark .service-card p {
  color: #fff;
}

@keyframes fadeInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .content-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .card-grid,
  .grid-cards {
    flex-direction: column;
    align-items: center;
  }

  .feature-card,
  .service-card {
    width: 100%;
    max-width: 320px;
  }

  .hero-container {
    text-align: center;
  }
}

/* === EDUCATION === */
.accordion {
  margin-top: 2.5rem;
}

.accordion-toggle {
  cursor: pointer;
  background: #007bff;
  color: white;
  padding: 1rem;
  font-weight: bold;
  border-radius: 5px;
  margin-bottom: 1rem;
  border: 2px solid #007bff;
  transition: all 0.5s;
}

body.dark .accordion-toggle {
  background: #000028;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.accordion-toggle:hover {
  opacity: 0.9;
}

body.dark .accordion-toggle:hover {
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  background: #f8f9fa;
  padding: 0 1rem;
  border-left: 3px solid #007bff;
  border-radius: 5px;
  transition: max-height 0.3s ease, background 0.3s ease;
  color: #2c3e50;
}

body.dark .accordion-content {
  background: #000028;
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.accordion-toggle.active + .accordion-content {
  max-height: 200px;
  padding: 1rem;
}

.accordion-content ul {
  padding-left: 1.5rem;
  margin: 0;
  list-style-type: disc;
}

.accordion-content p {
  margin: 0 0 0.5rem 0;
}

/* === ABOUT === */
#about p {
  margin-top: 2.5rem;
}

/* === BLOG === */
#blog ul {
  margin-top: 2.5rem;
}

/* === CONTACT === */
.contact-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin-top: 2.5rem;
}

.contact-info {
  flex: 1 1 30%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-form {
  flex: 1 1 60%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-item a,
.contact-item p {
  color: #2c3e50;
  text-decoration: none;
  transition: color 0.3s ease;
}

body.dark .contact-item a,
body.dark .contact-item p {
  color: #fff;
}

.icon-box {
  width: 60px;
  height: 60px;
  background: #f1f3f6;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 24px;
  color: #007bff;
  border: 2px solid rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease;
}

body.dark .icon-box {
  background: #000028;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ff0199;
}

.contact-form input,
.contact-form textarea {
  padding: 1rem;
  border: 2px solid #ddd;
  background: #f1f3f6;
  color: #2c3e50;
  border-radius: 6px;
  transition: border 0.5s, background 0.3s ease;
}

body.dark .contact-form input,
body.dark .contact-form textarea {
  border: 2px solid #000028;
  background: #000028;
  color: #fff;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border: 2px solid #007bff;
}

body.dark .contact-form input:focus,
body.dark .contact-form textarea:focus {
  border: 2px solid #ff0199;
}

.button-metal {
  background: #007bff;
  color: #fff;
  font-weight: 500;
  border: 2px solid #007bff;
  border-radius: 45px;
  padding: 12px 30px;
  font-size: 1rem;
  letter-spacing: 0.05em;
  box-shadow: 0 0 20px rgba(0, 123, 255, 0.3);
  transition: all 0.5s;
  text-align: center;
  cursor: pointer;
}

body.dark .button-metal {
  background: transparent;
  border: 2px solid #ff0199;
  color: #ff0199;
  box-shadow: 0 0 20px rgba(255, 1, 153, 0.3);
}

.button-metal:hover {
  background: transparent;
  color: #007bff;
}

body.dark .button-metal:hover {
  background: #ff0199;
  color: #fff;
}

/* === FOOTER === */
.footer {
  margin-left: 260px;
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: #777;
  transition: color 0.3s ease;
}

body.dark .footer {
  color: #aaa;
}

/* === ANIMATION === */
.fade-slide {
  opacity: 0;
  transform: translateY(30px);
  will-change: transform, opacity;
  backface-visibility: hidden;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-slide.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  .left-sidebar {
    position: relative;
    width: 100%;
    border: none;
    text-align: center;
  }

  .left-sidebar ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .left-sidebar li {
    margin: 0;
  }

  .left-sidebar a {
    min-width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 14px;
    padding: 0 12px;
    color: #000;
    font-weight: 600;
    transition: background 0.3s ease;
  }

  body.dark .left-sidebar a {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .left-sidebar a:hover {
    background: rgba(0, 123, 255, 0.2);
  }

  body.dark .left-sidebar a:hover {
    background: rgba(255, 1, 153, 0.2);
  }

  .left-sidebar a::first-letter {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
  }

  body.dark .left-sidebar a::first-letter {
    color: #ff0199;
  }

  .left-sidebar a.active {
    background: rgba(0, 123, 255, 0.25);
  }

  body.dark .left-sidebar a.active {
    background: rgba(255, 1, 153, 0.25);
  }

  .content-section,
  .footer {
    margin-left: 0;
    padding: 20px;
  }

  .skills-grid {
    flex-direction: column;
  }

  .contact-container {
    flex-direction: column;
  }

  .hero-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-button {
    display: inline-flex;
    justify-content: center;
  }

  .card-grid,
  .grid-cards {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* === SERVICE MODAL === */
.service-card-clickable {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card-small {
  padding: 30px 15px !important;
  flex: 0 0 calc(25% - 1.5rem) !important;
  max-width: calc(25% - 1.5rem) !important;
}

.service-card-small h3 {
  font-size: 1.1rem;
}

.service-card-small p {
  font-size: 0.9rem;
}

.service-card-clickable:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

body.dark .service-card-clickable:hover {
  box-shadow: 0 8px 20px rgba(255, 1, 153, 0.3);
}

@media (max-width: 1200px) {
  .service-card-small {
    flex: 0 0 calc(50% - 1.5rem) !important;
    max-width: calc(50% - 1.5rem) !important;
  }
}

@media (max-width: 768px) {
  .service-card-small {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

.click-hint {
  display: block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #007bff;
  font-weight: 500;
}

body.dark .click-hint {
  color: #ff0199;
}

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body.dark .modal-content {
  background: #1a1a2e;
  color: #fff;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #007bff;
}

body.dark .modal-close:hover {
  color: #ff0199;
}

#modal-title {
  margin-top: 0;
  color: #007bff;
  margin-bottom: 1rem;
}

body.dark #modal-title {
  color: #ff0199;
}

#modal-body {
  line-height: 1.8;
}

#modal-body h4 {
  color: #007bff;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

body.dark #modal-body h4 {
  color: #ff0199;
}

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

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* === BACK TO TOP BUTTON === */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.dark .back-to-top {
  background: #ff0199;
  box-shadow: 0 4px 12px rgba(255, 1, 153, 0.4);
}

.back-to-top:hover {
  background: #0056b3;
  transform: translateY(-3px);
}

body.dark .back-to-top:hover {
  background: #cc0077;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
