/* Academic Paper Inspired Design */

/* Top Navigation Bar */
.top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(25px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  height: 60px;
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 900px;
  width: 90%;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  flex-shrink: 0;
}

.nav-logo img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-brand a {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-brand a:hover {
  color: #007aff;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 0;
  background: rgba(248, 250, 252, 0.9);
  border-radius: 12px;
  padding: 5px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nav-links a {
  color: #1d1d1f;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-links a:hover {
  color: #007aff;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

/* Modern academic typography with improved readability */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: #1a1a1a;
  background: linear-gradient(135deg, #fafbfc 0%, #f4f6f8 100%);
  max-width: none;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 60px;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Override theme wrapper for academic layout */
.wrapper {
  width: 90%;
  max-width: 900px;
  margin: 0 auto;
  position: static;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
}

/* Academic header styling */
header {
  position: static;
  float: none;
  width: 100%;
  padding: 40px 0 30px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 40px;
}

/* Simple header for non-main pages */
.simple-header {
  text-align: left;
  padding: 20px 0;
}

.simple-header h1 {
  font-size: 24px;
  font-weight: 400;
  margin: 0;
  color: #1d1d1f;
}

.simple-header h1 a {
  color: #1d1d1f;
  text-decoration: none;
}

.simple-header h1 a:hover {
  color: #007aff;
  text-decoration: none;
}

/* Profile section layout - centered two-column design */
.profile-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  margin-top: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.profile-image {
  flex-shrink: 0;
  text-align: center;
}

/* Profile image - larger and more prominent */
.profile-image img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-image img:hover {
  transform: none;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

/* Profile info styling with name at top */
.profile-info {
  flex: 1;
  text-align: left;
  max-width: none;
}

.profile-info h1 {
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 20px;
  color: #1d1d1f;
  text-align: left;
}

.profile-info h1 a {
  color: #1d1d1f;
  text-decoration: none;
}

.profile-info h1 a:hover {
  color: #007aff;
  text-decoration: none;
}

.profile-info p {
  font-size: 15px;
  line-height: 1.7;
  margin: 12px 0;
  color: #444;
}

.profile-info p:first-of-type {
  margin-top: 0;
}

.profile-info .email {
  font-size: 15px;
  color: #007aff;
  font-weight: 500;
  margin-top: 20px;
}

.profile-info .email a {
  color: #007aff;
  text-decoration: none;
}

/* Hide old navigation in header since we now have top navbar */
header ul {
  display: none;
}

/* Academic content styling */
section {
  width: 100%;
  float: none;
  position: static;
  margin: 0 0 40px 0;
  padding: 0;
  border: none;
  font-size: 16px;
  line-height: 1.8;
  flex: 1;
  min-height: 0;
}

/* Academic headings with improved hierarchy */
section h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 50px 0 30px 0;
  padding-bottom: 16px;
  border-bottom: 2px solid #e8eaed;
  position: relative;
}

section h2:before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, #4285f4, #34a853);
  border-radius: 1px;
}

section h3 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 40px 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f2f4;
  position: relative;
}

section h3:before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, #4285f4, #5ac8fa);
  border-radius: 1px;
}

/* Academic link styling - completely disable any scaling or size changes */
a {
  color: #4285f4;
  text-decoration: none;
  transition: color 0.2s ease !important;
  transform: none !important;
  scale: none !important;
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  text-transform: none !important;
}

a:hover {
  color: #1a73e8;
  text-decoration: none;
  transform: none !important;
  scale: none !important;
  font-size: inherit !important;
  zoom: 1 !important;
  line-height: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  text-transform: none !important;
}

/* Ensure absolutely no scaling, sizing, or transformation on any links */
a, a:hover, a:focus, a:active, a:visited {
  transform: none !important;
  scale: none !important;
  font-size: inherit !important;
  zoom: 1 !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -ms-transform: none !important;
  -o-transform: none !important;
  line-height: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  text-transform: none !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
}

/* Academic list styling */
section ul {
  margin: 20px 0;
  padding-left: 20px;
  list-style: none;
}

section li {
  margin: 12px 0;
  position: relative;
  padding-left: 20px;
}

section li:before {
  content: "•";
  color: #2962ff;
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* Paragraph spacing for academic readability */
section p {
  margin: 20px 0;
  text-align: justify;
  line-height: 1.8;
}

/* Publication card containers */
.publication-item {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: 8px;
  padding: 20px;
  margin: 25px 0;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.publication-item:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(66, 133, 244, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Publication entries styling */
section h4 {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

/* Publication item containers */
section h4 + p {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 15px;
  color: #4a5568;
  line-height: 1.6;
}

/* Author names and venue styling */
section em {
  font-style: italic;
  color: #2d3748;
}

/* Emphasis for user's name in author lists */
section em[title="Author name"] {
  font-weight: 600;
  color: #1a1a1a;
}

/* Style for user's name when wrapped in emphasis tags */
section p em {
  font-style: italic;
  color: #2d3748;
}

/* Better highlighting for Ramtin Keramati name in publications */
section p:contains("Ramtin Keramati") {
  /* This will be handled by the emphasis in markdown */
}

/* Better spacing for publication sections */
section hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #e2e8f0 20%, #e2e8f0 80%, transparent 100%);
  margin: 50px 0;
}

/* Improve readability of main content paragraphs */
.profile-info p {
  font-size: 16px;
  line-height: 1.7;
  margin: 15px 0;
  color: #374151;
}

/* Hide generic footer styling */
footer:not(.social-footer) {
  display: none;
}

footer p {
  margin: 8px 0;
}

footer a {
  color: #888;
  text-decoration: none;
}

footer a:hover {
  color: #555;
  text-decoration: underline;
}

/* Mobile responsiveness for academic layout */
@media (max-width: 720px) {
  .nav-container {
    width: 95%;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
  }
  
  .nav-left {
    gap: 10px;
  }
  
  .nav-logo img {
    width: 30px;
    height: 30px;
  }
  
  .top-navbar {
    height: auto;
    min-height: 60px;
    padding: 10px 0;
  }
  
  body {
    padding-top: 80px;
  }
  
  .nav-links {
    margin-top: 5px;
  }
  
  .nav-links a {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .wrapper {
    width: 95%;
    margin: 0 auto;
  }
  
  header {
    padding: 30px 20px 20px 20px;
    margin-bottom: 30px;
  }
  
  header h1 {
    font-size: 24px;
  }
  
  /* Mobile profile layout - stack vertically */
  .profile-section {
    flex-direction: column;
    text-align: center;
    gap: 25px;
  }
  
  .profile-info {
    text-align: center;
  }
  
  .profile-info h1 {
    font-size: 26px;
    text-align: center;
  }
  
  .profile-image img {
    width: 150px;
    height: 150px;
  }
  
  section {
    padding: 0 20px;
  }
  
  section h3 {
    font-size: 16px;
    margin: 30px 0 15px 0;
  }
  
  body {
    font-size: 15px;
    line-height: 1.7;
  }
}

/* Photo Gallery Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin: 40px 0;
}

.photo-grid figure {
  margin: 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.photo-grid figure:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.photo-grid img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.photo-grid figcaption {
  padding: 15px 20px;
  font-size: 13px;
  color: #666;
  text-align: center;
  background: #fff;
  line-height: 1.4;
  font-weight: 500;
}

/* Mobile responsiveness for photo grid */
@media (max-width: 768px) {
  .photo-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 30px 0;
  }
  
  .photo-grid img {
    height: 200px;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* Hide any theme-generated footer content but not our social footer */
footer:not(.social-footer) {
  display: none !important;
}

/* Hide any GitHub Pages attribution */
.view {
  display: none !important;
}

/* Social Footer */
.social-footer {
  margin-top: auto;
  margin-bottom: 0;
  padding: 60px 0 40px 0;
  text-align: center;
  display: block !important;
  background: transparent;
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
  position: relative;
}

.social-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.footer-separator {
  display: none;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  align-items: center;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  text-decoration: none;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: #007aff;
  text-decoration: none;
}

.social-link svg {
  transition: all 0.3s ease;
}

.social-link:hover svg {
  transform: none;
}

/* Mobile responsiveness for social footer */
@media (max-width: 768px) {
  .social-links {
    gap: 15px;
  }
  
  .social-link {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .social-footer {
    padding: 30px 20px;
  }
}

/* PDF Link Buttons for Academic Papers */
.pdf-link {
  display: inline-block;
  background: #34a853;
  color: white !important;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 6px;
  text-decoration: none;
  margin-left: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(52, 168, 83, 0.25);
  vertical-align: middle;
}

.pdf-link:hover {
  background: #2d7d32;
  color: white !important;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(52, 168, 83, 0.3);
}

/* Blue Link Button for External Links */
.link-button {
  display: inline-block;
  background: #4285f4;
  color: white !important;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 6px;
  text-decoration: none;
  margin-left: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(66, 133, 244, 0.25);
  vertical-align: middle;
}

.link-button:hover {
  background: #1a73e8;
  color: white !important;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}