/* Modern CSS for Personal Website */
:root {
  /* Common variables */
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --transition-speed: 0.3s;
  --border-radius: 8px;
  
  /* Light theme (default) */
  --text-color: #333;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --header-bg: #ffffff;
  --footer-bg: #f8f9fa;
  --border-color: #ddd;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --box-shadow: 0 5px 15px var(--shadow-color);
}

/* Dark theme */
[data-theme="dark"] {
  --text-color: #f0f0f0;
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --header-bg: #1a1a1a;
  --footer-bg: #1a1a1a;
  --border-color: #444;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --box-shadow: 0 5px 15px var(--shadow-color);
}

/* Image styling for proper positioning and sizing */
.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 0;
}

.home-profile-image {
  display: block;
  position: static;
  max-width: 100%;
  height: auto;
  border-radius: 50%;
  box-shadow: var(--box-shadow);
  margin: 0 auto;
  transform: none;
}

.about-profile-image {
  max-width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--box-shadow);
}

/* Map container and address display styling - improved dark mode visibility */
.location-map-container {
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1; /* Lower than header */
}

#locationMap {
  border: 1px solid var(--border-color);
  z-index: 2; /* Map itself has a higher z-index than container but lower than header */
}

.map-info {
  padding: 10px;
  background-color: var(--card-bg) !important; /* Force background color */
  color: var(--text-color);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  border: 1px solid var(--border-color);
  border-top: none;
  font-size: 0.9rem;
}

#address-display {
  display: block;
  color: var(--text-color) !important; /* Force text color */
  word-wrap: break-word;
}

/* Dark mode specific map overrides */
[data-theme="dark"] .map-info {
  background-color: var(--card-bg) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color);
}

[data-theme="dark"] #address-display {
  color: var(--text-color) !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header Styles */
header {
  background-color: var(--header-bg);
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1100; /* Higher than Leaflet controls (which are typically around 1000) */
  transition: all var(--transition-speed) ease;
}

header.scrolled {
  padding: 10px 0;
  background-color: var(--header-bg);
  opacity: 0.95;
  box-shadow: var(--box-shadow);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 15px;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  transition: transform var(--transition-speed);
}

.logo h1:hover {
  transform: translateY(-3px);
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.8;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 25px;
}

nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  position: relative;
  padding: 5px 0;
  transition: color var(--transition-speed);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width var(--transition-speed);
}

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

nav a:hover::after,
nav li.active a::after {
  width: 100%;
}

nav li.active a {
  color: var(--primary-color);
}

.cv-button {
  background-color: var(--primary-color);
  color: white !important;
  padding: 8px 16px !important;
  border-radius: var(--border-radius);
  transition: all var(--transition-speed);
  box-shadow: var(--box-shadow);
}

.cv-button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 80px 0;
  align-items: center;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--primary-color);
  animation: fadeInUp 0.8s ease;
}

.hero-content h2 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: var(--text-color);
  opacity: 0.8;
  animation: fadeInUp 0.8s ease 0.4s forwards;
  opacity: 0;
}

.professional-statement {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: var(--primary-color);
  font-weight: 500;
  animation: fadeInUp 0.8s ease 0.5s forwards;
  opacity: 0;
  line-height: 1.5;
}

.cta-buttons {
  display: flex;
  gap: 15px;
  animation: fadeInUp 0.8s ease 0.6s forwards;
  opacity: 0;
}

.btn {
  display: inline-block;
  padding: 12px 25px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-speed);
  box-shadow: var(--box-shadow);
}

.btn.primary {
  background-color: var(--primary-color);
  color: white;
}

.btn.secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn:hover {
  transform: translateY(-3px);
}

.btn.primary:hover {
  background-color: var(--secondary-color);
}

.btn.secondary:hover {
  background-color: var(--primary-color);
  color: white;
}

