/* ===== VARIABLES ===== */
:root {
  /* Colors */
  --primary-color: #4f46e5;
  --primary-color-alt: #6366f1;
  --secondary-color: #f97316;
  --title-color: #111827;
  --text-color: #4b5563;
  --bg-color: #ffffff;
  --bg-color-alt: #f9fafb;
  --border-color: #e5e7eb;
  --container-color: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.1);

  /* Light/Dark Mode */
  --light-bg: #ffffff;
  --light-text: #111827;
  --dark-bg: #0f172a;
  --dark-text: #f3f4f6;
  --dark-border: #1e293b;
  --dark-container: #1e293b;

  /* Typography */
  --body-font: "Arial", sans-serif;
  --h1-font-size: 2.5rem;
  --h2-font-size: 2rem;
  --h3-font-size: 1.5rem;
  --normal-font-size: 1rem;
  --small-font-size: 0.875rem;
  --smaller-font-size: 0.75rem;

  /* Font Weight */
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;

  /* Margins */
  --mb-0-25: 0.25rem;
  --mb-0-5: 0.5rem;
  --mb-1: 1rem;
  --mb-1-5: 1.5rem;
  --mb-2: 2rem;
  --mb-2-5: 2.5rem;
  --mb-3: 3rem;

  /* z-index */
  --z-tooltip: 10;
  --z-fixed: 100;

  /* Transition */
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: var(--transition);
}

h1,
h2,
h3,
h4 {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: var(--text-color);
}

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

button,
input,
textarea {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  outline: none;
  border: none;
}

button {
  cursor: pointer;
}

/* ===== DARK MODE ===== */
body.dark-mode {
  --title-color: var(--dark-text);
  --text-color: #a1a1aa;
  --bg-color: var(--dark-bg);
  --bg-color-alt: #1e293b;
  --border-color: var(--dark-border);
  --container-color: var(--dark-container);
  --shadow-color: rgba(0, 0, 0, 0.3);
}

/* ===== REUSABLE CSS CLASSES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title h2 {
  font-size: var(--h2-font-size);
  color: var(--title-color);
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

.section-title h2 span {
  color: var(--primary-color);
}

.section-title .subtitle {
  display: block;
  font-size: var(--small-font-size);
  color: var(--text-color);
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: var(--font-medium);
  transition: var(--transition);
}

.primary-btn {
  background-color: var(--primary-color);
  color: #fff;
}

.primary-btn:hover {
  background-color: var(--primary-color-alt);
}

.secondary-btn {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.secondary-btn:hover {
  background-color: var(--primary-color);
  color: #fff;
}

.btn-icon {
  margin-left: 0.5rem;
}

/* ===== PRELOADER ===== */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.5s, visibility 0.5s;
}

.preloader.hide {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: var(--z-fixed);
  transition: var(--transition);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo a {
  font-size: 1.5rem;
  font-weight: var(--font-bold);
  color: var(--title-color);
}

.logo span {
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
}

.nav-list {
  display: flex;
  align-items: center;
  column-gap: 2rem;
}

.nav-link {
  font-weight: var(--font-medium);
  transition: var(--transition);
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--primary-color);
}

.theme-toggle {
  font-size: 1.25rem;
  cursor: pointer;
  margin-left: 1.5rem;
  color: var(--title-color);
}

.hamburger {
  display: none;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--title-color);
  margin: 5px 0;
  transition: var(--transition);
}

/* ===== HERO SECTION ===== */
.hero-section {
  padding-top: 160px;
  padding-bottom: 80px;
  background-color: var(--bg-color-alt);
  position: relative;
  overflow: hidden;
}

.hero-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  gap: 4rem;
}

.hero-text h1 {
  font-size: var(--h1-font-size);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-text h1 span {
  color: var(--primary-color);
}

.hero-text h2 {
  font-size: var(--h3-font-size);
  margin-bottom: 1.5rem;
  font-weight: var(--font-medium);
}

.hero-text p {
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

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

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--container-color);
  color: var(--primary-color);
  font-size: 1.25rem;
  transition: var(--transition);
  box-shadow: 0 2px 10px var(--shadow-color);
}

.social-icon:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: translateY(-5px);
}

.hero-image {
  position: relative;
  text-align: center;
}

.hero-image img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--primary-color);
  position: relative;
  z-index: 1;
}

.hero-shape {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 2px dashed var(--primary-color);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.scroll-down {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mouse-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-color);
  font-size: var(--small-font-size);
}

.mouse {
  width: 30px;
  height: 50px;
  border: 2px solid var(--text-color);
  border-radius: 15px;
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
}

.wheel {
  width: 4px;
  height: 8px;
  background-color: var(--text-color);
  border-radius: 2px;
  margin-top: 8px;
  animation: wheel 1.5s infinite;
}

@keyframes wheel {
  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(10px);
    opacity: 0;
  }
}

/* ===== ABOUT SECTION ===== */
.about-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4rem;
  align-items: center;
}

.about-image {
  position: relative;
}

.about-image img {
  width: 100%;
  border-radius: 1rem;
  box-shadow: 0 5px 15px var(--shadow-color);
}

.experience-box {
  position: absolute;
  bottom: -1.5rem;
  right: -1.5rem;
  background-color: var(--primary-color);
  color: #fff;
  padding: 1.5rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 5px 15px var(--shadow-color);
}

.experience-box h3 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.experience-box p {
  font-size: var(--small-font-size);
}

.about-text p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.about-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-title {
  font-weight: var(--font-medium);
  color: var(--title-color);
}

