/* Custom styles to complement Tailwind CSS */

/* Import Barlow Google Font */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@300;400;500;600&display=swap');

/* Base styles */
html {
  font-size: 18px; /* Ensure base font size is 18px (1.125rem) */
  scroll-behavior: smooth;
}

body {
  font-family: 'Barlow', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

/* Increased line height for intro text */
#intro .text-gray-700 {
  line-height: 2;
}

/* Smooth scrolling for the entire page */
html {
  scroll-behavior: smooth;
}

/* Custom transitions */
a {
  transition: all 0.2s ease;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Text links styling */
a[href]:not(#sticky-nav a, #top-socials a, .company-arrow, #projects a, footer a, #blog a, #experience a) {
  color: #0000ff;
  text-decoration: underline;
  position: relative;
}


/* Dark mode link styling */
body.dark-mode a[href]:not(#sticky-nav a, #top-socials a, #projects a, footer a, .company-arrow, #blog a, #experience a) {
  color: #60a5fa; /* Tailwind blue-400 */
}

/* Sticky Navigation Bar */
#sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-100%);
  transition: all 0.3s ease;
}

#sticky-nav.visible {
  transform: translateY(0);
  opacity: 1;
}

#sticky-nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row !important;
}

#sticky-nav .flex-row {
  display: flex;
  flex-direction: row !important;
  align-items: center;
}

/* Clickable title in sticky nav */
#sticky-nav-title {
  transition: color 0.2s ease;
  position: relative;
}

#sticky-nav-title:hover {
  color: #0000ff;
}

body.dark-mode #sticky-nav-title:hover {
  color: #60a5fa;
}



body.dark-mode #sticky-nav {
  background-color: rgba(17, 24, 39, 0.8); /* Tailwind gray-900 with opacity */
}

/* Mobile responsive styles */
@media (max-width: 640px) {
 
  
  #sticky-nav .container {
   
    flex-direction: row !important;
    justify-content: space-between;
  }
  
  
  
  #sticky-nav .flex-row {
    gap: 0.35rem; /* Further reduced gap */
    flex-direction: row !important;
  }
  

  
  /* Make the sticky nav more compact */
  #sticky-nav .theme-toggle-container {
    margin-left: 0.15rem;
  }
  
  /* Reduce top bar height */
  #top-bar {
    margin-bottom: 2rem; /* Reduced margin */
    padding-top: 0.25rem; /* Reduced top padding */
  }
}

/* Custom styling for profile picture */
#profile-pic {
  transition: transform 0.5s ease;
}

#profile-pic:hover {
  transform: scale(1.05);
}

/* Subtle fade-in animation for page load */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

header, section {
  animation: fadeIn 0.6s ease forwards;
}

section {
  animation-delay: 0.1s;
}

/* Arrow styling for links */
a[href] .text-gray-400 {
  transition: transform 0.2s ease;
}

a:hover .text-gray-400 {
  transform: translateX(3px);
}

/* Ensure content is readable on all devices */
@media (max-width: 640px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.25rem; /* Further reduced top padding */
  }
  
  /* Adjust the main container's top padding */
  #main-container {
    padding-top: 0.25rem !important; /* Minimal top padding on mobile */
    padding-bottom: 2rem !important; /* Reduced bottom padding */
  }
  
  .flex:not(#sticky-nav .flex-row, #sticky-nav .container, #sticky-nav .flex.gap-4, #top-socials) {
    flex-direction: column;
  }
  
  .w-16, .w-20, .w-24 {
    width: 100%;

  }
  
  /* Fix for experience section on mobile */
  #experience .flex, #projects .flex, #blog .flex {
    flex-direction: column;
  }
  
  #experience .w-3\/12, #projects .w-3\/12, #blog .w-3\/12 {
    width: 100%;
 
  }
  
  #experience .w-9\/12, #projects .w-9\/12, #blog .w-9\/12 {
    width: 100%;
  }
  

  
  /* Adjust paragraph spacing */
  p {
    margin-bottom: 0.75rem;
  }
  
  /* Adjust heading spacing */
  h2 {
    margin-bottom: 0.75rem !important;
  }
}