.hero-image {
  animation: fadeIn 1s ease 0.8s forwards;
  opacity: 0;
  position: relative;
  padding: 10px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: all var(--transition-speed);
  overflow: hidden;
}

.hero-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  z-index: 1;
}

.hero-image:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: none;
  object-fit: cover;
  max-height: 450px;
  transform: translateZ(0);
  transition: all var(--transition-speed);
}

/* Section Styling */
section {
  padding: 60px 0;
}

.page-header {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeInUp 0.8s ease;
}

.page-header h1 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  color: var(--primary-color);
  position: relative;
  display: inline-block;
}

.page-header h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--primary-color);
}

.page-header p {
  color: var(--text-color);
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--box-shadow);
  transition: all var(--transition-speed);
  text-align: center;
}

.card:hover {
  transform: translateY(-10px);
}

.card i {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.card h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
  font-weight: 600;
}

/* Skills */
.skills-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.skill-category h2 {
  margin-bottom: 20px;
  color: var(--secondary-color);
  position: relative;
  padding-left: 15px;
}

.skill-category h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 5px;
  background-color: var(--primary-color);
  border-radius: 5px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.skill-item {
  background-color: var(--card-bg);
  padding: 12px 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: all var(--transition-speed);
  color: var(--text-color);
}

.skill-item:hover {
  transform: translateY(-5px);
  background-color: var(--primary-color);
  color: white;
}

/* Experience Timeline */
.timeline {
  position: relative;
  margin: 50px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background-color: var(--primary-color);
}

.timeline-container {
  display: flex;
  flex-direction: column;
  position: relative;
}

.timeline-item {
  display: flex;
  justify-content: flex-end;
  padding-right: 30px;
  position: relative;
  margin-bottom: 50px;
  width: 50%;
  align-self: flex-start;
}

.timeline-item:nth-child(even) {
  align-self: flex-end;
  justify-content: flex-start;
  padding-right: 0;
  padding-left: 30px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  right: -12px;
  top: 20px;
  width: 25px;
  height: 25px;
  background-color: var(--primary-color);
  border-radius: 50%;
  z-index: 1;
}

.timeline-item:nth-child(even)::before {
  right: auto;
  left: -12px;
}

.timeline-content {
  background-color: var(--card-bg);
  color: var(--text-color);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  animation: fadeInUp 0.8s ease;
  position: relative;
}

.timeline-content::before {
  content: '';
  position: absolute;
  right: -15px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-left: 15px solid var(--card-bg);
  border-bottom: 15px solid transparent;
}

.timeline-item:nth-child(even) .timeline-content::before {
  right: auto;
  left: -15px;
  border-left: none;
  border-right: 15px solid var(--card-bg);
}

.timeline-info {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 20px;
  right: -145px;
  width: 120px;
}

.timeline-item:nth-child(even) .timeline-info {
  right: auto;
  left: -145px;
}

.timeline-info span {
  background-color: var(--secondary-color);
  color: white;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  text-align: center;
}

.timeline-content h3 {
  margin-bottom: 5px;
  color: var(--primary-color);
  font-size: 1.4rem;
}

