/* Astra Space-Tech Portfolio Stylesheet */
:root {
  /* HSL Color System */
  --hue-primary: 260; /* Deep Violet */
  --hue-accent: 190;  /* Cyan */
  
  /* Space-Tech Dark Mode (Default) */
  --bg-app: #03000a;
  --bg-card: rgba(10, 5, 25, 0.45);
  --border-card: rgba(255, 255, 255, 0.05);
  --text-primary: #f8fafc;
  --text-secondary: #c7d2fe;
  --text-muted: #64748b;
  
  --primary: hsl(var(--hue-primary), 85%, 65%);
  --primary-hover: hsl(var(--hue-primary), 85%, 72%);
  --accent: hsl(var(--hue-accent), 85%, 55%);
  --accent-light: rgba(6, 182, 212, 0.1);
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 0 15px rgba(139, 92, 246, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 92, 246, 0.1);
  
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-app: #f4f6fc;
  --bg-card: rgba(255, 255, 255, 0.75);
  --border-card: rgba(99, 102, 241, 0.08);
  --text-primary: #1e1b4b;
  --text-secondary: #4f46e5;
  --text-muted: #64748b;
  
  --primary: hsl(var(--hue-primary), 85%, 55%);
  --primary-hover: hsl(var(--hue-primary), 85%, 45%);
  --accent: hsl(var(--hue-accent), 85%, 45%);
  --accent-light: rgba(6, 182, 212, 0.05);
  
  --shadow-sm: 0 4px 6px -1px rgba(99, 102, 241, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(99, 102, 241, 0.12);
}

/* Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Futuristic space backdrop (Non-Bandung) */
.space-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -100;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0d0628 0%, #03000a 80%);
}

[data-theme="light"] .space-bg {
  background: radial-gradient(circle at 50% 50%, #f0f4ff 0%, #e2e8f0 80%);
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
    radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px),
    radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 40px);
  background-size: 550px 550px, 350px 350px, 250px 250px;
  background-position: 0 0, 40px 60px, 130px 270px;
  opacity: 0.15;
  animation: starsSlowMove 60s linear infinite;
}

[data-theme="light"] .stars {
  opacity: 0.05;
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.25;
  z-index: -99;
}

[data-theme="light"] .nebula {
  opacity: 0.12;
}

.nebula-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, rgba(139, 92, 246, 0) 70%);
  top: -100px;
  right: -100px;
}

.nebula-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, rgba(6, 182, 212, 0) 70%);
  bottom: -200px;
  left: -200px;
}

@keyframes starsSlowMove {
  from { background-position: 0 0, 40px 60px, 130px 270px; }
  to { background-position: 550px 550px, 390px 410px, 380px 520px; }
}

/* HEADER styling (Kriteria Wajib 1) */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-card);
  padding: 20px 0;
}

.header-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between; /* Layouting Flexbox */
  align-items: center;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-symbol {
  font-size: 1.4rem;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
  animation: logoPulse 2s infinite alternate ease-in-out;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Nav Menu (Flexbox) */
.nav-menu {
  display: flex; /* Layouting Flexbox */
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  padding: 6px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

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

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

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

@keyframes logoPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.2) rotate(15deg); opacity: 1; }
}

/* LAYOUT WRAPPER (Flexbox - Kriteria Wajib 3) */
.layout-wrapper {
  width: 90%;
  max-width: 1200px;
  margin: 40px auto;
  display: flex; /* Layouting Flexbox */
  flex-direction: row; /* Row layout for sidebar next to content */
  gap: 32px;
  align-items: start;
}

/* ASIDE PROFILE CARD (Kriteria Wajib 2) */
.profile-aside {
  flex: 0 0 350px; /* Sidebar takes 350px fixed width */
  position: sticky;
  top: 100px;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.aside-card {
  padding: 36px 28px;
  display: flex; /* Layouting Flexbox inside card */
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-card);
  z-index: 2;
  position: relative;
}

.avatar-glow {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  z-index: 1;
  filter: blur(8px);
  opacity: 0.65;
  animation: glowCycle 8s infinite alternate ease-in-out;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.profile-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
}

.divider {
  width: 100%;
  height: 1px;
  background-color: var(--border-card);
  margin: 20px 0;
}

.info-list {
  list-style: none;
  width: 100%;
  display: flex; /* Layouting Flexbox */
  flex-direction: column;
  gap: 12px;
}