/* Dark mode styles */
body.dark-mode {
  background-color: #111827; /* Tailwind gray-900 */
  color: #f3f4f6; /* Tailwind gray-100 */
}

body.dark-mode .text-gray-400 {
  color: #9ca3af; /* Tailwind gray-400 */
}

body.dark-mode .text-gray-500,
body.dark-mode .text-gray-600,
body.dark-mode .text-gray-700 {
  color: #d1d5db; /* Tailwind gray-300 */
}

body.dark-mode .border-gray-100 {
  border-color: #374151; /* Tailwind gray-700 */
}

body.dark-mode .bg-gray-100 {
  background-color: #374151; /* Tailwind gray-700 */
}

body.dark-mode .hover\:text-blue-600:hover {
  color: #93c5fd; /* Tailwind blue-300 */
}

/* Top bar with theme toggle and social icons */
#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

/* Social icons */
#top-socials {
  display: flex;
  flex-direction: row !important;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 640px) {
  #top-bar {
    flex-direction: row !important;
    margin-bottom: 1.5rem; /* Reduced margin for mobile */
    padding-top: 0.25rem; /* Reduced padding at the top */
  }
  
  #top-socials {
    gap: 0.75rem;
    flex-direction: row !important;
  }
  
  #top-socials svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* Theme toggle segmented control styles */
.theme-toggle-container {
  background-color: #f3f4f6; /* Light gray background */
  border: 1px solid #e5e7eb;
  transform: scale(0.9);
  border-radius: 0.375rem;
  display: flex;
  flex-direction: row;
}

body.dark-mode .theme-toggle-container {
  background-color: #1f2937; /* Dark gray background */
  border-color: #374151;
}

.theme-btn {
  color: #6b7280; /* Default icon color */
  width: 24px;
  height: 24px;
}

.theme-code-btn {
  width: auto;
  min-width: 34px;
  padding: 0 0.4rem;
}

.theme-code-btn span {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
}

.theme-btn:hover {
  color: #111827;
}

body.dark-mode .theme-btn:hover {
  color: #f9fafb;
}

.theme-btn.active {
  background-color: #fff;
  color: #3b82f6; /* Blue for active state */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.dark-mode .theme-btn.active {
  background-color: #374151;
  color: #60a5fa;
}

/* Light mode button active state */
.theme-btn#light-mode-btn.active,
.theme-btn#top-light-mode-btn.active {
  background-color: #fff;
  color: #f59e0b; /* Amber for sun icon */
}

body.dark-mode .theme-btn#light-mode-btn.active,
body.dark-mode .theme-btn#top-light-mode-btn.active {
  background-color: #374151;
  color: #fbbf24;
}

/* Dark mode button active state */
.theme-btn#dark-mode-btn.active,
.theme-btn#top-dark-mode-btn.active {
  color: #6366f1; /* Indigo for moon icon */
}

body.dark-mode .theme-btn#dark-mode-btn.active,
body.dark-mode .theme-btn#top-dark-mode-btn.active {
  color: #818cf8;
}

/* Code mode button active state */
.theme-btn#code-mode-btn.active,
.theme-btn#top-code-mode-btn.active,
.theme-btn#mobile-code-mode-btn.active {
  color: #16a34a;
}

body.dark-mode .theme-btn#code-mode-btn.active,
body.dark-mode .theme-btn#top-code-mode-btn.active,
body.dark-mode .theme-btn#mobile-code-mode-btn.active {
  color: #4ade80;
}

@media (max-width: 640px) {
  .theme-toggle-container {

    flex-direction: row !important;
    width: auto;
  }
  
  /* Make sure the buttons are side by side */
  .theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px; /* Reduced padding */
  }
  
  /* Ensure the sticky nav theme toggle is horizontal and smaller */
  #sticky-nav .theme-toggle-container {
    flex-direction: row !important;
    margin-left: 0.15rem;
    
  }
  

}