.timeline-content h4 {
  margin-bottom: 15px;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.tech-tag {
  display: inline-block;
  background-color: var(--card-bg);
  color: var(--primary-color);
  padding: 5px 10px;
  border-radius: 30px;
  font-size: 0.8rem;
  margin: 5px 5px 5px 0;
  border: 1px solid var(--border-color);
  transition: all var(--transition-speed);
}

.tech-tag:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Education */
.education-item {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
  transition: all var(--transition-speed);
  color: var(--text-color);
}

.education-item:hover {
  transform: translateY(-5px);
}

.education-item h3 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.institution {
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 10px;
}

.details {
  color: var(--text-color);
  opacity: 0.85;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-details {
  list-style: none;
  margin-bottom: 30px;
}

.contact-details li {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.contact-details i {
  color: var(--primary-color);
  margin-right: 15px;
  font-size: 1.2rem;
  width: 20px;
  text-align: center;
}

.contact-details a {
  color: var(--text-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}

.contact-details a:hover {
  color: var(--primary-color);
}

.social-links-large {
  margin-top: 30px;
}

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--card-bg);
  padding: 15px;
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--text-color);
  transition: all var(--transition-speed);
  box-shadow: var(--box-shadow);
}

.social-item:hover {
  transform: translateY(-5px);
  color: white;
}

.social-item.linkedin:hover {
  background-color: #0077B5;
}

.social-item.github:hover {
  background-color: #333;
}

.social-item i {
  font-size: 1.5rem;
}

/* Footer */
footer {
  background-color: var(--secondary-color);
  color: white;
  padding: 30px 0;
  margin-top: 60px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.social-links a {
  color: white;
  margin-left: 15px;
  font-size: 1.2rem;
  transition: color var(--transition-speed);
}

.social-links a:hover {
  color: var(--primary-color);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Expertise section */
.expertise {
  margin-top: 50px;
}

.expertise h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary-color);
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.expertise h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
}

.expertise-area {
  background-color: var(--card-bg);
  padding: 30px;
  margin-bottom: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: all var(--transition-speed);
}

.expertise-area:hover {
  transform: translateY(-5px);
}

.expertise-area h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-weight: 600;
}

/* Theme toggle button styling */
.theme-toggle {
  display: flex;
  align-items: center;
}

#theme-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  font-size: 1.2rem;
  padding: 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#theme-toggle-btn:hover {
  background-color: var(--border-color);
}

/* Show/hide appropriate icon based on theme */
[data-theme="light"] .moon-icon {
  display: inline-block;
}

[data-theme="light"] .sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: none;
}

[data-theme="dark"] .sun-icon {
  display: inline-block;
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-image {
    grid-row: 1;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .cta-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  header .container {
    flex-direction: column;
  }
  
  .logo {
    margin-bottom: 15px;
  }
  
  nav ul {
    gap: 15px;
  }
  
  .timeline::before {
    left: 40px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 80px;
    padding-right: 0;
  }
  
  .timeline-item::before {
    left: 28px;
    right: auto;
  }
  
  .timeline-item:nth-child(even) {
    padding-left: 80px;
  }
  
  .timeline-item:nth-child(even)::before {
    left: 28px;
  }
  
  .timeline-info {
    left: -5px;
    right: auto;
    top: -40px;
    width: auto;
  }
  
  .timeline-item:nth-child(even) .timeline-info {
    left: -5px;
  }
  
  .timeline-content::before, 
  .timeline-item:nth-child(even) .timeline-content::before {
    display: none;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .social-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode */
body.dark-mode {
  background-color: var(--dark-bg);
  color: #f4f4f4;
}

body.dark-mode header {
  background-color: #2c3e50;
}

body.dark-mode header.scrolled {
  background-color: rgba(44, 62, 80, 0.95);
}

body.dark-mode .logo h1,
body.dark-mode nav a,
body.dark-mode .timeline-content h4 {
  color: #f4f4f4;
}

body.dark-mode .tagline {
  color: #ccc;
}

body.dark-mode .card,
body.dark-mode .timeline-content,
body.dark-mode .education-item,
body.dark-mode .expertise-area,
body.dark-mode .skill-item,
body.dark-mode .social-item {
  background-color: #3a4655;
  color: #f4f4f4;
}

body.dark-mode .page-header p,
body.dark-mode .hero-content p {
  color: #ccc;
}

body.dark-mode .tech-tag {
  background-color: #2c3e50;
  color: #f4f4f4;
}

body.dark-mode .timeline-content::before {
  border-left-color: #3a4655;
}

body.dark-mode .timeline-item:nth-child(even) .timeline-content::before {
  border-right-color: #3a4655;
}

body.dark-mode footer {
  background-color: #1a2530;
}
