/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Colors */
  --color-bg: #0F172A;         /* Dark Navy - background */
  --color-surface: #1E293B;    /* Card/section background */
  --color-primary: #FF9900;    /* AWS Amber - accent buttons/highlights */
  --color-secondary: #14B8A6;  /* Teal Green - links/hover states */
  --color-text: #E2E8F0;       /* Light gray - main text */
  --color-text-muted: #94A3B8; /* Muted gray - secondary text */
  --color-border: #334155;     /* Subtle borders/dividers */
  --shadow-color: rgba(15, 23, 42, 0.3);

  /* Typography */
  --font-heading: "Source Code Pro", monospace;
  --font-body: "Source Code Pro", monospace;
  --font-mono: "Source Code Pro", monospace;

  /* Spacing */
  --section-padding: 100px 0;
  --container-padding: 0 20px;
  --border-radius: 12px;

  /* Animations */
  --transition: all 0.3s ease;
  --transition-slow: all 0.5s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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

/* ===== LOADING SCREEN ===== */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

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

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

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-surface);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: var(--transition);
  padding: 15px 0;
}

.navbar.scrolled {
  background-color: var(--color-surface);
  padding: 10px 0;
}

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

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-link {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

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

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

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

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger .bar {
  width: 25px;
  height: 3px;
  background-color: var(--color-text);
  margin: 3px 0;
  transition: var(--transition);
}

.hamburger.active .bar:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

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

.hamburger.active .bar:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* ===== HERO SECTION ===== */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

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

.hero-content {
  text-align: center;
  z-index: 2;
  max-width: 800px;
  padding: 0 20px;
}

.hero-name {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}

.greeting {
  display: block;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.name-text {
  background: linear-gradient(
    45deg,
    var(--color-primary),
    var(--color-secondary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.name-text::after {
  content: "|";
  color: var(--color-primary);
  animation: blink 1s infinite;
  margin-left: 5px;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.hero-title {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--color-text-muted);
  margin-bottom: 30px;
  font-weight: 500;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 30px;
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

.btn-primary:hover {
  background-color: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(98, 60, 228, 0.3);
}

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

.btn-secondary:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
  transform: translateY(-2px);
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-text-muted);
  animation: bounce 2s infinite;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-text-muted);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* ===== SECTION STYLES ===== */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--color-text);
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== ABOUT SECTION ===== */
.about {
  padding: var(--section-padding);
  background-color: var(--color-surface);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  align-items: start;
}

.about-image {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.profile-img {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--color-primary);
  box-shadow: 0 4px 24px var(--shadow-color);
  background: var(--color-surface);
}

.about-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-text-muted);
}

.about-text p {
  margin-bottom: 20px;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
}

.stat {
  text-align: center;
  padding: 20px;
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.stat:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--shadow-color);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.skills-grid {
  display: grid;
  gap: 40px;
}

.skill-category h3 {
  font-size: 1.4rem;
  margin-bottom: 25px;
  color: var(--color-text);
}

.skills {
  display: grid;
  gap: 20px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.skill-item:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.skill-item i {
  font-size: 1.5rem;
  color: var(--color-primary);
  width: 30px;
  text-align: center;
}

.skill-item span {
  font-weight: 500;
  min-width: 120px;
}

.skill-progress {
  flex: 1;
  height: 8px;
  background-color: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  margin-left: 15px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary)
  );
  width: 0%;
  transition: width 2s ease;
  border-radius: 4px;
}

/* ===== WORKS SECTION ===== */
.works {
  padding: var(--section-padding);
  background-color: var(--color-bg);
}

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border: 2px solid var(--color-border);
  background-color: transparent;
  color: var(--color-text-muted);
  border-radius: 25px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background-color: rgba(255, 153, 0, 0.1);
}

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

.project-card {
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  opacity: 1;
  transform: scale(1);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px var(--shadow-color);
}

.project-card.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.project-image {
  height: 200px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
  position: relative;
  overflow: hidden;
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-links {
  display: flex;
  gap: 15px;
}

.project-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background-color: var(--color-primary);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  transition: var(--transition);
}