/* Animation for dark mode toggle */
#dark-mode-toggle {
  transition: transform 0.3s ease;
  opacity: 0.7;
}

#dark-mode-toggle:hover {
  transform: rotate(15deg);
  opacity: 1;
}

/* Custom hover effects for project and blog cards */
.bg-white.p-6.rounded-lg:hover {
  transform: translateY(-5px);
}

/* Custom styling for section headings */
h2.text-2xl.font-bold {
  position: relative;
}

h2.text-2xl.font-bold::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 3px;
  background-color: #3b82f6; /* Tailwind blue-500 */
}

/* Style for loaded profile picture */
#profile-pic.loaded {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.2);
  }
  70% {
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* Override Tailwind classes for links */
.text-blue-600 {
  color: #0000ff !important;
}

body.dark-mode .text-blue-600 {
  color: #60a5fa !important; /* Tailwind blue-400 */
}

/* Arrow link styling for all sections */
.company-arrow {
  text-decoration: none !important;
  padding-right: 0 !important;
  
  display: inline-block;
  color: #0000ff !important;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.dark-mode .company-arrow {
  color: #60a5fa !important; /* Tailwind blue-400 */
}

.company-arrow::after {
  content: none !important;
}

.company-arrow:hover {
  text-decoration: none !important;
  opacity: 0.8;
  transform: translateY(-2px);
}

/* Remove previous experience styling that's no longer needed */
#experience h3 a.company-link,
a[href].company-link,
#experience h3 a.company-link::after,
a[href].company-link::after {
  content: initial;
}

/* Remove blog-specific styling since we're using company-arrow consistently */

/* Back to Home link styling for blog posts */
.back-link {
  color: #333 !important;
  text-decoration: none !important;
  position: relative;
}

.back-link svg {
  color: #0000ff !important;
}

.back-link:hover {
  color: #0000ff !important;
  text-decoration: none !important;
}

/* Underline animation for back-link */
.back-link-text span {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #0000ff !important;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease-in-out;
}

.back-link.group:hover .back-link-text span {
  transform: scaleX(1) !important;
}

body.dark-mode .back-link {
  color: #f3f4f6 !important; /* Light gray in dark mode */
}

body.dark-mode .back-link svg {
  color: #60a5fa !important; /* Tailwind blue-400 */
}

body.dark-mode .back-link:hover {
  color: #60a5fa !important;
}

body.dark-mode .back-link-text span {
  background-color: #60a5fa !important;
}

/* Override the global link styling for back-link */
.back-link::after {
  content: none !important;
}

/* Blog, Projects, and Experience section specific link styling */
#blog a, #projects a, #experience a {
  color: inherit !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
  position: relative;
}

#blog a:hover, #projects a:hover, #experience a:hover {
  color: #0000ff !important;
}

/* Add the sliding underline effect to blog, projects, and experience links */
#blog a .text-blue-600,
#projects a .text-blue-600,
#experience a .text-blue-600 {
  color: #0000ff !important;
}

/* Create the sliding underline for blog, projects, and experience links */
#blog a:not(.back-link):not([class*="company-arrow"]):after,
#projects a:not(.back-link):not([class*="company-arrow"]):after,
#experience a:not(.back-link):not([class*="company-arrow"]):after {
  content: '' !important;
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #0000ff !important;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease-in-out;
}

#blog a:not(.back-link):not([class*="company-arrow"]):hover:after,
#projects a:not(.back-link):not([class*="company-arrow"]):hover:after,
#experience a:not(.back-link):not([class*="company-arrow"]):hover:after {
  transform: scaleX(1);
}

body.dark-mode #blog a:hover, 
body.dark-mode #projects a:hover,
body.dark-mode #experience a:hover {
  color: #60a5fa !important;
}