.info-list li {
  display: flex; /* Layouting Flexbox */
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.info-icon {
  font-size: 1.1rem;
}

.info-val {
  font-weight: 500;
  color: var(--text-primary);
}

.social-links {
  display: flex; /* Layouting Flexbox */
  gap: 16px;
  justify-content: center;
}

.social-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex; /* Layouting Flexbox */
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.social-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

@keyframes glowCycle {
  0% { transform: scale(1) rotate(0deg); opacity: 0.5; }
  100% { transform: scale(1.05) rotate(360deg); opacity: 0.8; }
}

/* MAIN CONTENT AREA (Kriteria Wajib 1) */
.content-main {
  flex: 1; /* Takes all remaining width */
  display: flex; /* Layouting Flexbox */
  flex-direction: column;
  gap: 32px;
}

.section-card {
  padding: 40px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-underline {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  margin-bottom: 24px;
}

.about-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.about-text:last-child {
  margin-bottom: 0;
}

/* SKILLS SECTION (Flexbox column-to-row - Kriteria Wajib 3) */
.skills-flex {
  display: flex; /* Layouting Flexbox */
  flex-wrap: wrap; /* Wrap elements on small screen */
  gap: 20px;
}

.skill-item {
  flex: 1 1 calc(50% - 10px); /* Fit 2 columns in container */
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 24px;
  display: flex; /* Layouting Flexbox */
  flex-direction: column;
  gap: 12px;
}

.skill-item:hover {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.02);
  transform: translateY(-2px);
}

.skill-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.skill-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.skill-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* PORTFOLIO PROJECTS SECTION (Flexbox - Kriteria Wajib 3) */
.projects-flex {
  display: flex; /* Layouting Flexbox */
  flex-wrap: wrap;
  gap: 24px;
}

.project-card {
  flex: 1 1 calc(50% - 12px); /* 2 columns */
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex; /* Layouting Flexbox */
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
}

.project-img-placeholder {
  height: 160px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.prj-1 { background: linear-gradient(135deg, #4f46e5, #818cf8); }
.prj-2 { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.prj-3 { background: linear-gradient(135deg, #7c3aed, #a78bfa); }

.project-tag {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.project-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.project-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.project-tech {
  margin-top: auto;
  display: flex; /* Layouting Flexbox */
  flex-wrap: wrap;
  gap: 6px;
}

.project-tech span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--accent-light);
  padding: 3px 8px;
  border-radius: 6px;
}

/* CONTACT FORM */
.contact-form {
  display: flex; /* Layouting Flexbox */
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: flex; /* Layouting Flexbox */
  gap: 20px;
}

@media (max-width: 576px) {
  .form-row {
    flex-direction: column;
    gap: 20px;
  }
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  gap: 10px;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
  align-self: flex-start;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.4);
}

/* FOOTER ELEMENT (Kriteria Wajib 1) */
.app-footer {
  border-top: 1px solid var(--border-card);
  background-color: rgba(5, 2, 15, 0.5);
  backdrop-filter: blur(12px);
  padding: 24px 0;
  margin-top: 60px;
}

.footer-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex; /* Layouting Flexbox */
  justify-content: space-between;
  align-items: center;
}

.copyright {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.meta-dot {
  opacity: 0.3;
}

/* TOAST notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: rgba(10, 5, 25, 0.85);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--border-card);
  border-left: 4px solid var(--accent);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, toastOut 0.3s ease 2.7s forwards;
}

@keyframes toastIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

/* --- FULL RESPONSIVE MEDIA QUERIES (Mobile-First) --- */

/* Responsive: Tablet Screens (Max width 992px) */
@media (max-width: 992px) {
  .layout-wrapper {
    flex-direction: column; /* Stack aside above main column */
    gap: 32px;
  }
  
  .profile-aside {
    flex: 1 1 100%;
    width: 100%;
    position: static; /* Remove sticky on mobile */
  }

  .aside-card {
    flex-direction: row; /* Horizontal profile card layout on tablets! */
    text-align: left;
    align-items: center;
    gap: 32px;
    padding: 32px;
  }

  .avatar-wrapper {
    margin-bottom: 0;
  }

  .profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .divider {
    margin: 14px 0;
  }

  .info-list {
    flex-direction: row; /* Horizontal list */
    flex-wrap: wrap;
    gap: 16px;
  }

  .social-links {
    justify-content: flex-start;
    margin-top: 12px;
  }
}

/* Responsive: Mobile Screens (Max width 768px) */
@media (max-width: 768px) {
  .nav-menu {
    gap: 16px;
  }

  .aside-card {
    flex-direction: column; /* Reset back to vertical stacked on smartphones */
    text-align: center;
    padding: 28px 20px;
    gap: 20px;
  }

  .avatar-wrapper {
    width: 130px;
    height: 130px;
  }

  .info-list {
    flex-direction: column;
    align-items: center;
  }

  .info-list li {
    justify-content: center;
  }

  .social-links {
    justify-content: center;
  }

  .section-card {
    padding: 24px;
  }

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

  .skill-item {
    flex: 1 1 100%;
  }

  .projects-flex {
    flex-direction: column;
  }

  .project-card {
    flex: 1 1 100%;
  }

  .footer-container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* Ultra Small Screens (Max width 480px) */
@media (max-width: 480px) {
  .header-container {
    flex-direction: column;
    gap: 12px;
  }
  
  .nav-menu {
    gap: 12px;
  }

  .btn-primary {
    align-self: stretch;
  }
}
