/* Root Variables */
:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-light: #f9fafb;
  --bg-card: #ffffff;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* Global Styles */
* {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  line-height: 1.7;
  color: var(--text-primary);
  transition: background-color 0.3s ease;
  margin: 0;
  overflow-x: hidden;
  width: 100%;
}

html {
  overflow-x: hidden;
  width: 100%;
}

.light-theme {
  background-color: var(--bg-light);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* Spacing on all sections */
.section {
  margin-top: 5rem;
  padding-top: 5rem;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}
.section:last-of-type {
  padding-bottom: 5rem;
}

/* Hero Section */
.bgimage {
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: cover;
  position: relative;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

.hero-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-height: 5rem;
}

.hero_title {
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0;
  animation: fadeInUp 0.8s ease-out;
  line-height: 1;
}

.hero_desc {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991px) {
  .hero-title-wrapper {
    min-height: 2.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .hero_title {
    font-size: 2.5rem;
    padding-top: 0;
  }

  .hero_desc {
    font-size: 1.2rem;
  }
  
  .bgimage {
    height: 70vh;
    padding: 2rem 1rem;
  }
  
  .hero_text {
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .hero_content {
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
  }
  
  .hero_content p {
    padding: 0 0.5rem;
  }
}

.hero_text {
  text-align: center;
  color: white;
  z-index: 1;
}

/* Buttons */
.btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.btn-secondary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

#themeSwitchBtn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

#themeSwitchBtn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Avatar */
.avatar-container {
  position: relative;
  display: inline-block;
}

.rounded-circle {
  max-width: 100%;
  height: auto;
  border: 4px solid var(--primary-color);
  box-shadow: var(--shadow-xl);
  transition: all 0.3s ease;
}

.rounded-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* Navbar */
.navbar {
  transition: all 0.3s ease;
  padding: 1rem 0;
  width: 100%;
  max-width: 100vw;
}

.navbar .container {
  max-width: 100%;
  width: 100%;
}

.navbarTransparent {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-color) !important;
  transition: all 0.3s ease;
}

.navbar-dark .navbar-brand {
  color: white !important;
}

.navbarTransparent .navbar-brand {
  color: var(--primary-color) !important;
}

.nav-link {
  color: var(--text-primary) !important;
  font-weight: 600;
  margin: 0 0.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
}

.nav-link:hover:after {
  width: 100%;
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

/* Cards */
.card {
  border: none;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  background: var(--bg-card);
  height: 100%;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.card-img-top {
  border-radius: 1rem 1rem 0 0;
  transition: transform 0.3s ease;
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

.card-title {
  text-align: center;
  color: var(--text-primary);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Skills Section */
.skillsText.card {
  height: 320px;
  cursor: pointer;
  border: 2px solid transparent;
}

.skillsIcon {
  font-size: 3rem;
  text-align: center;
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.card:hover .skillsIcon {
  transform: scale(1.1);
}

.skillsText:hover {
  border: 2px solid var(--primary-color);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
}

/* Social Icons */
.social-icons {
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-icons a {
  transition: all 0.3s ease;
}

.social-icons a:hover {
  transform: translateY(-3px);
}

.fab {
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.fa-github:hover {
  color: #333;
}

.fa-linkedin-in:hover {
  color: #0077b5;
}

.fa-medium:hover {
  color: #00ab6c;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: white;
  text-align: center;
  padding: 2rem 0;
}

.footer .fab {
  color: white;
}

/* Typing Animation */
.typing-container {
  min-height: 3rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero_content .typing-container {
  min-height: 5rem;
  max-height: 5rem;
  width: 420px;
  text-align: right;
  justify-content: flex-end;
  align-items: center;
  overflow: visible;
}

@media (max-width: 991px) {
  .hero_content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .hero_content .typing-container {
    text-align: center;
    justify-content: center;
    margin: 0 auto;
  }
}

.hero_content .typing-container .hero_desc {
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
  line-height: 1;
  min-height: 1em;
}

@media (max-width: 991px) {
  .hero_content .typing-container {
    width: 100%;
    max-width: 100%;
    min-height: 2.5rem;
    max-height: 2.5rem;
    padding: 0 0.5rem;
    box-sizing: border-box;
  }
  
  .hero_content .typing-container .hero_desc {
    font-size: 2.5rem;
  }
}

@media (max-width: 576px) {
  .hero_title {
    font-size: 2rem;
  }
  
  .hero_content .typing-container .hero_desc {
    font-size: 2rem;
  }
  
  .hero_desc {
    font-size: 1rem;
  }
}

/* Link Styles */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Publications Section */
#publications p {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Contact Section */
#contact label {
  font-weight: 600;
  color: var(--text-primary);
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Dark Mode Support */
[data-bs-theme="dark"] {
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --bg-light: #111827;
  --bg-card: #1f2937;
}

[data-bs-theme="dark"] body {
  background-color: var(--bg-light);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .card {
  background-color: var(--bg-card);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3);
}

[data-bs-theme="dark"] .navbar-brand,
[data-bs-theme="dark"] .nav-link {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .navbarTransparent {
  background: rgba(31, 41, 55, 0.95) !important;
}

[data-bs-theme="dark"] .fab {
  color: var(--text-primary);
}

/* Scroll Down Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: bounce 2s infinite;
  cursor: pointer;
}

.scroll-indicator i {
  color: white;
  font-size: 2rem;
  opacity: 0.8;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-10px) translateX(-50%);
  }
  60% {
    transform: translateY(-5px) translateX(-50%);
  }
}

/* Badge Styles */
.badge-modern {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Enhanced hover effects for links */
a:not(.btn):not(.nav-link) {
  position: relative;
  display: inline-block;
}

/* Section Titles */
section h1 {
  position: relative;
  display: inline-block;
}

section h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

/* Mobile Responsive Styles */
@media (max-width: 991px) {
  /* Section spacing */
  .section {
    margin-top: 3rem;
    padding-top: 3rem;
  }
  
  /* Typography */
  h1 {
    font-size: 2rem;
  }
  
  /* Navbar mobile fixes */
  .navbar {
    padding: 0.75rem 0 !important;
    background: rgba(26, 32, 44, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
  }
  
  .navbar .container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 auto !important;
  }
  
  .navbar-brand {
    font-size: 1.1rem !important;
    margin: 0 !important;
    color: white !important;
  }
  
  .navbar-toggler {
    display: block !important;
    margin: 0 !important;
    padding: 0.5rem 0.75rem !important;
    border: 2px solid rgba(255, 255, 255, 0.7) !important;
    border-radius: 0.375rem !important;
    background: transparent !important;
  }
  
  .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25) !important;
    outline: none !important;
  }
  
  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
  }
  
  .navbar-nav {
    align-items: flex-start !important;
  }
  
  .navbar-collapse {
    background: rgba(26, 32, 44, 0.98) !important;
    padding: 1rem !important;
    border-radius: 0.5rem !important;
    margin-top: 1rem !important;
    box-shadow: var(--shadow-lg) !important;
  }
  
  [data-bs-theme="dark"] .navbar-collapse {
    background: rgba(31, 41, 55, 0.98) !important;
  }
  
  .nav-item {
    width: 100%;
    margin: 0.25rem 0;
  }
  
  .nav-link {
    margin: 0 !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.375rem;
    color: rgba(255, 255, 255, 0.95) !important;
  }
  
  .nav-link:hover {
    background: rgba(59, 130, 246, 0.2) !important;
  }
  
  #themeSwitchBtn {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
  }
  
  /* Avatar container */
  .avatar-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
  }
  
  .avatar {
    max-width: 250px;
  }
  
  /* About section text */
  #about p {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  /* Skills cards */
  .skillsText.card {
    height: auto;
    min-height: 320px;
  }
  
  /* Card padding */
  .card-body {
    padding: 1.5rem !important;
  }
  
  /* Button spacing */
  .btn-secondary {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  
  /* Contact section links */
  #contact .d-flex {
    flex-direction: column;
    gap: 1rem !important;
  }
  
  /* Social icons in footer */
  .footer .d-flex {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  /* Portfolio cards */
  .col-lg-4 {
    margin-bottom: 2rem;
  }
  
  /* Better mobile spacing for About section links */
  #about .d-flex {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  /* Scroll indicator on mobile */
  .scroll-indicator {
    bottom: 1rem;
  }
  
  /* Footer mobile fixes */
  .footer {
    padding: 2rem 1.5rem;
    text-align: center;
  }
  
  .footer .d-flex {
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
  }
  
  /* Ensure all container content is properly padded on mobile */
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix hero section padding */
  .bgimage {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
  }
  
  .hero_text {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Prevent any overflow */
  body, html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  
  * {
    box-sizing: border-box !important;
  }
}

/* Extra small devices */
@media (max-width: 576px) {
  body {
    font-size: 0.95rem;
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  
  .navbar-brand {
    font-size: 1rem !important;
  }
  
  .navbar {
    padding: 0.5rem 0 !important;
  }
  
  .navbar .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  
  .bgimage {
    padding: 1.5rem 0.75rem;
    width: 100vw !important;
    max-width: 100vw !important;
  }
  
  .hero_text {
    padding: 0 0.75rem;
    width: 100% !important;
  }
  
  .section {
    margin-top: 2rem;
    padding-top: 2rem;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  p {
    font-size: 0.95rem;
  }
  
  .card-body {
    padding: 1rem !important;
  }
  
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
  }
  
  .footer {
    padding: 1.5rem 1rem;
  }
  
  #contact .col-lg-6 {
    padding: 0 0.5rem;
  }
  
  #contact p {
    font-size: 0.9rem;
  }
  
  /* Make email text wrap properly */
  #contact .d-flex,
  #contact .mb-4 {
    word-break: break-word;
  }
}