body.dark-mode #blog a:not(.back-link):not([class*="company-arrow"]):after,
body.dark-mode #projects a:not(.back-link):not([class*="company-arrow"]):after,
body.dark-mode #experience a:not(.back-link):not([class*="company-arrow"]):after {
  background-color: #60a5fa !important;
}

body.dark-mode #blog a .text-blue-600,
body.dark-mode #projects a .text-blue-600,
body.dark-mode #experience a .text-blue-600 {
  color: #60a5fa !important;
}

/* Remove the translateY effect from blog, projects, and experience links */
#blog a:hover, #projects a:hover, #experience a:hover {
  transform: none;
}

/* Smooth transition for hidden blog entries */
#hidden-entries {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out;
  opacity: 0;
}

#hidden-entries.visible {
  max-height: 1000px; /* Adjust based on your content height */
  opacity: 1;
}

/* Show More button transition */
#show-more-btn {
  transition: all 0.3s ease;
}

#show-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Mobile-specific navigation improvements */
@media (max-width: 640px) {
  /* Ensure intro section displays properly on mobile */
  #intro .flex.items-center {
    flex-direction: row !important;
    align-items: center;

  }
  
  #intro .w-16.h-16 {
    width: 3.5rem; /* Slightly smaller profile pic */
    height: 3.5rem;
    margin-right: 0.75rem; /* Reduced margin */
  }
  

  
  /* Fix for experience section layout on mobile */
  #experience .flex, #projects .flex, #blog-entries .flex {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem; /* Reduced gap between year and content */
  }
  
  #experience .w-3\/12, #projects .w-3\/12, #blog-entries .w-3\/12 {
    font-size: 0.75rem;
    opacity: 0.7;
   
  }

 
}

/* Mobile Navigation Menu */
#mobile-nav-menu {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mobile-nav-menu:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

#mobile-nav-menu a {
  color: #333;
  transition: color 0.2s ease;
}

#mobile-nav-menu a:hover {
  color: #0000ff;
}

body.dark-mode #mobile-nav-menu {
  background-color: #111827; /* Tailwind gray-900 */
}

body.dark-mode #mobile-nav-menu a {
  color: #f3f4f6; /* Tailwind gray-100 */
}

body.dark-mode #mobile-nav-menu a:hover {
  color: #60a5fa; /* Tailwind blue-400 */
}

/* Terminal-like code mode */
html.code-mode {
  font-size: 14px; /* Scaled down for terminal aesthetic */
}

/* Maintain the same absolute pixel width as the other modes */
html.code-mode .max-w-2xl {
  max-width: 54rem; /* 54rem * 14px = 756px (same as 42rem * 18px) */
}

body.code-mode {
  background-color: #000000;
  color: #a3a3a3;
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

body.code-mode a {
  color: #a3a3a3;
}

body.code-mode a:hover {
  color: #ffffff;
}

body.code-mode .text-gray-400 {
  color: #525252 !important;
}

body.code-mode .text-gray-500,
body.code-mode .text-gray-600,
body.code-mode .text-gray-700 {
  color: #a3a3a3 !important;
}

body.code-mode .text-blue-600,
body.code-mode .company-arrow,
body.code-mode #blog a .text-blue-600,
body.code-mode #projects a .text-blue-600,
body.code-mode #experience a .text-blue-600 {
  color: #ffffff !important;
}

body.code-mode h1,
body.code-mode h2,
body.code-mode h3,
body.code-mode h4,
body.code-mode .font-bold,
body.code-mode .font-semibold {
  color: #ffffff;
  font-weight: 500;
}

body.code-mode #blog a:hover,
body.code-mode #projects a:hover,
body.code-mode #experience a:hover,
body.code-mode .back-link:hover {
  color: #ffffff !important;
}

