/*
 * Custom styles for the portfolio clone. The goal is to emulate the clean,
 * spacious look of the al-folio theme without copying its code verbatim.
 */

/* ========== Base / Layout ========== */
body {
  font-family: 'Roboto', sans-serif;
  color: #212529;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

/* Fixed navigation bar */
.navbar {
  position: fixed;
  top: 0; left: 0; width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e9ecef;
  padding: 0.75rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 1000;
}
.navbar-brand {
  font-weight: 700; font-size: 1.25rem;
  color: #212529; text-decoration: none;
}
.navbar-nav {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 1rem;
}
.navbar-nav li { display: inline-block; }
.navbar-nav li a {
  text-decoration: none; color: #007bff; font-weight: 400;
}
.navbar-nav li a:hover,
.navbar-nav li.active a { text-decoration: underline; }

/* Generic grid columns */
.row {
  display: flex; flex-wrap: wrap;
  margin-left: -0.5rem; margin-right: -0.5rem;
}
.col-md-4, .col-md-8 { padding-left: 0.5rem; padding-right: 0.5rem; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-md-8 { flex: 0 0 66.667%; max-width: 66.667%; }

/* Ensure profile column is left-aligned */
.col-md-4.order-md-2 { text-align: left !important; }

/* Ensure the right column with profile is left-aligned */
.col-md-4.order-md-2 { text-align: left !important; }

/* Typography / spacing */
.post-title { font-size: 2rem; margin-bottom: 0.25rem; }
.desc { font-style: italic; color: #6c757d; }
.mt-5 { margin-top: 3rem; }
.pt-5 { padding-top: 3rem; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-5.pt-5 { padding-top: 4rem !important; } /* compensate fixed navbar */

/* Media helpers */
img { max-width: 100%; height: auto; }
.img-fluid { max-width: 100%; height: auto; }
.rounded { border-radius: 0.25rem; }
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075); }

/* Footer */
.footer {
  background-color: #ffffff;
  border-top: 1px solid #e9ecef;
  text-align: center;
  padding: 1rem;
  font-size: 0.875rem;
  color: #6c757d;
}

/* ================= Dark mode ================ */
body.dark-mode { background:#111; color:#eaeaea; }
body.dark-mode a { color:#9ec5ff; }
body.dark-mode .navbar { background:#181818; border-bottom-color:#333; }

/* Optional if you use .custom-navbar elsewhere */
.custom-navbar { display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid #e9ecef; }
body.dark-mode .custom-navbar { background:#181818; border-bottom-color:#333; }
.custom-navbar .nav a { text-decoration:none; color:inherit; opacity:0.85; }
.custom-navbar .nav a.active { opacity:1; font-weight:600; text-decoration:underline; }

/* Theme toggle button */
#themeToggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  color: inherit;
  opacity: 0.85;
}
#themeToggle:hover {
  opacity: 1;
}

/* ========== News Timeline: simple pipe delimiter style ========== */
.timeline, ul.timeline {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
  position: relative;
}

/* Remove the vertical bar - THIS WAS THE PROBLEM */
/* .timeline::before is now DELETED */

/* Timeline items with pipe separators */
.timeline .timeline-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  padding-left: 0;
}

.timeline .timeline-date {
  font-weight: 600;
  white-space: nowrap;
  min-width: 120px;
  flex-shrink: 0;
}

.timeline .timeline-pipe {
  color: #999;
  font-size: 1.1rem;
  flex-shrink: 0;
}

body.dark-mode .timeline .timeline-pipe {
  color: #666;
}

.timeline .timeline-content {
  flex: 1;
}

/* ========== Internship red line ========== */
.highlight-red { color:#d9534f; font-weight:500; }

/* ========== Avatar crop (upper-half, adjustable) ========== */
/* Use --avatar-y to nudge crop down: 0% = top, 8–12% shows a bit more below face */
.avatar-crop {
  --avatar-y: 40%;
  width: 100%;
  max-width: 320px;
  height: 260px;                 /* visible window height; adjust to tighten/loosen */
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  background: #f5f5f5;
  margin: 0 auto;
}
.avatar-crop img {
  width: 150%;
  height: 100% !important;       /* override any global img{height:auto} */
  object-fit: cover;             /* crop without distortion */
  object-position: center var(--avatar-y); /* move focal point down by --avatar-y */
  display: block;
  transform: scale(2.4);  /* ← ADD THIS LINE! 1.3 = 130% zoom */
}

/* ========== Name block (Jawad / জাওয়াদ / (jao-oad)) ========== */
.name-note { 
  margin-top:10px; 
  text-align:left !important; 
  line-height:1.4; 
}
.name-note .english-name { 
  font-size:1.15rem; 
  font-weight:600; 
  color:#333; 
  text-align:left !important;
}
body.dark-mode .name-note .english-name { color:#eee; }
.name-note .bilingual { 
  font-size:1rem; 
  color:#666; 
  text-align:left !important;
}
body.dark-mode .name-note .bilingual { color:#ccc; }
.name-note .pron { 
  font-size:.95rem; 
  color:#777; 
  font-style:italic; 
  text-align:left !important;
}
body.dark-mode .name-note .pron { color:#bbb; }

/* ========== Contact block under photo ========== */
.side-block { margin-top:12px; text-align:left; }
.contact-block .item { display:flex; align-items:center; margin-bottom:8px; }
.contact-block .item i { width:22px; text-align:center; margin-right:8px; opacity:0.9; }
.contact-block a { text-decoration:none; }

/* Optional section title style */
.section-title { font-weight:600; margin-bottom:.75rem; }

/* ========== Publications page styling ========== */
.publication-list {
  list-style: none;
  padding-left: 0;
}

.publication-list li {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.publication-list li::before {
  position: absolute;
  left: 0;
  font-weight: 600;
  color: #666;
}

body.dark-mode .publication-list li::before {
  color: #999;
}

/* Manual numbering for each publication */
.publication-list[start="1"] li:nth-child(1)::before { content: "[1]"; }
.publication-list[start="1"] li:nth-child(2)::before { content: "[2]"; }

.publication-list[start="3"] li:nth-child(1)::before { content: "[3]"; }

.publication-list[start="4"] li:nth-child(1)::before { content: "[4]"; }

.publication-list[start="5"] li:nth-child(1)::before { content: "[5]"; }

.publication-list[start="6"] li:nth-child(1)::before { content: "[6]"; }
.publication-list[start="6"] li:nth-child(2)::before { content: "[7]"; }
.publication-list[start="6"] li:nth-child(3)::before { content: "[8]"; }
.publication-list[start="6"] li:nth-child(4)::before { content: "[9]"; }
.publication-list[start="6"] li:nth-child(5)::before { content: "[10]"; }

.publication-list li strong {
  font-weight: 500;
}

.publication-list li em {
  color: #666;
}

body.dark-mode .publication-list li em {
  color: #aaa;
}

/* Publication links styling */
.publication-list a {
  text-decoration: none;
  color: inherit;
  font-weight: 400;
}

.publication-list a:hover {
  text-decoration: underline;
  color: #007bff;
}

body.dark-mode .publication-list a:hover {
  color: #9ec5ff;
}

/* ========== CV page styling ========== */
.cv-basics li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

/* CV Entry styling */
.cv-entry {
  margin-bottom: 2rem;
}

.cv-header {
  margin-bottom: 0.75rem;
}

.cv-title-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.cv-title-line strong {
  font-weight: 500;
  font-size: 1.05rem;
}

.cv-subtitle {
  color: #666;
  font-size: 0.95rem;
}

body.dark-mode .cv-subtitle {
  color: #999;
}

.cv-details {
  margin-top: 0.5rem;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
}

body.dark-mode .cv-details {
  color: #aaa;
}

/* Skills section */
.cv-skills {
  line-height: 1.8;
}

.skill-item {
  margin-bottom: 1rem;
}

.skill-item strong {
  font-weight: 500;
}

/* Coursework grid */
.coursework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
  line-height: 1.6;
}

.coursework-grid div {
  padding: 0.5rem 0;
  position: relative;
  padding-left: 1.25rem;
}

.coursework-grid div::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #007bff;
}

body.dark-mode .coursework-grid div::before {
  color: #9ec5ff;
}

/* Timeline styling (keeping old styles for compatibility) */
.cv-timeline {
  margin-top: 1rem;
}

.cv-item {
  padding-bottom: 1.5rem;
  border-left: 2px solid #e9ecef;
  padding-left: 1.5rem;
  margin-left: 0.5rem;
  position: relative;
}

.cv-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 5px;
  width: 10px;
  height: 10px;
  background-color: #007bff;
  border-radius: 50%;
}

body.dark-mode .cv-item {
  border-left-color: #333;
}

body.dark-mode .cv-item::before {
  background-color: #9ec5ff;
}

.cv-date {
  font-weight: 600;
  font-size: 0.95rem;
  color: #666;
  white-space: nowrap;
}

body.dark-mode .cv-date {
  color: #999;
}

.cv-location {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

body.dark-mode .cv-location {
  color: #999;
}

.cv-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.cv-institution {
  color: #666;
  font-size: 0.95rem;
}

body.dark-mode .cv-institution {
  color: #aaa;
}

.cv-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

.cv-list li {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.6;
}

.cv-list li::before {
  content: '•';
  position: absolute;
  left: 0.5rem;
  color: #007bff;
}

body.dark-mode .cv-list li::before {
  color: #9ec5ff;
}

/* Download button styling */
.btn-outline-primary {
  border-color: #007bff;
  color: #007bff;
  padding: 0.5rem 1.5rem;
  text-decoration: none;
  border-radius: 0.25rem;
  display: inline-block;
  transition: all 0.2s;
}

.btn-outline-primary:hover {
  background-color: #007bff;
  color: #ffffff;
  text-decoration: none;
}

body.dark-mode .btn-outline-primary {
  border-color: #9ec5ff;
  color: #9ec5ff;
}

body.dark-mode .btn-outline-primary:hover {
  background-color: #9ec5ff;
  color: #111;
}

/* ========== Mobile Responsive Fixes ========== */
@media (max-width: 768px) {
  /* Fix email overflow on mobile */
  .contact-block .item {
    flex-wrap: wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .contact-block .item i {
    flex-shrink: 0;
  }
  
  .contact-block a {
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    flex: 1;
    min-width: 0;
  }
  
  /* Stack columns on mobile */
  .col-md-4, .col-md-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  /* Ensure proper spacing on mobile */
  .col-md-4.order-md-2 {
    margin-bottom: 2rem;
  }
  
  /* Make avatar smaller on mobile */
  .avatar-crop {
    max-width: 240px;
    height: 200px;
  }
}
