/* CSS Variables for Theming */
:root {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --text-primary: #333333;
  --text-secondary: #555555;
  --text-muted: #777777;
  --heading-color: #1e3c5a;
  --link-color: #1a73e8;
  --link-hover: #0d47a1;
  --border-color: #e0e0e0;
  --code-bg: #f1f3f4;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --card-hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  --sidebar-bg: linear-gradient(180deg, #1e3c5a 0%, #2d5a7b 100%);
  --sidebar-text: #ffffff;
  --sidebar-link: #a8d4ff;
  --nav-border: #e0e0e0;
  --timeline-line: #1a73e8;
  --transition-speed: 0.3s;
}

[data-theme="dark"] {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --text-primary: #e6edf3;
  --text-secondary: #b1bac4;
  --text-muted: #8b949e;
  --heading-color: #58a6ff;
  --link-color: #58a6ff;
  --link-hover: #79c0ff;
  --border-color: #30363d;
  --code-bg: #161b22;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --card-hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --sidebar-bg: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
  --sidebar-text: #e6edf3;
  --sidebar-link: #58a6ff;
  --nav-border: #30363d;
  --timeline-line: #58a6ff;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Sidebar Styles */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  min-height: 100vh;
  padding: 30px 25px;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: background var(--transition-speed) ease;
}

.profile {
  text-align: center;
  flex: 1;
}

.profile-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin-bottom: 20px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.profile-img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.profile h2 {
  margin: 0 0 8px 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.profile p {
  margin: 0 0 20px 0;
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.5;
}

.sidebar-links {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.sidebar-links li {
  margin-bottom: 12px;
}

.sidebar-links a {
  color: var(--sidebar-link);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-speed) ease;
}

.sidebar-links a:hover {
  color: #fff;
}

/* Theme Toggle Button */
.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  padding: 8px 16px;
  cursor: pointer;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--transition-speed) ease, transform 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.sun-icon, .moon-icon {
  font-size: 1.1rem;
}

[data-theme="dark"] .sun-icon {
  display: inline;
}

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

[data-theme="light"] .sun-icon,
:root:not([data-theme]) .sun-icon {
  display: none;
}

[data-theme="light"] .moon-icon,
:root:not([data-theme]) .moon-icon {
  display: inline;
}

/* Main Content Styles */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 40px 60px;
  max-width: 950px;
  min-height: 100vh;
}

/* Navigation */
nav {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

nav a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition-speed) ease;
  padding: 4px 0;
}

nav a:hover {
  color: var(--link-hover);
}

/* Main Content Area */
main {
  margin-top: 10px;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--heading-color);
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  font-weight: 600;
  line-height: 1.3;
}

h1:first-child, h2:first-child, h3:first-child {
  margin-top: 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  margin-bottom: 1.2em;
  color: var(--text-primary);
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Lists */
ul, ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}

li {
  margin-bottom: 0.6em;
  color: var(--text-primary);
}

/* Code */
code {
  background-color: var(--code-bg);
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

pre {
  background-color: var(--code-bg);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

/* Horizontal Rules */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5em 0;
}

/* Strong/Bold */
strong {
  font-weight: 600;
  color: var(--heading-color);
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--link-color);
  margin: 1.5em 0;
  padding: 0.5em 1em;
  background-color: var(--bg-secondary);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Experience Timeline */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--timeline-line);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
  padding-bottom: 16px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 6px;
  width: 14px;
  height: 14px;
  background: var(--timeline-line);
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
}

.timeline-item h3 {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 1.15rem;
}

.timeline-item .company {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.timeline-item .date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.timeline-item ul {
  margin-top: 8px;
  margin-bottom: 0;
}

.timeline-item li {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

/* Contact Form */
.contact-form {
  max-width: 500px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

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

.contact-form button {
  background-color: var(--link-color);
  color: white;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease, transform 0.2s ease;
}

.contact-form button:hover {
  background-color: var(--link-hover);
  transform: translateY(-1px);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.architecture-img {
  margin: 20px 0;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg-secondary);
}

/* Video Link */
.video-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ff0000;
  color: white !important;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  margin: 16px 0;
  transition: background-color var(--transition-speed) ease, transform 0.2s ease;
}

.video-link:hover {
  background: #cc0000;
  transform: scale(1.02);
  text-decoration: none !important;
}

/* Intro Section */
.intro-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 2em;
}

/* Responsive Design */
@media (max-width: 900px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    position: relative;
    padding: 24px 20px;
  }

  .profile-img {
    width: 120px;
    height: 120px;
  }

  .main-content {
    margin-left: 0;
    padding: 30px 20px;
    max-width: 100%;
  }

  nav {
    gap: 8px 16px;
  }

  nav a {
    font-size: 0.9rem;
  }

  .timeline {
    padding-left: 24px;
  }

  .timeline-item::before {
    left: -20px;
    width: 12px;
    height: 12px;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.15rem; }
}

@media (max-width: 480px) {
  .main-content {
    padding: 20px 16px;
  }

  nav {
    gap: 6px 12px;
  }

  nav a {
    font-size: 0.85rem;
  }

  .contact-form input,
  .contact-form textarea {
    padding: 12px 14px;
  }

  .contact-form button {
    width: 100%;
  }
}