body.code-mode #blog a:not(.back-link):not([class*="company-arrow"]):after,
body.code-mode #projects a:not(.back-link):not([class*="company-arrow"]):after,
body.code-mode #experience a:not(.back-link):not([class*="company-arrow"]):after,
body.code-mode .back-link-text span {
  background-color: #ffffff !important;
}

body.code-mode #sticky-nav {
  background-color: rgba(0, 0, 0, 0.9);
  box-shadow: none;
  border-bottom: 1px solid #1a1a1a;
}

body.code-mode #sticky-nav-title:hover {
  color: #ffffff;
}

body.code-mode .theme-toggle-container {
  background-color: #0a0a0a;
  border-color: #262626;
}

body.code-mode .theme-btn {
  color: #525252;
}

body.code-mode .theme-btn:hover {
  color: #a3a3a3;
}

body.code-mode .theme-btn.active {
  background-color: #171717;
  color: #ffffff;
  box-shadow: none;
  border: 1px solid #333333;
}

/* Ensure the code mode active color is strictly white in code mode */
body.code-mode .theme-btn#code-mode-btn.active,
body.code-mode .theme-btn#top-code-mode-btn.active,
body.code-mode .theme-btn#mobile-code-mode-btn.active {
  color: #ffffff;
}

body.code-mode #mobile-nav-menu {
  background-color: #000000;
}

body.code-mode #mobile-nav-menu a {
  color: #a3a3a3;
}

body.code-mode #mobile-nav-menu a:hover {
  color: #ffffff;
}

body.code-mode .border-gray-100 {
  border-color: #1a1a1a !important;
}

/* Section styling for code mode */
body.code-mode .space-y-10 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0 !important;
}

body.code-mode #experience .space-y-10 > .flex,
body.code-mode #projects .space-y-10 > .flex,
body.code-mode #blog-entries > .flex,
body.code-mode #hidden-entries > .flex {
  border: 1px solid #1a1a1a;
  padding: 1.5rem;
  margin-top: -1px !important;
  background-color: #000000;
  position: relative;
  transition: border-color 0.2s ease;
}

body.code-mode #experience .space-y-10 > .flex:hover,
body.code-mode #projects .space-y-10 > .flex:hover,
body.code-mode #blog-entries > .flex:hover,
body.code-mode #hidden-entries > .flex:hover {
  border-color: #333333;
  z-index: 1;
}

body.code-mode #intro {
  border: 1px dashed #262626;
  padding: 2rem;
  margin-top: 2.5rem;
  background-color: transparent;
}

body.code-mode #contact,
body.code-mode footer {
  border: none;
  background: transparent;
  padding: 1.25rem 0;
}

body.code-mode #profile-pic {
  filter: grayscale(100%) contrast(1.1);
  border-radius: 4px; /* Square off the profile pic slightly for a terminal feel */
}

body.code-mode #show-more-btn {
  border-color: #262626;
  color: #737373;
  background: #000000;
  border-radius: 4px;
}

body.code-mode #show-more-btn:hover {
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: none;
}

/* Mobile menu toggle button */
#mobile-menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  #mobile-menu-toggle {
    display: block;
  }
  
  /* Ensure theme toggle is horizontal on mobile */
  .theme-toggle-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
  }
  
  /* Adjust spacing for theme toggle buttons */
  .theme-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Make sure the sticky nav theme toggle is properly sized */
  #sticky-nav .theme-toggle-container {
    margin-left: 0.5rem;
  }
}

/* Prevent scrolling when mobile menu is open */
body.overflow-hidden {
  overflow: hidden;
}

/* Increased line height for intro text */
#intro .text-gray-700 {
  line-height: 2;
}

@media (max-width: 640px) {
  /* Smaller intro text on mobile */
  #intro .text-gray-700 {
    font-size: 0.9rem;
    line-height: 1.6; /* Reduced line height */
  }
  
  /* Smaller heading on mobile */
  #intro h1 {
    font-size: 1.1rem;
  }
  
  #intro h2 {
    font-size: 0.8rem;
  }
}

