@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --radius: 0.625rem;
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);

  /* Light Theme Variables - Modern palette */
  --primary: #3b82f6;
  --primary-light: rgba(59, 130, 246, 0.1);
  --primary-dark: #1e40af;
  --accent: #06b6d4;
  --accent-light: rgba(6, 182, 212, 0.1);
  --background: #ffffff;
  --background-secondary: #f8fafc;
  --foreground: #0f172a;
  --foreground-muted: #475569;
  --muted: #64748b;
  --muted-foreground: #94a3b8;
  --border: #e2e8f0;
  --card-background: #ffffff;
  --card-border: #f1f5f9;
  --radius: 0.75rem;
  --shadow: 0 2px 8px 0 rgb(0 0 0 / 0.08);
  --shadow-md: 0 8px 16px 0 rgb(0 0 0 / 0.1);
  --shadow-lg: 0 12px 24px 0 rgb(0 0 0 / 0.12);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.145 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.145 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.396 0.141 25.723);
  --destructive-foreground: oklch(0.637 0.237 25.331);
  --border: oklch(0.269 0 0);
  --input: oklch(0.269 0 0);
  --ring: oklch(0.439 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(0.269 0 0);
  --sidebar-ring: oklch(0.439 0 0);
}

/* Dark Theme Variables - Enhanced Modern palette */
.dark-theme {
  --primary: #60a5fa;
  --primary-light: rgba(96, 165, 250, 0.1);
  --primary-dark: #1e3a8a;
  --accent: #22d3ee;
  --accent-light: rgba(34, 211, 238, 0.1);
  --background: #0f172a;
  --background-secondary: #1e293b;
  --foreground: #f1f5f9;
  --foreground-muted: #cbd5e1;
  --muted: #94a3b8;
  --muted-foreground: #cbd5e1;
  --border: #1e293b;
  --card-background: #1a2332;
  --card-border: #334155;
  --shadow: 0 2px 8px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 8px 16px 0 rgb(0 0 0 / 0.4);
  --shadow-lg: 0 12px 24px 0 rgb(0 0 0 / 0.5);
}

@theme inline {
  /* optional: --font-sans, --font-serif, --font-mono if they are applied in the layout.tsx */
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
    "Helvetica Neue", sans-serif;
  color: var(--foreground);
  line-height: 1.6;
  background-color: var(--background);
  background-image: linear-gradient(135deg, var(--background) 0%, var(--background-secondary) 100%);
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  color: var(--foreground);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  transform: scale(1.1);
}

.sun-icon {
  display: none;
}

.moon-icon {
  display: block;
}

.dark-theme .sun-icon {
  display: block;
}

.dark-theme .moon-icon {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Canvas Background */
#background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, var(--background) 0%, var(--background-secondary) 100%);
  transition: background-color 0.3s ease;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

@media (min-width: 768px) {
  .section {
    padding: 7rem 0;
  }
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.dark-theme header {
  background: rgba(15, 23, 42, 0.7);
}

header:hover {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: var(--primary-light);
}

.dark-theme header:hover {
  background: rgba(15, 23, 42, 0.95);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.desktop-nav {
  display: none;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
}

.nav-link {
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  width: 100%;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  color: var(--foreground);
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  color: var(--primary);
  transform: translateY(-2px);
}

/* Main Content */
main {
  padding-top: 6rem;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--foreground) 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (min-width: 768px) {
  .section-header h2 {
    font-size: 2.75rem;
  }
}

.section-header p {
  color: var(--muted-foreground);
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.7;
}

/* About Section */
.about-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
  }
}

.profile-image-container {
  display: flex;
  justify-content: center;
}

.profile-image {
  width: 16rem;
  height: 16rem;
  border-radius: 9999px;
  overflow: hidden;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
}

.profile-image:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px var(--primary-light);
}

@media (min-width: 768px) {
  .profile-image {
    width: 20rem;
    height: 20rem;
  }
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--foreground) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (min-width: 768px) {
  .about-content h1 {
    font-size: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .about-content h1 {
    font-size: 3.25rem;
  }
}

.about-content h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .about-content h2 {
    font-size: 1.5rem;
  }
}

.about-content p {
  color: var(--muted-foreground);
  margin-bottom: 2rem;
  line-height: 1.8;
  font-size: 1.0625rem;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .button-group {
    flex-direction: row;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.9375rem;
}

.button svg {
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.button:hover svg {
  transform: translateX(2px);
}

.button.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: 1px solid var(--primary);
  box-shadow: var(--shadow-md);
}

.button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px var(--primary-light);
}

.button.outline {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.button.outline:hover {
  background: var(--primary-light);
  border-color: var(--accent);
}

.button.small {
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
}

.button.full-width {
  width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stat-card:last-child {
  grid-column: span 2;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-card:last-child {
    grid-column: auto;
  }
}

.stat-card {
  background: linear-gradient(135deg, var(--card-background), var(--background-secondary));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Skills Section */
.skills-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .wide-card {
    grid-column: span 2;
  }
}

@media (min-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .wide-card {
    grid-column: auto;
  }
}

.card {
  background: linear-gradient(135deg, var(--card-background), var(--background-secondary));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.card-header {
  padding: 2rem;
  border-bottom: 1px solid var(--card-border);
}

.card-header h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.card-header p {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.card-content {
  padding: 2rem;
}

.card-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  gap: 0.75rem;
}

.skill-item {
  margin-bottom: 1.5rem;
}

.skill-item:last-child {
  margin-bottom: 0;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.skill-header span:last-child {
  color: var(--primary);
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 0.625rem;
  background-color: var(--card-border);
  border-radius: 9999px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Projects Section */
.projects-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-background);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.project-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.08);
}

.project-card .card-header {
  padding: 1.5rem 2rem;
  border: none;
}

.project-card .card-content {
  padding: 0 2rem 1.5rem;
}

.project-card .card-footer {
  padding: 1.5rem 2rem;
  border: none;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  transition: all 0.3s ease;
  border: 1px solid var(--primary-light);
}

.tag:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

/* Contact Section */
.contact-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .contact-grid {
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
  }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-card {
  background: linear-gradient(135deg, var(--card-background), var(--background-secondary));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.contact-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.icon-container {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  color: var(--primary);
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.contact-card h3 {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--foreground);
}

.contact-card p {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.contact-form-container {
  width: 100%;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  background-color: var(--card-background);
  color: var(--foreground);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

/* Footer */
footer {
  border-top: 1px solid var(--card-border);
  margin-top: 6rem;
  transition: all 0.3s ease;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    padding: 2rem 0;
  }
}

.copyright {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-align: center;
}

@media (min-width: 768px) {
  .copyright {
    text-align: left;
  }
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  color: var(--muted);
  transition: all 0.3s ease;
}

.footer-social a:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  color: var(--primary);
  transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .about-content h1 {
    font-size: 1.75rem;
  }

  .section {
    padding: 3rem 0;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.section {
  animation: fadeIn 0.6s ease-out;
}

.card:hover {
  animation: none;
}
