:root {
  --primary-color: #2563eb;
  --text-color: #1f2937;
  --bg-color: #ffffff;
  --secondary-bg: #f3f4f6;
  --border-color: #e5e7eb;
  --card-bg: #ffffff;
  --header-bg: #ffffff;
  --footer-bg: #f3f4f6;
  --transition: all 0.3s ease;
  --container-margin: 20rem;
  --home-text-color: #ffffff; /* Fixed color for home text */
}

[data-theme="dark"] {
  --primary-color: #3b82f6;
  --text-color: #f3f4f6;
  --bg-color: #111827;
  --secondary-bg: #1f2937;
  --border-color: #374151;
  --card-bg: #1f2937;
  --header-bg: #111827;
  --footer-bg: #1f2937;
  background-color: #121212;
  color: #e0e0e0;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  transition: var(--transition);
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  margin-left: var(--container-margin);
  margin-right: var(--container-margin);
}

/* Header */
header {
  background-color: #333;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 90;
  animation: slideDown 0.5s ease-out;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem var(--container-margin);
  background-color: #333;
  color: #fff;
  position: relative;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.desktop-only {
  display: flex;
}

.mobile-controls {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1rem;
}

/* Theme Switch */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 28px;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e5e7eb;
  transition: background 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: transform 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
  background: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.theme-switch-wrapper .fa-sun,
.theme-switch-wrapper .fa-moon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  font-size: 1.2rem;
  transition: color 0.3s;
}

.theme-switch-wrapper .fa-sun {
  color: #fbbf24;
}

.theme-switch-wrapper .fa-moon {
  color: #64748b;
}

[data-theme="dark"] .theme-switch-wrapper .fa-sun {
  color: #f3f4f6;
}

[data-theme="dark"] .theme-switch-wrapper .fa-moon {
  color: #fbbf24;
}

/* Language Switch */
.lang-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
  transition: var(--transition);
}

.lang-btn:hover {
  background: var(--secondary-bg);
  transform: scale(1.05);
}

.lang-btn .fa-globe {
  color: #64748b; /* Fixed color for language icon */
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: flex-start;
  padding: 1rem;
  gap: 2rem;
  margin: 0;
}

nav ul li {
  margin: 0;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  position: relative;
}

nav ul li a:hover {
  color: var(--primary-color);
  background: var(--secondary-bg);
  transform: translateY(-2px);
}

nav ul li a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--primary-color);
  transition: all 0.3s ease;
}

nav ul li a:hover::after {
  width: 100%;
  left: 0;
}

header .menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #fff;
  z-index: 100;
  transition: transform 0.3s ease;
}

header .menu-toggle:hover {
  transform: scale(1.1);
}

/* Sections */
.section {
  padding: 4rem 0;
  animation: fadeInUp 0.6s ease-out;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--text-color);
  animation: bounceIn 0.8s ease-out;
}

/* Home Section */
#home {
  padding: 0;
}

.home-background {
  background: linear-gradient(135deg, var(--primary-color), #ff758c);
  padding: 4rem 0;
  text-align: center;
  transition: background 0.3s;
}

.title {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--home-text-color);
  animation: fadeInUp 0.8s ease-out;
}

.subtitle {
  font-size: 1.25rem;
  max-width: 800px;
  color: var(--home-text-color);
  animation: fadeInUp 1s ease-out;
}

/* Projects Section */
.search-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.search-container input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--card-bg);
  color: var(--text-color);
  min-width: 500px;
  transition: all 0.3s ease;
}

.search-container input:focus {
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  padding: 1rem 0;
}

.project-item {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  padding: 1.5rem;
  border-radius: 12px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  animation: slideInUp 0.6s ease-out;
}

.project-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.project-item h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.project-item h3 a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.project-item h3 a:hover {
  color: #ff758c;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 1rem 0;
}

.skill-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  animation: bounceInUp 0.6s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.skill-card:hover {
  transform: translateY(-10px) rotate(2deg);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.skill-card i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.skill-card:hover i {
  transform: scale(1.2) rotate(10deg);
  color: #ff758c;
}

.skill-card span {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Contact Section */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-weight: 500;
}

input,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--card-bg);
  color: var(--text-color);
  transition: all 0.3s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  transform: scale(1.01);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

.submit-btn {
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

.clear-btn {
  background-color: #ef4444;
  color: #fff;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  margin-right: 0.5rem;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background-color: #b91c1c;
  transform: translateY(-2px) scale(1.05);
}

.success-message {
  text-align: center;
  color: #10b981;
  margin-top: 1rem;
}

.success-message i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  animation: slideInUp 0.6s ease-out;
}

.form-container form {
  display: block;
}

.form-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.form-actions button {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-success {
  text-align: center;
  color: #4caf50;
  font-size: 1.2rem;
  animation: bounceIn 0.6s ease-out;
}

.form-success i {
  font-size: 2rem;
  margin-bottom: 1rem;
}

[data-theme="dark"] .form-container {
  background-color: var(--card-bg);
  color: var(--text-color);
}

/* Footer */
footer {
  background-color: #333;
  color: #fff;
  padding: 2rem 0;
  animation: slideUp 0.6s ease-out;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer a {
  color: #fff;
  text-decoration: none;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

footer a:hover {
  color: #ff7eb3;
  transform: scale(1.2) rotate(10deg);
}

footer .social-links {
  display: flex;
  gap: 1rem;
}

/* Responsive Design */
@media (max-width: 1440px) {
  :root {
    --container-margin: 10rem;
  }
}

@media (max-width: 1024px) {
  :root {
    --container-margin: 5rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-container input {
    min-width: 400px;
  }
}

@media (max-width: 768px) {
  :root {
    --container-margin: 1rem;
  }

  header nav {
    padding: 1.5rem 1rem;
    position: relative;
  }

  .desktop-only {
    display: none;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background-color: #333;
    flex-direction: column;
    justify-content: flex-start;
    padding: 4rem 0 2rem 0;
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 99;
    overflow-y: auto;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu ul {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 0;
    margin: 0;
  }

  .nav-menu ul li {
    width: 100%;
    text-align: center;
  }

  .nav-menu ul li a {
    display: block;
    padding: 1rem 2rem;
    width: 100%;
    border-radius: 0;
    transition: all 0.3s ease;
  }

  .nav-menu ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
  }

  .mobile-controls {
    display: flex;
    width: 100%;
    padding: 1rem 2rem;
    align-items: center;
    justify-content: center;
  }

  .mobile-controls .theme-switch-wrapper,
  .mobile-controls .language-switch {
    justify-content: center;
  }

  header .menu-toggle {
    display: block;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
  }

  .title {
    font-size: 2rem;
  }

  .section {
    padding: 2rem 0;
  }

  .search-container {
    flex-direction: column;
    align-items: center;
  }

  .search-container input {
    min-width: 250px;
    width: 100%;
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .project-item {
    padding: 1rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-container {
    padding: 2rem 1rem;
    margin: 0 1rem;
  }

  footer .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

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

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounceInUp {
  0% {
    opacity: 0;
    transform: translateY(100px) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateY(-10px) scale(1.1);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

/* Scroll animations */
.section {
  opacity: 0;
  animation: none;
}

.section.visible {
  opacity: 1;
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Hover effects for interactive elements */
.project-item,
.skill-card,
.form-container {
  position: relative;
  overflow: hidden;
}

.project-item::before,
.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.project-item:hover::before,
.skill-card:hover::before {
  left: 100%;
}

.form-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.form-container:hover::before {
  left: 100%;
}
