/* =========================
   ROOT VARIABLES & THEMES
========================= */
:root {
  --primary: #2563eb;
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e5e7eb;
  --card-bg: #ffffff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Optional: Dark Mode Class (Trigger via JS) */
[data-theme="dark"] {
  --bg: #0f172a;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --card-bg: #1e293b;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* =========================
   GLOBAL SETTINGS
========================= */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  max-width: 1000px; /* Slightly wider for modern screens */
  margin: auto;
  padding: 40px 20px;
  line-height: 1.7;
  transition: background 0.3s ease;
}

/* =========================
   HEADER & NAVIGATION
========================= */
.header-flex {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 50px;
}

.profile-pic {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--border);
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
}

nav {
  display: flex;
  gap: 25px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

nav a:hover {
  color: var(--primary);
}

.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px); /* This creates the frosted glass effect */
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 1rem 0;
}

.nav-container {
  max-width: 1000px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  font-weight: 800;
  font-size: 1.4rem;
}

.logo span {
  color: var(--primary);
}

/* =========================
   RESEARCH & PROJECT CARDS
========================= */
section {
  padding: 60px 0;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 30px;
  position: relative;
}

h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--primary);
  margin-top: 8px;
  border-radius: 2px;
}

.image-grid {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.image-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.image-card:hover {
  transform: translateY(-5px);
}

.image-card img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* =========================
   GALLERY (THE BEST PART)
========================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.gallery-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.gallery-item:hover {
  transform: scale(1.02);
  border-color: var(--primary);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.gallery-item p {
  padding: 15px;
  font-weight: 500;
  color: var(--text);
}

/* =========================
   COMPONENTS
========================= */
button {
  padding: 10px 20px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--primary);
  color: white;
  transition: var(--transition);
}

button:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* =========================
   RESPONSIVE MESH
========================= */
@media (max-width: 768px) {
  .header-flex, .image-card {
    grid-template-columns: 1fr;
    flex-direction: column;
    text-align: center;
  }
  
  .header-flex {
    align-items: center;
  }
  
  h1 { font-size: 2rem; }
}

.btn-secondary {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 8px;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--border);
}

.interests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
}

.intro-text {
    font-size: 1.2rem;
    color: var(--text-muted);
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 40px 0;
}

/* =========================
   FIXED IMAGE MODAL (ZOOM)
========================= */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stays in the same place even if you scroll */
  z-index: 9999; /* Sits on top of everything else */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9); /* Dark background */
  
  /* These three lines center the image perfectly */
  justify-content: center; 
  align-items: center;
  flex-direction: column;
}

.modal-content {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  
  /* Animation for the "In-Place" zoom effect */
  animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Close Button */
.close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

/* Navigation Buttons */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 40px;
  padding: 20px;
  cursor: pointer;
  user-select: none;
  background: rgba(0,0,0,0.2);
  border-radius: 50%;
  margin: 0 20px;
}

.prev { left: 10px; }
.next { right: 10px; }

.nav-btn:hover { background: rgba(255,255,255,0.2); }

/* Hide full content by default */
.post-full-content {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border);
    animation: fadeIn 0.4s ease;
}

/* Button Styling */
.read-more-btn {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: var(--transition);
}

.read-more-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: rgba(37, 99, 235, 0.05); /* Light blue tint */
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 15px;
}

#visit-count {
    font-weight: 800;
    color: var(--primary);
    font-family: 'Courier New', Courier, monospace; /* Digital look */
    letter-spacing: 1px;
}

.pulse-dot {
  height: 8px;
  width: 8px;
  background-color: #10b981; /* Success Green */
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
