/* CSS Variables & Theme Setup */
:root[data-theme="dark"] {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #311042 100%);
  --glass-bg: rgba(15, 23, 42, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(0, 0, 0, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-primary: #818cf8; /* Indigo */
  --accent-secondary: #f472b6; /* Pink */
  --accent-glow: rgba(129, 140, 248, 0.4);
  --card-bg-hover: rgba(255, 255, 255, 0.04);
  --input-bg: rgba(15, 23, 42, 0.6);
  --nav-bg: rgba(15, 23, 42, 0.6);
  --blob-1: rgba(99, 102, 241, 0.15);
  --blob-2: rgba(236, 72, 153, 0.15);
  --blob-3: rgba(147, 51, 234, 0.15);
}

:root[data-theme="light"] {
  --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #dbeafe 100%);
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-shadow: rgba(15, 23, 42, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-primary: #4f46e5; /* Deeper Indigo */
  --accent-secondary: #db2777; /* Deeper Pink */
  --accent-glow: rgba(79, 70, 229, 0.25);
  --card-bg-hover: rgba(0, 0, 0, 0.02);
  --input-bg: rgba(255, 255, 255, 0.7);
  --nav-bg: rgba(255, 255, 255, 0.7);
  --blob-1: rgba(99, 102, 241, 0.08);
  --blob-2: rgba(236, 72, 153, 0.08);
  --blob-3: rgba(147, 51, 234, 0.08);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.2s ease;
}

body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-x: hidden;
  position: relative;
}

/* Animated Ambient Blobs */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 25s infinite ease-in-out alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: var(--blob-1);
  animation-duration: 20s;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: var(--blob-2);
  animation-duration: 28s;
  animation-delay: -5s;
}

.blob-3 {
  top: 40%;
  left: 30%;
  width: 40vw;
  height: 40vw;
  background: var(--blob-3);
  animation-duration: 24s;
  animation-delay: -10s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(5%, 10%) scale(1.1) rotate(180deg);
  }
  100% {
    transform: translate(-5%, -5%) scale(0.9) rotate(360deg);
  }
}

/* Main Container (Glassmorphic) */
.container {
  width: 100%;
  max-width: 960px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 20px 50px var(--glass-shadow);
  padding: 3rem;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 3.5rem;
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
    gap: 2rem;
    margin-top: 1rem;
  }
}

/* Left Column: Profile Card */
.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid var(--glass-border);
  padding-right: 3rem;
}

@media (max-width: 900px) {
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    padding-right: 0;
    padding-bottom: 2.5rem;
  }
}

/* Animated Avatar Container */
.avatar-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 1.5rem;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 8px 30px var(--accent-glow);
  animation: pulseGlow 4s infinite alternate;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 8px 25px var(--accent-glow);
  }
  100% {
    box-shadow: 0 12px 35px rgba(244, 114, 182, 0.5);
  }
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--glass-bg);
  overflow: hidden;
}

.avatar svg {
  width: 80px;
  height: 80px;
  fill: var(--text-primary);
}

.name {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.role-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 99px;
  background: rgba(129, 140, 248, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.25);
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Typing Animation Subtitle */
.typing-text-container {
  font-size: 0.95rem;
  color: var(--text-secondary);
  height: 3.5rem;
  margin-bottom: 2rem;
  max-width: 260px;
  line-height: 1.5;
}

.cursor {
  display: inline-block;
  width: 2px;
  background-color: var(--accent-primary);
  margin-left: 3px;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  50% { background-color: transparent; }
}

/* Social Icons */
.social-links {
  display: flex;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--accent-glow);
  border-color: var(--accent-primary);
}

.social-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Right Column: Navigation & Content */
.main-content {
  display: flex;
  flex-direction: column;
}

/* Navigation Bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1rem;
  position: relative;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-item {
  position: relative;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.tab-btn:hover,
.page-link:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-primary);
  background: rgba(129, 140, 248, 0.1);
}

.page-link {
  display: inline-flex;
  align-items: center;
  min-height: 43px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
}

/* Dark/Light Toggle Switch */
.theme-toggle {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: rotate(15deg) scale(1.05);
  background: var(--card-bg-hover);
  border-color: var(--accent-primary);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Theme toggle icons */
.theme-toggle .sun-icon {
  display: none;
}

:root[data-theme="light"] .theme-toggle .moon-icon {
  display: none;
}

:root[data-theme="light"] .theme-toggle .sun-icon {
  display: block;
}

/* Content Sections */
.tab-content-panel {
  display: none;
  animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tab-content-panel.active {
  display: block;
}

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

/* Profile Section styling */
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 99px;
}

.bio-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

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

@media (max-width: 600px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

.info-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.info-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.info-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Skills Section Styling */
.skill-category {
  margin-bottom: 2rem;
}

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

.skills-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skill-badge {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px var(--glass-shadow);
  cursor: default;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-badge:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent-primary);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 15px var(--accent-glow);
}

.skill-badge svg {
  width: 20px;
  height: 20px;
}

/* Progress skills */
.skills-bars {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.skill-bar-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.skill-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

:root[data-theme="light"] .skill-bar-track {
  background: rgba(0, 0, 0, 0.08);
}

.skill-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  width: 0%; /* Animated via JS */
  transition: width 1.5s cubic-bezier(0.1, 0.8, 0.3, 1);
}

/* Projects Section Styling */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 650px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 20px var(--glass-shadow);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.1) 0%, rgba(244, 114, 182, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 0;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(129, 140, 248, 0.4);
  box-shadow: 0 15px 30px var(--accent-glow);
}

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

.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(129, 140, 248, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.project-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.project-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex-grow: 1;
  position: relative;
  z-index: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.project-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-weight: 500;
}

:root[data-theme="light"] .project-tag {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Contact Section Styling */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

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

.form-input, .form-textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  outline: none;
  transition: all 0.3s ease;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.submit-btn {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 2rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--accent-glow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.4);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(16, 185, 129, 0.9);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 999;
  transform: translateY(150%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* Footer styling */
footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  z-index: 1;
}
