@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap");

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

:root {
  /* Dark Theme (Default) */
  --primary: #0f172a;
  --secondary: #1e293b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --card-bg: rgba(30, 41, 59, 0.6);
  --card-border: rgba(51, 65, 85, 0.4);
  --success: #10b981;
  --nav-bg: rgba(15, 23, 42, 0.9);
}

.light-theme {
  --primary: #f8fafc;
  --secondary: #f1f5f9;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --card-bg: rgba(255, 255, 255, 0.8);
  --card-border: rgba(226, 232, 240, 0.8);
  --nav-bg: rgba(255, 255, 255, 0.9);
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, Arial, sans-serif;
  background: linear-gradient(135deg, var(--primary) 0%, #1a1f3a 100%);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease-in forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-link {
  position: relative;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.3s;
}

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

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

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (max-width: 480px) {
  .card { padding: 1rem; border-radius: 10px; }
}

@media (max-width: 768px) {
  .card { padding: 1.25rem; }
}

.card:hover {
  background: var(--secondary);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
}

.skill-card { text-align: center; }

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

@media (max-width: 480px) {
  .skill-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
}

@media (max-width: 768px) {
  .skill-icon { font-size: 2rem; margin-bottom: 0.875rem; }
}

.project-card { overflow: hidden; border-radius: 12px; }

.project-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s;
}

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

.project-content { padding: 1.5rem; background: rgba(15, 23, 42, 0.8); }

.project-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.3s;
  margin-right: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .project-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    margin-right: 0.25rem;
    margin-top: 0.75rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
}

.project-btn:hover {
  background: #2563eb;
  transform: translateX(2px);
}

.project-btn.secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.project-btn.secondary:hover {
  background: var(--accent);
  color: white;
}

.video-showcase {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(51, 65, 85, 0.4);
  margin-bottom: 2rem;
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .video-container {
    aspect-ratio: 4 / 3;
  }
}

