/* --- EXISTING STYLES UPDATED & NEW SECTIONS ADDED --- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, sans-serif;
}

body {
  background-color: #0f172a;
  color: #f8fafc;
  line-height: 1.6;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background-color: #1e293b;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #334155;
}

header nav a {
  color: #94a3b8;
  margin-left: 1.5rem;
  text-decoration: none;
  font-weight: 500;
}

header nav a:hover {
  color: #38bdf8;
}

header .logo-link {
  color: #f8fafc;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: bold;
}

header .logo-link:hover {
  color: #38bdf8;
}

/* New Hero Section Styling */
.hero-section {
  padding: 5rem 1rem 4rem;
  background: radial-gradient(circle at top right, #1e293b 0%, #0f172a 70%);
  display: flex;
  justify-content: center;
}

.hero-content {
  max-width: 1100px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap-reverse;
}

.hero-text {
  flex: 1;
  min-width: 280px;
}

.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  background: #0369a1;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stat-item {
  background: #1e293b;
  border: 1px solid #334155;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.hero-image-container {
  flex: 0 0 240px;
  display: flex;
  justify-content: center;
  perspective: 1000px; /* Enables the 3D depth effect */
}

.futuristic-frame {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(45deg, #38bdf8, #6366f1, #ec4899);
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform; /* Forces hardware acceleration */
  transition: transform 0.1s ease-out;
  animation: pulse-glow 4s ease-in-out infinite;
}

.futuristic-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #0f172a;
  pointer-events: none;
  backface-visibility: hidden; /* Prevents flickering during the 3D spin */
  -webkit-font-smoothing: antialiased;
}

/* Coin Spin Animation (PokéStop style) */
@keyframes coinSpin {
  0% {
    transform: translateY(0) rotateY(0deg) translateZ(0);
  }
  50% {
    transform: translateY(-25px) rotateY(360deg) translateZ(0);
  }
  100% {
    transform: translateY(0) rotateY(720deg) translateZ(0);
  }
}

/* When the secret click happens, we override it with the spin animation */
.futuristic-frame.spinning {
  /* Pause the breathing glow so it doesn't fight the spin */
  animation: coinSpin 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

/* Enhanced glow animation with wider spread and brighter colors */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3), 
                inset 0 0 6px rgba(56, 189, 248, 0.15);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 32px rgba(129, 140, 248, 0.6), 
                inset 0 0 14px rgba(129, 140, 248, 0.35);
    filter: brightness(1.08);
  }
}

.wave-emoji {
  display: inline-block;
  transform-origin: 70% 70%; /* Pivots from the wrist/bottom of the hand */
  animation: wave-animation 2.5s infinite;
  -webkit-text-fill-color: initial; /* Resets the transparency inheritance */
}

@keyframes wave-animation {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #94a3b8;
  margin-bottom: 1.5rem;
  min-height: 2rem; /* Prevents layout shifting while text deletes */
}

#typed-output {
  color: #38bdf8;
  font-weight: 600;
}

.typing-cursor {
  display: inline-block;
  font-weight: bold;
  color: #38bdf8;
  margin-left: 2px;
  animation: cursor-blink 0.7s infinite;
}

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

.hero-typing-container {
  font-size: 1.35rem;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 0.8rem;
  min-height: 2rem;
}

.hero-bio {
  color: #94a3b8;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}



/* Skills & Capabilities Section */
.skills-section {
  max-width: 1100px;
  margin: 4rem auto;
  padding: 0 1rem;
}

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

.skill-card {
  background: #1e293b;
  border: 1px solid #334155;
  padding: 1.2rem;
  border-radius: 10px;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #0f172a;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 4px;
}

/* Timeline / Experience & Education Section */
.timeline-section {
  max-width: 1100px;
  margin: 4rem auto;
  padding: 0 1rem;
}

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

.tab-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 0.6rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.tab-btn.active, .tab-btn:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

.timeline-content {
  display: none;
}

.timeline-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.timeline-item {
  background: #1e293b;
  border-left: 4px solid #38bdf8;
  padding: 1.5rem;
  border-radius: 0 10px 10px 0;
  border: 1px solid #334155;
  max-width: 800px;
  margin: 0 auto;
}

.timeline-date {
  color: #38bdf8;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

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

.projects-section {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1rem;
}

h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

/* Filters */
.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  background-color: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
  background-color: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

/* Grid & Cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.project-card .tags-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: #38bdf8;
}

.card-preview {
  height: 160px;
  background-color: #0f172a;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .card-preview img {
  transform: scale(1.05);
}

.tag {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.75rem;
  background-color: #0369a1;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: #1e293b;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  position: relative;
  border: 1px solid #334155;
}

.close-btn {
  position: absolute;
  top: 10px; right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #94a3b8;
}
.close-btn:hover { color: #fff; }

.modal-links {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.modal-links a {
  background-color: #0284c7;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 5px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-img-container {
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-img-container img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
}

/* Split Contact Section */
.contact-section {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.contact-split-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  background: #1e293b;
  padding: 2.5rem;
  border-radius: 12px;
  border: 1px solid #334155;
  margin-top: 2rem;
}

.contact-left h3 {
  margin-bottom: 1rem;
}

.contact-left p {
  color: #94a3b8;
  margin-bottom: 1.5rem;
}

.location-pref {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.quick-contact-col {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.contact-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
}

.contact-badge svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.contact-badge.wa { background-color: #16a34a; }
.contact-badge.tg { background-color: #0284c7; }
.contact-badge.li { background-color: #0a66c2; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.3rem;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.form-group input, .form-group textarea {
  padding: 0.8rem;
  background-color: #0f172a;
  border: 1px solid #334155;
  color: white;
  border-radius: 6px;
}

.submit-btn {
  background-color: #0284c7;
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.submit-btn:hover {
  background-color: #0369a1;
}

footer {
  text-align: center;
  padding: 2rem;
  color: #64748b;
  border-top: 1px solid #1e293b;
  margin-top: 3rem;
}

@media(max-width: 768px) {
  .contact-split-container {
    grid-template-columns: 1fr;
  }
}