:root {
  --primary-color: #818cf8; /* Lighter indigo for better contrast on dark */
  --bg-color: #111827; /* Dark gray/black background */
  --text-color: #f3f4f6; /* Light text */
  --card-bg: #1f2937; /* Darker gray for cards */
  --nav-height: 70px;
  --sidebar-width: 250px;
}

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

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow: hidden; /* Prevent global scroll */
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

/* Main App Container */
#app-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  width: 100%;
}

/* Views (Screens) */
.view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 20px;
  padding-bottom: calc(
    20px + var(--nav-height)
  ); /* Extra padding for bottom nav */
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view.active-view {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 10;
}

/* Scrollable Content inside Views */
.scrollable-y {
  width: 100%;
  overflow-y: auto;
  flex: 1;
  padding-bottom: 20px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollable-y::-webkit-scrollbar {
  display: none;
}

.view-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1200px; /* Max width for large screens */
  margin: 0 auto;
  width: 100%;
}

.center-content {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.under-dev {
  height: 100%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  text-align: center;

  font-size: 30px;
}

/* Cards */
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Typography */
h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.education-year {
  color: #9ca3af;
}

.view-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-weight: 700;
}

p {
  line-height: 1.6;
  color: #d1d5db; /* Lighter gray for better readability on dark */
}

/* Profile Image */
.profile-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); /* Slightly darker shadow */
  border: 4px solid var(--card-bg); /* Match card bg instead of white */
}

.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bio */
.flex-horizontal {
  display: flex;
  flex-direction: column;
}

.bio-btn {
  border: none;
  border-bottom: 2px solid var(--primary-color);
  color: var(--primary-color);
  background-color: #111827;
  transition: all 2s;
  cursor: pointer;
}

.bio-btn:hover {
  border-bottom: none;
  color: var(--text-color);
}

/* Social Links */
.social-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 15px;
}

.social-links button {
  background: var(--card-bg);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--primary-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.social-links button:active {
  transform: scale(0.9);
}

/* Skills Grid (inside card) */
.skills-grid ul {
  list-style: none;
  padding-left: 0;
}

.skills-grid li {
  margin-bottom: 5px;
  padding-left: 15px;
  position: relative;
}

.skills-grid li::before {
  content: "•";
  color: var(--primary-color);
  position: absolute;
  left: 0;
}

/* Bottom Navigation (Default - Mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--card-bg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 8px;
  width: 100%;
  transition: color 0.3s, background-color 0.3s;
}

.nav-btn i {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.nav-btn.active {
  color: var(--primary-color);
}

.nav-btn span {
  display: block;
}

/* RESPONSIVE DESIGN FOR DESKTOP & TABLET */
@media (min-width: 768px) {
  body {
    flex-direction: row; /* Side-by-side layout */
    background-color: var(--bg-color);
  }

  /* Transform Bottom Nav into Sidebar */
  .bottom-nav {
    position: relative; /* Part of flex flow */
    order: -1; /* Move to left */
    width: var(--sidebar-width);
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 40px;
    bottom: auto;
    left: auto;
    border-right: 1px solid #374151; /* Darker border */
    box-shadow: none;
    transform: none; /* Reset transform */
  }

  .nav-btn {
    flex-direction: row; /* Icon + Text */
    justify-content: flex-start;
    padding: 15px 30px;
    font-size: 1rem;
    width: 100%;
    margin-bottom: 5px;
    border-radius: 0 25px 25px 0;
    margin-right: 10px;
  }

  .nav-btn i {
    margin-bottom: 0;
    margin-right: 15px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
  }

  .nav-btn.active {
    background-color: rgba(99, 102, 241, 0.1); /* Light primary bg */
    border-right: 3px solid var(--primary-color);
  }

  /* Adjust Main Container */
  #app-container {
    height: 100vh;
    border: none;
    max-width: none;
    margin: 0;
    padding: 40px; /* Add breathing room */
  }

  /* View Adjustments */
  .view {
    position: relative; /* In desktop, views fill container */
    padding: 0;
    height: 100%;
    overflow: hidden;
    /* Reset visibility for non-active to keep absolute behavior logic? 
       Actually, keep absolute for transitions, but adjust padding 
    */
    position: absolute;
    padding-bottom: 0; /* No need for bottom nav padding */
  }

  .view-content {
    /* max-width is already set to 1200px */
    align-items: flex-start; /* Left align content generally */
  }

  .center-content {
    align-items: center; /* Keep home centered */
  }

  /* Grid Layouts for Skills and Projects */
  #skills .scrollable-y,
  #projects .scrollable-y {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-right: 10px; /* Space for scrollbar if it appears */
  }

  #skills .card,
  #projects .card {
    margin-bottom: 0; /* Grid handles gap */
  }

  /* Typography bumps */
  h1 {
    font-size: 3.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  .view-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
  }

  /* Profile Image bump */
  .profile-img {
    width: 200px;
    height: 200px;
  }

  /* Social Links bump */
  .social-links button {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
  }
}

/* Books Grid */
.books-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  padding: 10px;
}

.book-item {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--card-bg);
  aspect-ratio: 2/3; /* Standard book ratio */
}

.book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.book-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Adjust grid for desktop */
@media (min-width: 768px) {
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 25px;
  }
}