.video-container video,
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(30, 41, 59, 0.3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-showcase:hover .video-overlay { opacity: 1; }

.play-icon {
  width: 60px;
  height: 60px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
  animation: pulse-play 2s infinite;
}

@keyframes pulse-play {
  0%, 100% { box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 10px 50px rgba(59, 130, 246, 0.6); }
}

.video-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: rgba(51, 65, 85, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 0.5rem;
}

.dashboard-demo {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f1729 50%, #1a2540 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
  animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
  0% { background: linear-gradient(135deg, #1e3a5f 0%, #0f1729 50%, #1a2540 100%); }
  50% { background: linear-gradient(135deg, #2d5a8f 0%, #1a2f4a 50%, #1e4560 100%); }
  100% { background: linear-gradient(135deg, #1e3a5f 0%, #0f1729 50%, #1a2540 100%); }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 90%;
  height: 80%;
}

@media (max-width: 480px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    width: 95%;
    gap: 0.5rem;
    height: auto;
  }
}

.dashboard-card {
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 1rem;
  animation: slideUp 1s ease-out forwards;
  opacity: 0;
}

.dashboard-card:nth-child(1) { animation-delay: 0s; }
.dashboard-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-card:nth-child(3) { animation-delay: 0.4s; }
.dashboard-card:nth-child(4) { animation-delay: 0.6s; }

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

.dashboard-card h4 {
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.dashboard-bar {
  background: linear-gradient(90deg, var(--accent), #1d4ed8);
  height: 8px;
  border-radius: 4px;
  margin: 0.5rem 0;
  animation: expandWidth 2s ease infinite;
}

@keyframes expandWidth {
  0%, 100% { width: 100%; opacity: 0.5; }
  50% { opacity: 1; }
}

.dashboard-value {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  margin-top: 0.5rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.3s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

@media (max-width: 480px) {
  .btn-primary {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    min-height: 44px;
    width: 100%;
  }
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(51, 65, 85, 0.4);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s;
}

.social-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-3px);
}

.contact-info-item {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: all 0.3s;
}

.contact-info-item:hover {
  background: var(--secondary);
  border-color: var(--accent);
}

.contact-info-item h4 {
  color: var(--accent);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.contact-info-item a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.3s;
}

.contact-info-item a:hover {
  text-decoration: underline;
}

.experience-item {
  padding: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 2rem;
}

.experience-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.experience-date {
  color: var(--accent);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.experience-company {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.experience-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.experience-list {
  list-style: none;
}

.experience-list li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}

.experience-list li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.skill-tag {
  display: inline-block;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.stat-box {
  text-align: center;
  padding: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

section {
  padding: 4rem 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (max-width: 480px) {
  section { padding: 1.5rem 1rem; }
  h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
}

h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.profile-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 50%;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  overflow: hidden;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.profile-frame::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  background: conic-gradient(
    transparent, 
    var(--accent), 
    transparent 30%, 
    var(--accent), 
    transparent 60%, 
    var(--accent), 
    transparent
  );
  animation: rotate 4s linear infinite;
  z-index: 0;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .profile-frame { max-width: 200px; }
}

.profile-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  border: 4px solid var(--primary);
}

.profile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

@media (max-width: 480px) {
  .logo { width: 30px; height: 30px; }
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.image {
  width: 100%;
  max-width: 370px;
  height: 370px;
  border-radius: 60%;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.04),
    0 0 35px rgba(90, 130, 220, 0.35);
  object-fit: cover;
}

@media (max-width: 480px) {
  .image {
    max-width: 250px;
    height: 250px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .card {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
  }
  .card:active {
    background: var(--secondary);
    border-color: var(--accent);
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hero Animation */
.hero-animation-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.light-theme .hero-animation-container {
  opacity: 0.25;
}

.grid-mesh {
  position: absolute;
  width: 200%;
  height: 200%;
  background-image: 
    linear-gradient(var(--accent) 1px, transparent 1px),
    linear-gradient(90deg, var(--accent) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(500px) rotateX(60deg) translateY(-20%);
  animation: meshFlow 25s linear infinite;
}

@keyframes meshFlow {
  from { transform: perspective(500px) rotateX(60deg) translateY(-20%); }
  to { transform: perspective(500px) rotateX(60deg) translateY(0%); }
}

.data-node {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 25px var(--accent), 0 0 45px var(--accent);
  animation: pulseNode 3s ease-in-out infinite alternate;
}

.n1 { top: 20%; left: 10%; background: #60a5fa; box-shadow: 0 0 25px #60a5fa; animation-delay: 0s; }
.n2 { top: 70%; left: 85%; background: var(--accent); animation-delay: 1s; }
.n3 { top: 35%; left: 90%; background: #38bdf8; box-shadow: 0 0 25px #38bdf8; animation-delay: 0.5s; }
.n4 { top: 80%; left: 15%; background: var(--accent); animation-delay: 1.5s; }

.data-path {
  position: absolute;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  height: 2px;
  width: 400px;
  animation: dataFlow 6s linear infinite;
}

.p1 { top: 35%; left: -10%; transform: rotate(10deg); }
.p2 { top: 65%; right: -10%; transform: rotate(-10deg); animation-duration: 8s; }

@keyframes pulseNode {
  from { transform: scale(1); opacity: 0.6; }
  to { transform: scale(2.2); opacity: 1; }
}

@keyframes dataFlow {
  from { transform: translateX(-100%) rotate(10deg); opacity: 0; }
  50% { opacity: 0.7; }
  to { transform: translateX(400%) rotate(10deg); opacity: 0; }
}

.floating-icon {
  position: absolute;
  color: var(--accent);
  font-size: 2.5rem;
  opacity: 0.6;
  filter: drop-shadow(0 0 10px var(--accent));
  animation: floatDrift 20s linear infinite;
}

.i1 { top: 10%; left: 15%; animation-duration: 25s; }
.i2 { top: 55%; left: 8%; animation-duration: 22s; animation-delay: -5s; }
.i3 { top: 20%; right: 12%; animation-duration: 30s; animation-delay: -2s; }
.i4 { bottom: 15%; right: 8%; animation-duration: 28s; animation-delay: -10s; }

@keyframes floatDrift {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(50px, -70px) rotate(15deg); }
  66% { transform: translate(-30px, 40px) rotate(-15deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  margin-left: 1rem;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.1);
}

.theme-toggle i {
  font-size: 1.1rem;
}

.light-theme .fa-sun { display: none; }
body:not(.light-theme) .fa-moon { display: none; }

/* Mobile Navbar Styling */
#menu-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

#menu-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

#menu-btn:active {
  transform: scale(0.95);
}

#mobile-menu {
  animation: slideDown 0.3s ease;
  background: var(--secondary);
}

#mobile-menu.hidden {
  animation: slideUp 0.3s ease;
  display: none !important;
}

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

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

#mobile-menu a {
  padding: 12px 0;
  display: block;
  transition: all 0.3s ease;
}

#mobile-menu a:active {
  background: var(--accent-hover);
  border-radius: 4px;
  padding-left: 12px;
}

/* Responsive header and nav */
@media (max-width: 768px) {
  header {
    position: fixed !important;
    width: 100%;
    z-index: 50;
  }

  nav {
    padding: 12px 16px !important;
  }

  .navbar-brand {
    font-size: 14px;
    gap: 0.5rem;
  }

  .navbar-brand .logo {
    width: 32px;
    height: 32px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    margin-left: 0.5rem;
  }

  .theme-toggle i {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 10px 12px !important;
  }

  .navbar-brand {
    font-size: 12px;
    min-width: 0;
  }

  .navbar-brand .logo {
    width: 28px;
    height: 28px;
  }

  .navbar-brand img + span {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #menu-btn {
    width: 40px;
    height: 40px;
  }

  #menu-btn i {
    font-size: 18px;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
    margin-left: 0.25rem;
  }

  .theme-toggle i {
    font-size: 0.9rem;
  }

  #mobile-menu {
    padding: 0 12px !important;
    gap: 2px;
  }

  #mobile-menu a {
    padding: 10px 8px;
    font-size: 14px;
  }
}
