:root {
  --color-primary: #0f0;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --text-color: #111;
  --bg-color: #fff;
  --card-bg: #f9f9f9;
  --border-color: #ddd;
  --nav-height: 70px;
}

body.dark-mode,
body.night {
  --text-color: #eee;
  --bg-color: #0a0a0a;
  --card-bg: #1a1a1a;
  --border-color: #333;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  padding-top: var(--nav-height);
}

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

h1, h2, h3, h4 {
  line-height: 1.2;
}

/* GREEN SCROLLBAR */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00cc00;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) var(--bg-color);
}

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

.loader-wrapper {
  text-align: center;
}

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

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

.loader-text {
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 600;
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 45px;
  width: auto;
}

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

.nav-link {
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color 0.3s;
}

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

.nav-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

.contact-button-nav {
  background-color: var(--color-primary);
  color: #000;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  border-radius: 6px;
  transition: opacity 0.3s;
}

.contact-button-nav:hover {
  opacity: 0.8;
}

/* NOTIFICATION TOAST */
.toast {
  position: fixed;
  top: 90px;
  right: -400px;
  background: var(--card-bg);
  border: 2px solid var(--color-primary);
  border-radius: 12px;
  padding: 1.25rem;
  min-width: 320px;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transition: right 0.5s ease;
}

.toast.show {
  right: 20px;
}

.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.toast-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-color);
}

.toast-icon {
  color: var(--color-primary);
  font-size: 1.5rem;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

.toast-close:hover {
  color: var(--color-primary);
}

.toast-body {
  color: var(--text-color);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* WHATSAPP FLOATING BUTTON */
.whatsapp-float {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 998;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  animation: pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}

.whatsapp-float i {
  font-size: 32px;
  color: white;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.7);
  }
}

/* HOME SECTION */
.home {
  max-width: 1200px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: flex;
  align-items: center;
}

.home-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  width: 100%;
}

.info {
  flex: 1;
}

.info h4 {
  font-weight: 500;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.info h2 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

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

.info h3 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

.info p {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.home-img {
  flex: 0 0 400px;
  text-align: center;
}

.home-img img {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* TIMELINE SECTION */
.timeline-section {
  padding: 4rem 2rem;
  background: var(--bg-color);
}

.timeline-section .container {
  max-width: 900px;
  margin: 0 auto;
}

.timeline-section h2 {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text-color);
}

.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  justify-content: flex-end;
  padding-right: 50%;
  padding-left: 0;
  margin-bottom: 3rem;
  position: relative;
}

.timeline-item:nth-child(even) {
  justify-content: flex-start;
  padding-left: 50%;
  padding-right: 0;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border: 4px solid var(--bg-color);
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 0 4px var(--color-primary);
}

.timeline-content {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  margin-right: 30px;
  position: relative;
}

.timeline-item:nth-child(even) .timeline-content {
  margin-right: 0;
  margin-left: 30px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.timeline-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  flex: 1;
}

.timeline-date {
  font-size: 0.9rem;
  color: var(--color-primary);
  font-weight: 600;
  white-space: nowrap;
}

.timeline-content p {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.timeline-content ul {
  padding-left: 1.5rem;
  margin: 0.5rem 0 0;
  line-height: 1.7;
}

.timeline-content li {
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  color: var(--text-color);
}

/* TESTIMONIALS SECTION */
.testimonials {
  padding: 4rem 2rem;
  background: var(--bg-color);
}

.testimonials .container {
  max-width: 1200px;
  margin: 0 auto;
}

.testimonials h2 {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text-color);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.testimonial-quote {
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  font-size: 3rem;
  color: var(--color-primary);
  opacity: 0.3;
  line-height: 1;
}

.testimonial-text {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  position: relative;
  z-index: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* CIRCULAR AVATAR */
.author-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: #000;
  flex-shrink: 0;
}

.author-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-color);
}

.author-info p {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
}

.testimonial-rating {
  color: #ffd700;
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* PROJECTS */
#projects {
  padding: 4rem 2rem;
  background: var(--bg-color);
}

#projects .container {
  max-width: 1200px;
  margin: 0 auto;
}

#projects h2 {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  color: var(--text-color);
}

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

.project-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

/* PROJECT IMAGE - PROPERLY FITTED */
.project-image {
  height: 200px;
  overflow: hidden;
  background: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.project-content p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--text-color);
  opacity: 0.9;
  line-height: 1.5;
}

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

.project-tech span {
  background: rgba(0, 255, 0, 0.15);
  color: var(--text-color);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

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

.project-link {
  display: inline-block;
  background: var(--color-primary);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.project-link:hover {
  opacity: 0.9;
}

/* SKILLS */
.skills {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 2rem;
  text-align: center;
}

.skills h4 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.skill-card {
  width: 120px;
  height: 120px;
  background: var(--card-bg);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.skill-card:hover {
  background: var(--color-primary);
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

.skill-card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
}

.skills .skill-card:hover h2 {
  color: #000;
}

/* CONTACT SECTION */
#contact {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 2rem;
}

#contact h2 {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
}

.contact-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: center;
}