.info-value {
  color: var(--text-color);
}

/* ===== SKILLS SECTION ===== */
.skills-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.skills-tabs {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: var(--transition);
  background-color: var(--container-color);
  color: var(--text-color);
  box-shadow: 0 2px 10px var(--shadow-color);
}

.tab-btn.active {
  background-color: var(--primary-color);
  color: #fff;
}

.tab-content {
  display: none;
}

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

.skill-item {
  margin-bottom: 1.5rem;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.skill-info h4 {
  font-size: var(--normal-font-size);
  font-weight: var(--font-medium);
}

.skill-bar {
  height: 10px;
  background-color: var(--bg-color-alt);
  border-radius: 5px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 5px;
  width: 0;
  transition: width 1s ease;
}

/* ===== PROJECTS SECTION ===== */
.projects-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: var(--transition);
  background-color: var(--container-color);
  color: var(--text-color);
  box-shadow: 0 2px 10px var(--shadow-color);
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: #fff;
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.project-item {
  background-color: var(--container-color);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 5px 15px var(--shadow-color);
  transition: var(--transition);
}

.project-item:hover {
  transform: translateY(-10px);
}

.project-img {
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

.project-item:hover .project-img img {
  transform: scale(1.1);
}

.project-info {
  padding: 1.5rem;
}

.project-title {
  font-size: var(--h3-font-size);
  margin-bottom: 0.5rem;
}

.project-description {
  font-size: var(--small-font-size);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.project-tech span {
  padding: 0.25rem 0.75rem;
  background-color: var(--bg-color-alt);
  border-radius: 0.5rem;
  font-size: var(--smaller-font-size);
  color: var(--text-color);
}

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

.project-link {
  font-size: var(--small-font-size);
  color: var(--primary-color);
  font-weight: var(--font-medium);
  transition: var(--transition);
}

.project-link:hover {
  color: var(--primary-color-alt);
}

/* ===== CONTACT SECTION ===== */
.contact-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4rem;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.contact-card {
  background-color: var(--container-color);
  padding: 1.5rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 5px 15px var(--shadow-color);
  transition: var(--transition);
}

.contact-card:hover {
  transform: translateY(-5px);
}

.contact-card i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.contact-card h3 {
  font-size: var(--normal-font-size);
  margin-bottom: 0.5rem;
}

.contact-card p {
  font-size: var(--small-font-size);
  margin-bottom: 1rem;
}

.contact-card a {
  color: var(--primary-color);
  font-size: var(--small-font-size);
  font-weight: var(--font-medium);
  transition: var(--transition);
}

.contact-card a:hover {
  color: var(--primary-color-alt);
}

.contact-form-container {
  background-color: var(--container-color);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 5px 15px var(--shadow-color);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: var(--font-medium);
  color: var(--title-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background-color: var(--bg-color-alt);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
}

.form-group textarea {
  height: 150px;
  resize: none;
}

.form-status {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: var(--small-font-size);
  display: none;
}

.form-status.success {
  display: block;
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.form-status.error {
  display: block;
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

/* ===== FOOTER ===== */
.footer {
  background-color: var(--bg-color-alt);
  padding-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-logo h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-logo span {
  color: var(--primary-color);
}

.footer-logo p {
  font-size: var(--small-font-size);
}

.footer-links h4 {
  font-size: var(--normal-font-size);
  margin-bottom: 1.5rem;
}

.footer-links ul li {
  margin-bottom: 0.75rem;
}

.footer-links ul li a {
  font-size: var(--small-font-size);
  transition: var(--transition);
}

.footer-links ul li a:hover {
  color: var(--primary-color);
  margin-left: 0.25rem;
}

.footer-social h4 {
  font-size: var(--normal-font-size);
  margin-bottom: 1.5rem;
}

.footer-bottom {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-bottom p {
  font-size: var(--small-font-size);
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.25rem;
  z-index: var(--z-tooltip);
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--primary-color-alt);
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 992px) {
  .container {
    max-width: 768px;
  }

  .section {
    padding: 4rem 0;
  }

  .hero-content,
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

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

  .hero-btns,
  .social-icons {
    justify-content: center;
  }

  .hero-image {
    order: -1;
  }

  .about-image {
    order: -1;
  }

  .experience-box {
    bottom: 1rem;
    right: 1rem;
  }
}

@media screen and (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 70%;
    height: calc(100vh - 80px);
    background-color: var(--container-color);
    padding: 2rem;
    box-shadow: -5px 0 15px var(--shadow-color);
    transition: var(--transition);
  }

  .nav-menu.show {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    row-gap: 2rem;
  }

  .hamburger {
    display: block;
  }

  .hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .skills-tabs {
    flex-wrap: wrap;
  }

  .projects-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .contact-info {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .footer-links ul li a:hover {
    margin-left: 0;
  }
}

@media screen and (max-width: 576px) {
  :root {
    --h1-font-size: 2rem;
    --h2-font-size: 1.5rem;
    --h3-font-size: 1.25rem;
  }

  .section-title {
    margin-bottom: 3rem;
  }

  .hero-section {
    padding-top: 120px;
  }

  .hero-image img {
    width: 250px;
    height: 250px;
  }

  .hero-shape {
    width: 290px;
    height: 290px;
  }

  .about-info {
    grid-template-columns: 1fr;
  }

  .projects-filter {
    flex-direction: column;
    align-items: center;
  }

  .contact-content {
    gap: 2rem;
  }
}

