/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "SF Pro Rounded", "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: #f5f5f5;
  color: #222;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  gap: 2rem;
  font-weight: 400;
}

/* Header & Navigation */
header {
  padding: 1rem;
  background: transparent;
  flex-shrink: 0;
}

header nav.navbar {
  background: var(--header-bg);
  border: 1px solid var(--border-color);
  box-shadow: 
    0 4px 15px rgba(0, 119, 255, 0.1),
    0 8px 30px rgba(0, 119, 255, 0.15);
  border-radius: 24px;
  margin: 0 auto;
  max-width: 1200px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

header nav.navbar:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(0, 119, 255, 0.15),
    0 15px 45px rgba(0, 119, 255, 0.2);
}

.navbar {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: #222;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
  height: 100%;
}

.nav-links a {
  color: #222;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  letter-spacing: -0.3px;
  display: inline-flex;
  align-items: center;
  height: 38px;
}

.nav-links a:hover {
  color: #0077ff;
  background: rgba(0, 119, 255, 0.1);
}

/* Buttons */
button {
  background: #0077ff;
  border: none;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
  background: #005bb5;
  transform: scale(1.05);
}

/* Containers */
.container {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin: 1.5rem auto;
  max-width: 800px;
}

/* Main container */
.main {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
}

.intro, .about, .projects {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Content sections */
.intro-card, .about-grid, .project-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Additional rounded elements */
input, 
select, 
textarea {
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 1rem;
}

img {
  border-radius: 16px;
}

.card,
.box,
.section {
  border-radius: 24px;
}

/* Footer */
footer {
  padding: 0 2rem 1rem;
  background: transparent;
  margin-top: auto;
  flex-shrink: 0;
}

.footer-content {
  background: var(--header-bg);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  text-align: center;
  color: var(--text-color);
  font-size: 0.9rem;
  border-radius: 20px;
  margin: 0 auto;
  max-width: 900px;
  box-shadow: 
    0 4px 15px rgba(0, 119, 255, 0.1),
    0 8px 30px rgba(0, 119, 255, 0.15);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.footer-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--button-bg), #00aaff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.footer-content:hover::before {
  opacity: 1;
}

.footer-content:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(0, 119, 255, 0.15),
    0 15px 45px rgba(0, 119, 255, 0.2);
}

/* Dark theme styles */
:root {
  --bg-color: #f5f5f5;
  --text-color: #222;
  --header-bg: #ffffff;
  --border-color: #e0e0e0;
  --hover-color: rgba(0, 119, 255, 0.1);
  --button-bg: #0077ff;
  --button-hover: #005bb5;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #ffffff;
  --header-bg: #2d2d2d;
  --border-color: #404040;
  --hover-color: rgba(255, 255, 255, 0.1);
  --button-bg: #0077ff;
  --button-hover: #005bb5;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
}

.logo {
  color: var(--text-color);
}

.nav-links a {
  color: var(--text-color);
}

.nav-links a:hover {
  background: var(--hover-color);
}

.container, .card, .box, .section {
  background: var(--header-bg);
  border: 1px solid var(--border-color);
}

footer {
  background: var(--header-bg);
  border-top: 1px solid var(--border-color);
  color: var(--text-color);
}

/* Theme toggle button */
.theme-toggle {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: 0.5rem;
}

.theme-toggle:hover {
  background: var(--hover-color);
  transform: rotate(360deg);
}

/* Project Grid and Cards */
.projects {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.projects h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
  background: linear-gradient(45deg, #0066dd, #66ddff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.project-card {
  background: var(--header-bg);
  border-radius: 20px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: 
    0 4px 15px rgba(0, 119, 255, 0.1),
    0 8px 30px rgba(0, 119, 255, 0.15);
  transform: translateY(0);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #0066dd, #66ddff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 
    0 8px 25px rgba(0, 119, 255, 0.15),
    0 15px 45px rgba(0, 119, 255, 0.2);
}

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

.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.project-content p {
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.tag {
  background: var(--hover-color);
  color: var(--text-color);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.project-link {
  color: var(--button-bg);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.project-link:hover {
  transform: translateX(5px);
}

/* Home Page Styles */
.intro {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.intro-card {
  background: var(--header-bg);
  border-radius: 24px;
  padding: 2.5rem;
  margin: 2rem auto;
  border: 1px solid var(--border-color);
  box-shadow: 
    0 4px 15px rgba(0, 119, 255, 0.1),
    0 8px 30px rgba(0, 119, 255, 0.15);
  transition: all 0.3s ease;
  max-width: 900px;
  position: relative;
  overflow: hidden;
}

.intro-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--button-bg), #00aaff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.intro-card:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 8px 25px rgba(0, 119, 255, 0.15),
    0 15px 45px rgba(0, 119, 255, 0.2);
}

.intro-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #0066dd, #66ddff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-text {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  color: var(--text-color);
  opacity: 0.9;
  font-weight: 400;
  letter-spacing: -0.2px;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.primary-button, .secondary-button {
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.primary-button {
  background: var(--button-bg);
  color: white;
}

.secondary-button {
  background: var(--hover-color);
  color: var(--text-color);
}

.primary-button:hover, .secondary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 119, 255, 0.2);
}

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

.skill-card {
  background: var(--hover-color);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  position: relative;
  box-shadow: 
    0 4px 15px rgba(0, 119, 255, 0.1);
}

.skill-card:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 4px 15px rgba(0, 119, 255, 0.15),
    0 8px 30px rgba(0, 119, 255, 0.2);
}

.skill-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.skill-card p {
  font-size: 0.95rem;
  color: var(--text-color);
  opacity: 0.9;
  line-height: 1.4;
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.1),
    0 15px 45px rgba(0, 119, 255, 0.15);
}