#contact form {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#contact label {
  font-weight: 600;
  font-size: 1rem;
}

#contact input,
#contact textarea {
  width: 100%;
  padding: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text-color);
  font-family: var(--font-main);
  font-size: 1rem;
}

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

#contact button {
  background: var(--color-primary);
  color: #000;
  border: none;
  padding: 0.85rem 1.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 6px;
  cursor: pointer;
  width: fit-content;
  align-self: flex-start;
}

#form-message {
  margin-top: 1rem;
  font-weight: 600;
}

/* 3D SPHERE */
.cube-container {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-color);
}

.cube-container p {
  margin-bottom: 2rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

#cube-canvas {
  width: 100%;
  max-width: 400px;
  height: 400px;
  border-radius: 12px;
  background: var(--card-bg);
  cursor: move;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.95rem;
  color: var(--text-color);
  opacity: 0.8;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 1.25rem;
}

.social-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.social-icon:hover {
  transform: translateY(-3px);
}

.social-icon img {
  width: 30px;
  height: 30px;
}

/* UTILITY BUTTONS */
.darkmode {
  position: fixed;
  top: 90px;
  left: 20px;
  display: flex;
  gap: 12px;
  z-index: 999;
}

.darkmode i {
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  transition: all 0.3s;
}

.darkmode i:hover {
  background: var(--color-primary);
  color: #000;
  border-color: var(--color-primary);
}

.scroll-to-up {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
}

.scroll-to-up.show {
  opacity: 1;
  transform: translateY(0);
}

/* LARGE SCREEN OPTIMIZATIONS */
@media (min-width: 1200px) {
  /* Increase container widths for better space utilization */
  .navbar .nav-container,
  .home,
  .timeline-section .container,
  .testimonials .container,
  #projects .container,
  .skills,
  #contact {
    max-width: 1400px;
  }

  /* Enhanced spacing on larger screens */
  .home {
    padding: 6rem 3rem;
  }

  .timeline-section,
  .testimonials,
  #projects {
    padding: 6rem 3rem;
  }

  .skills {
    padding: 0 3rem;
  }

  /* Larger typography scaling */
  .info h2 {
    font-size: 4rem;
  }

  .info h3 {
    font-size: 2rem;
  }

  .timeline-section h2,
  .testimonials h2,
  #projects h2,
  .skills h4,
  #contact h2 {
    font-size: 2.75rem;
  }

  /* Optimize grid layouts for larger screens */
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
  }

  .testimonials-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2.5rem;
  }

  /* Larger skill cards */
  .cards {
    gap: 2.5rem;
  }

  .skill-card {
    width: 140px;
    height: 140px;
  }

  /* Enhanced project cards */
  .project-image {
    height: 220px;
  }

  .project-content h3 {
    font-size: 1.5rem;
  }

  /* Larger home image */
  .home-img {
    flex: 0 0 450px;
  }

  .home-img img {
    max-width: 450px;
  }

  /* Bigger 3D canvas */
  #cube-canvas {
    max-width: 500px;
    height: 500px;
  }
}

@media (min-width: 1600px) {
  /* Ultra-wide screen optimizations */
  .navbar .nav-container,
  .home,
  .timeline-section .container,
  .testimonials .container,
  #projects .container,
  .skills,
  #contact {
    max-width: 1600px;
  }

  .projects-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .info h2 {
    font-size: 4.5rem;
  }

  .home {
    padding: 8rem 4rem;
  }

  .timeline-section,
  .testimonials,
  #projects {
    padding: 8rem 4rem;
  }
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .nav-menu {
    position: fixed;
    left: -100%;
    top: var(--nav-height);
    flex-direction: column;
    background-color: var(--bg-color);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 2rem 0;
  }

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

  .nav-toggle {
    display: block;
  }

  .home-container {
    flex-direction: column;
    text-align: center;
  }

  .home-img {
    order: -1;
    margin-bottom: 2rem;
    flex: 0 0 350px;
  }

  .info p {
    margin-left: auto;
    margin-right: auto;
  }

  #cube-canvas {
    max-width: 300px;
    height: 300px;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    justify-content: flex-start;
    padding-left: 50px;
    padding-right: 0;
  }

  .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    margin: 0;
  }

  .timeline-dot {
    left: 20px;
  }

  .timeline-header {
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media (max-width: 600px) {
  .home {
    padding: 2rem 1.5rem;
  }

  .info h2 {
    font-size: 2.75rem;
  }

  .info h3 {
    font-size: 1.5rem;
  }

  /* TOAST MOBILE RESPONSIVE */
  .toast {
    min-width: 280px;
    max-width: calc(100vw - 20px);
    right: -100%;
    top: 80px;
    padding: 1rem;
  }

  .toast.show {
    right: 10px;
  }

  .toast-body {
    font-size: 0.9rem;
  }

  .toast-title span {
    font-size: 0.95rem;
  }
}