.project-link:hover {
  background-color: var(--color-secondary);
  color: var(--color-bg);
  transform: scale(1.1);
}

.project-content {
  padding: 25px;
}

.project-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--color-text);
}

.project-description {
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  padding: 4px 12px;
  background-color: var(--color-border);
  color: var(--color-text-muted);
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===== CONTACT SECTION ===== */
.contact {
  padding: var(--section-padding);
  background-color: var(--color-surface);
  position: relative;
}

.contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
      circle at 20% 80%,
      rgba(255, 153, 0, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(20, 184, 166, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.contact-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

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

.contact-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.contact-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent-color);
}

.contact-details h4 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: var(--text-color);
}

.contact-details a,
.contact-details p {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-details a:hover {
  color: var(--accent-color);
}

.social-links-container {
  text-align: center;
  margin-top: 2rem;
}

.social-links-container h4 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  color: var(--text-color);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-link {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  font-size: 1.3rem;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--accent-color);
  color: var(--bg-color);
  transform: translateY(-3px);
}

.contact-form {
  background-color: var(--color-surface);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px var(--shadow-color);
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  background-color: var(--color-bg);
  border: 2px solid var(--color-border);
  color: var(--color-text);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.1);
}

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

.error-message {
  display: block;
  color: #ff6b6b;
  font-size: 0.9rem;
  margin-top: 5px;
  opacity: 0;
  transition: var(--transition);
}

.form-group.error .error-message {
  opacity: 1;
}

.form-group.error input,
.form-group.error textarea {
  border-color: #ff6b6b;
}

.contact-form .btn {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.btn-text {
  transition: var(--transition);
}

.btn-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
}

.btn.loading .btn-text {
  opacity: 0;
}

.btn.loading .btn-loader {
  opacity: 1;
}

/* ===== FOOTER ===== */
.footer {
  background-color: var(--color-bg);
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.footer-content {
  color: var(--color-text-muted);
}

.footer-content p {
  margin-bottom: 10px;
}

/* ===== ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Ensure content is visible by default before animations */
.hero-content,
.about-content,
.projects-grid,
.contact-content {
  opacity: 1;
}

/* Fix for sections showing properly */
section {
  opacity: 1;
  visibility: visible;
}

/* Loading screen improvements */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--primary-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Ensure hero content is always visible */
.hero-content {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Animation keyframes */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--color-surface);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 50px;
    transition: var(--transition);
  }

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

  .nav-menu li {
    margin: 20px 0;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-image {
    justify-content: center;
    margin-bottom: 20px;
  }

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

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

  .contact-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-form {
    padding: 30px 20px;
  }

  .filter-buttons {
    gap: 10px;
  }

  .filter-btn {
    padding: 6px 15px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 60px 0;
  }

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

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

  .hero-content {
    padding: 0 15px;
  }

  .contact-form {
    padding: 25px 15px;
  }

  .container {
    padding: 0 15px;
  }
}

/* Contact Section Responsive Styles */
@media screen and (max-width: 992px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media screen and (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-item {
    padding: 1.5rem;
  }

  .contact-icon {
    font-size: 2rem;
  }

  .contact-details h4 {
    font-size: 1.1rem;
  }

  .social-links {
    gap: 1rem;
  }

  .social-link {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
}

@media screen and (max-width: 480px) {
  .contact-item {
    padding: 1rem;
  }

  .contact-details a,
  .contact-details p {
    font-size: 0.9rem;
  }

  .social-links {
    gap: 0.8rem;
  }

  .social-link {
    width: 60px;
    height: 60px;
    font-size: 1rem;
    font-size: 1.5rem;
    text-decoration: none;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .navbar,
  .particles,
  .scroll-indicator,
  .btn,
  .contact-form,
  .social-links {
    display: none !important;
  }

  .hero,
  .about,
  .works,
  .contact {
    padding: 20px 0 !important;
    background: white !important;
  }

  .section-title {
    color: black !important;
    page-break-after: avoid;
  }

  .project-card {
    page-break-inside: avoid;
    background: white !important;
    border: 1px solid #ccc !important;
  }
}
