/* ===================== Variables ===================== */
:root {
  --bg-light: #fdfdfd;
  --bg-dark: #0f172a;
  --text-light: #1e293b;
  --text-dark: #f1f5f9;
  --accent: #3b82f6;
  --card-radius: 15px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
  line-height: 1.6;
  scroll-behavior: smooth;
  transition: 0.4s;
}

body.dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

/* ===================== Navigation ===================== */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 25px;
  padding: 15px 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  z-index: 100;
  font-weight: 500;
  transition: 0.3s;
}

body.dark nav {
  background: rgba(15, 23, 42, 0.85);
}

nav a {
  color: var(--text-light);
  text-decoration: none;
  transition: 0.3s;
}

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

/* ===================== Theme Toggle ===================== */
.toggle-btn {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 200;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ===================== Container ===================== */
.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
  padding-top: 100px;
}

section {
  margin-bottom: 80px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================== Headings ===================== */
h2 {
  text-align: center;
  color: var(--accent);
  font-size: 2rem;
  margin-bottom: 40px;
  font-weight: 600;
}

/* ===================== Hero / About ===================== */
.hero {
  text-align: center;
  padding: 80px 20px;
}

.profile-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hero p.intro {
  font-size: 1.1rem;
  max-width: 650px;
  margin: auto;
  margin-bottom: 20px;
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: 10px;
  text-decoration: none;
}

/* ===================== Grid ===================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* ===================== Cards ===================== */
.card {
  background: #fff;
  padding: 25px;
  border-radius: var(--card-radius);
  text-align: center;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s, box-shadow 0.4s;
  position: relative;
  cursor: pointer;
}

body.dark .card {
  background: #1e293b;
}

.card i {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--accent);
}

/* ===================== Skill Cards ===================== */
.skill-card {
  padding: 20px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.skill-card .icon-bg {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 2rem;
  color: #fff;
  transition: transform 0.3s, box-shadow 0.3s;
}

/* Skill Colors */
.icon-bg.python { background:#306998; }
.icon-bg.java { background:#f89820; }
.icon-bg.c { background:#00599c; }
.icon-bg.ml { background:#f59e0b; }
.icon-bg.da { background:#10b981; }
.icon-bg.ai { background:#8b5cf6; }
.icon-bg.eda { background:#6366f1; }
.icon-bg.ds { background:#ef4444; }
.icon-bg.git { background:#f05032; }
.icon-bg.dl { background:#06b6d4; }

/* ===================== Books Section ===================== */
.book-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 15px;
  scroll-behavior: smooth;
}

.book-card {
  flex: 0 0 auto;
  min-width: 140px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  background: #fff;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

body.dark .book-card {
  background: #1e293b;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.book-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.book-info {
  padding: 8px 10px;
  text-align: center;
}

.book-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text-light);
}

body.dark .book-title {
  color: var(--text-dark);
}

.book-author {
  font-size: 0.8rem;
  color: #64748b;
}

body.dark .book-author {
  color: #cbd5e1;
}

/* ===================== Hobbies ===================== */
.card.hobby-card {
  flex: 0 0 auto;
  background: #fff;
  padding: 12px 15px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  min-width: 140px;
  transition: all 0.5s ease, transform 0.3s ease;
  cursor: default;
}

body.dark .card.hobby-card {
  background:#1e293b;
  color:#f1f5f9;
  box-shadow:0 4px 12px rgba(0,0,0,0.3);
}

/* ===================== Footer ===================== */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
  color: #94a3b8;
}

/* ===================== Mobile ===================== */
@media(max-width:800px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; }
  .hero h1 { font-size: 2rem; }
  .hero p.intro { font-size: 1rem; padding:0 10px; }
  .profile-photo { width: 120px; height: 120px; }
  .card { padding: 15px; }
  .btn { padding: 8px 14px; font-size: 0.9rem; }
  .grid.hobbies, .book-row { justify-content: flex-start; overflow-x:auto; }
}

@media(max-width:500px) {
  nav { flex-direction: column; gap:10px; }
  .grid { grid-template-columns:1fr; }
  .card i { font-size:1.5rem; margin-bottom:6px; }
  .hero h1 { font-size:1.5rem; }
  .hero p.intro { font-size:0.9rem; }
  .book-card img { height: 160px; }
  .book-title { font-size: 0.9rem; }
  .book-author { font-size: 0.75rem; }
}

/* ===================== Scroll Fade-in ===================== */
section, .book-card, .hobby-card {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-out;
}

section.visible, .book-card.visible, .hobby-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.skill-bar-container {
  background: #e5e7eb;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  margin-top: 8px;
}
.skill-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 1.2s ease-in-out;
}

/* ===================== Hover Effects (Unified Perplexity Style) ===================== */

/* Buttons */
.btn:hover {
  background: #005f73;
  color: #e0e0e0;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Cards */
.card:hover, .hobby-card:hover, .book-card:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* Skill Cards */
.skill-card:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.skill-card:hover .icon-bg {
  transform: scale(1.2);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Profile Photo */
.profile-photo:hover {
  transform: scale(1.08) rotate(1deg);
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* Navigation Links */
nav a:hover {
  color: var(--accent);
}

/* Theme Toggle Button */
.toggle-btn:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