/* About Page Styles */
.about {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.about-card {
  background: var(--header-bg);
  border-radius: 20px;
  padding: 1.75rem;
  border: 1px solid var(--border-color);
  box-shadow: 
    0 4px 15px rgba(0, 119, 255, 0.1),
    0 8px 30px rgba(0, 119, 255, 0.15);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--button-bg), #00aaff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.about-card:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 8px 25px rgba(0, 119, 255, 0.15),
    0 15px 45px rgba(0, 119, 255, 0.2);
}

.main-info {
  grid-column: 1 / -1;
}

.main-info h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(45deg, #0066dd, #66ddff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.skill-bar {
  height: 8px;
  background: var(--hover-color);
  border-radius: 4px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--button-bg), #00aaff);
  border-radius: 4px;
  transition: width 1s ease;
}

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

.interest-tag {
  background: var(--hover-color);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.interest-tag:hover {
  transform: translateY(-2px);
  background: var(--button-bg);
  color: white;
}

/* Sub-islands styling */
.sub-island {
  background: var(--hover-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 0.75rem 0;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 
    0 4px 12px rgba(0, 119, 255, 0.08);
}

.sub-island:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 8px 20px rgba(0, 119, 255, 0.12),
    0 12px 28px rgba(0, 119, 255, 0.15);
}

.sub-island::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0066dd, #66ddff);
  border-radius: 16px 16px 0 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sub-island:hover::before {
  opacity: 1;
}

.sub-island h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.sub-island p {
  font-size: 0.95rem;
  color: var(--text-color);
}

.sub-islands-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0;
}

/* Carousel Styles */
.carousel {
  position: relative;
  overflow: hidden;
  padding: 0.5rem 2rem;
  margin: 0 -2rem;
}

/* Navigation hover zones */
.carousel-nav-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-nav-zone.left {
  left: 0;
}

.carousel-nav-zone.right {
  right: 0;
}

.carousel-nav-zone.bottom {
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  top: auto;
  width: 120px;
  height: 40px;
}

.carousel-button, .carousel-dots {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carousel-nav-zone.left:hover .carousel-button.prev,
.carousel-nav-zone.right:hover .carousel-button.next,
.carousel-nav-zone.bottom:hover .carousel-dots {
  opacity: 1;
}

.carousel-container {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-slide {
  min-width: 100%;
  opacity: 1;
  transition: all 0.3s ease;
  padding: 0 2rem;
}

/* Ensure sub-islands within carousel have proper spacing */
.carousel .sub-island {
  margin: 0;
  width: 100%;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  pointer-events: none;
}

.carousel:hover .carousel-dots {
  pointer-events: all;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-color);
  opacity: 0.3;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  opacity: 1;
  background: linear-gradient(90deg, #0066dd, #66ddff);
}

.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--header-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease, opacity 0.3s ease;
  z-index: 2;
  box-shadow: 
    0 4px 12px rgba(0, 119, 255, 0.1);
  color: var(--text-color);
  font-size: 1.2rem;
  font-weight: 500;
  pointer-events: none;
}

.carousel:hover .carousel-button {
  pointer-events: all;
}

.carousel-button:hover {
  background: var(--hover-color);
  transform: translateY(-50%) scale(1.1);
}

.carousel-button.prev {
  left: 1rem;
}

.carousel-button.next {
  right: 1rem;
}

.carousel .skills-tags {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.carousel .skills-tags .tag {
  display: inline-block;
  margin: 0;
}

@media (max-width: 768px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
  
  .projects {
    padding: 1rem;
  }
  
  .project-card {
    padding: 1.5rem;
  }

  .intro-card {
    padding: 2rem;
  }

  .intro-content h1 {
    font-size: 2rem;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .skill-card {
    padding: 1.25rem;
  }
  
  .skill-card h3 {
    font-size: 1.1rem;
  }

  .sub-islands-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .carousel-button {
    display: none;
  }
}
