/* ========== style.css ========== */
/* ----- CSS variables (light mode default) ----- */
:root {
  --bg-gradient: linear-gradient(145deg, #f0f4ff 0%, #d9e2fa 100%);
  --card-bg: rgba(255, 255, 255, 0.3);
  --card-border: rgba(255, 255, 255, 0.5);
  --text-primary: #1f2a44;
  --text-secondary: #2c3e66;
  --btn-bg: rgba(255, 255, 255, 0.4);
  --btn-hover: rgba(255, 255, 255, 0.7);
  --shadow: 0 12px 30px rgba(0, 10, 30, 0.1);
  --backdrop-blur: blur(10px);
  --filter-btn-bg: rgba(255,255,255,0.3);
  --filter-btn-active: #4f6f9f;
  --footer-bg: rgba(255, 255, 255, 0.2);
  --icon-filter: none;
}

/* dark theme variables */
body.dark-theme {
  --bg-gradient: linear-gradient(145deg, #1a1f2e 0%, #0f172a 100%);
  --card-bg: rgba(20, 30, 45, 0.5);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-primary: #e9edf5;
  --text-secondary: #b6c3db;
  --btn-bg: rgba(45, 55, 75, 0.6);
  --btn-hover: rgba(75, 95, 130, 0.8);
  --shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
  --filter-btn-bg: rgba(30, 40, 60, 0.6);
  --filter-btn-active: #5f7bbf;
  --footer-bg: rgba(10, 15, 25, 0.6);
}

/* ----- base & reset ----- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background 0.3s, color 0.2s;
  scroll-behavior: smooth;
  padding: 1.5rem 1.5rem 0;
}

/* ----- glassmorphism base (shared) ----- */
.profile, .category-card, .filter-btn, .theme-toggle, footer {
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 2rem;
  box-shadow: var(--shadow);
}

/* ----- header / theme toggle ----- */
header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.theme-toggle {
  background: var(--card-bg);
  border: none;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.25s;
  box-shadow: var(--shadow);
}

.theme-toggle i {
  position: absolute;
  transition: opacity 0.2s, transform 0.2s;
}

.theme-toggle .fa-sun { opacity: 0; }
.dark-theme .theme-toggle .fa-moon { opacity: 0; }
.dark-theme .theme-toggle .fa-sun { opacity: 1; }

.theme-toggle:hover {
  background: var(--btn-hover);
  transform: scale(1.08);
}

/* ----- profile section fade-in ----- */
.profile {
  text-align: center;
  padding: 2.5rem 1.5rem;
  max-width: 650px;
  margin: 0 auto 2rem auto;
}

.fade-in {
  animation: fadeSlide 1s ease-out;
}

@keyframes fadeSlide {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}

.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.2rem;
  border: 3px solid rgba(255,255,255,0.4);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

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

.profile h1 {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.bio {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 450px;
  margin: 0 auto;
}

/* ----- filter buttons ----- */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin: 2.5rem 0 2rem;
}

.filter-btn {
  background: var(--filter-btn-bg);
  border: 1px solid var(--card-border);
  padding: 0.65rem 1.5rem;
  border-radius: 3rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: 0.2s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.filter-btn.active {
  background: var(--filter-btn-active);
  color: white;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(55, 90, 180, 0.25);
}

.filter-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-3px);
}

/* ----- categories grid (mobile-first) ----- */
.categories {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto 3rem;
}

/* category card */
.category-card {
  padding: 1.8rem 1.5rem;
  border-radius: 2rem;
  transition: all 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
  overflow: hidden;          /* important for collapse animation */
}

/* hidden state for filter (smooth collapse + fade) */
.category-card.collapsed {
  opacity: 0;
  transform: scale(0.7) translateY(30px);
  max-width: 0;
  max-height: 0;
  padding: 0;
  margin: 0;
  border: none;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.6rem;
  font-size: 1.3rem;
  border-bottom: 1px dashed var(--card-border);
  padding-bottom: 0.7rem;
}

.category-header i {
  font-size: 1.9rem;
  color: var(--text-primary);
}

.category-header h2 {
  font-size: 1.6rem;
  font-weight: 500;
}

/* list of social links */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255,255,255,0.1);
  border-radius: 2rem;
  padding: 0.8rem 1rem;
  backdrop-filter: blur(4px);
  transition: 0.2s;
  border: 1px solid transparent;
}

.link-item:hover {
  border-color: var(--card-border);
  background: rgba(255,255,255,0.2);
}

.platform-icon {
  font-size: 2rem;
  min-width: 2.2rem;
  text-align: center;
}

.link-info {
  flex: 1;
}

.link-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.link-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.visit-btn {
  background: var(--btn-bg);
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 3rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  backdrop-filter: blur(4px);
  transition: 0.2s;
  white-space: nowrap;
  border: 1px solid var(--card-border);
}

.visit-btn i {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.visit-btn:hover {
  background: var(--btn-hover);
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.visit-btn:hover i {
  transform: translateX(4px);
}

/* ----- footer ----- */
footer {
  margin-top: 3rem;
  padding: 1.8rem 2rem;
  border-radius: 3rem 3rem 1.5rem 1.5rem;
  background: var(--footer-bg);
  backdrop-filter: blur(12px);
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.copyright {
  font-size: 0.95rem;
  opacity: 0.8;
}

.email {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dotted;
}

.social-icons {
  display: flex;
  gap: 1.5rem;
  font-size: 1.5rem;
}

.social-icons a {
  color: var(--text-primary);
  transition: 0.2s;
}

.social-icons a:hover {
  transform: translateY(-5px);
  color: var(--filter-btn-active);
}

/* ----- tablet & desktop responsiveness ----- */
@media (min-width: 600px) {
  .categories {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .categories {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .profile {
    padding: 3rem;
  }
  
  .profile-image {
    width: 140px;
    height: 140px;
  }
}

/* extra large screens */
@media (min-width: 1400px) {
  .categories {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* accessibility & smoothness */
button {
  cursor: pointer;
  user-select: none;
}