/**
 * Custom CSS for Portfolio - High Contrast Version
 * @author Edgar Cano
 * @version 2.0
 */

:root {
  --primary-color: #1e40af;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --dark-color: #111827;
  --light-color: #f8f9fa;
  --text-color: #1f2937;
  --transition-speed: 0.3s;
}

/* Global improvements */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #111827;
  background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
  min-height: 100vh;
}

.container-fluid, .col {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading animation */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Improved link hover effects */
a {
  transition: all var(--transition-speed) ease;
}

a:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

/* Card improvements */
.card {
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
}

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

.card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 2rem;
}

.card-header h3 {
  margin: 0;
  font-weight: 700;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.card-body {
  padding: 2rem;
  background: #fff;
}

/* Button improvements */
.btn {
  transition: all var(--transition-speed) ease;
  border-radius: 8px;
  font-weight: 500;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Image optimizations */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-fluid {
  transition: transform var(--transition-speed) ease;
}

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

/* Navbar improvements */
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-speed) ease;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
}

.nav-link {
  position: relative;
  padding: 0.5rem 1rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all var(--transition-speed) ease;
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

/* Carousel improvements - Optimized for visibility */
.carousel {
  max-width: 900px;
  margin: 2rem auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  background: #ffffff;
  position: relative;
}

.carousel-inner {
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

.carousel-item {
  transition: transform 0.6s ease-in-out;
  position: relative;
  background: #1a1a1a;
  height: 700px;
  overflow: hidden;
}

.carousel-item a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-item img {
  width: 100%;
  height: 700px;
  object-fit: contain;
  object-position: center;
  display: block;
  max-height: none !important;
  filter: none !important;
  opacity: 1 !important;
}

.carousel-caption {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.85) 50%, transparent 100%);
  backdrop-filter: blur(12px);
  border-radius: 0;
  padding: 15px 20px 70px;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  max-width: 100%;
  max-height: 200px;
}

.carousel-caption h5 {
  color: #ffffff !important;
  font-weight: 800;
  font-size: 2.2rem;
  text-shadow: 3px 3px 10px rgba(0, 0, 0, 1), 0 0 20px rgba(0, 0, 0, 0.8);
  margin-bottom: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.1;
}

.carousel-caption p {
  color: #ffffff !important;
  font-size: 1.1rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 1), 0 0 15px rgba(0, 0, 0, 0.8);
  margin-bottom: 0;
  font-weight: 600;
  line-height: 1.5;
  max-width: 85%;
  margin-left: auto;
  margin-right: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  height: 50px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
}

.carousel-control-prev {
  left: 20px;
}

.carousel-control-next {
  right: 20px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 45px;
  height: 45px;
  background-color: rgba(102, 126, 234, 0.9);
  border-radius: 50%;
  padding: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.carousel-control-prev-icon:hover,
.carousel-control-next-icon:hover {
  background-color: rgba(118, 75, 162, 1);
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.carousel-indicators {
  bottom: 20px;
  z-index: 15;
  margin-bottom: 0;
}

.carousel-indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  margin: 0 6px;
  opacity: 1;
}

.carousel-indicators .active {
  background-color: rgba(255, 255, 255, 1);
  transform: scale(1.5);
  box-shadow: 0 0 15px rgba(255, 255, 255, 1);
}

/* Footer improvements */
.footer {
  background: linear-gradient(135deg, var(--dark-color) 0%, #343a40 100%);
  color: var(--light-color);
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer a {
  color: var(--light-color);
  text-decoration: none;
}

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

/* Social icons improvements */
.bi {
  transition: all var(--transition-speed) ease;
}

.bi:hover {
  color: var(--primary-color) !important;
  transform: scale(1.2) rotate(5deg);
}

/* Accessibility improvements */
:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Form improvements */
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Tab improvements */
.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
}

.nav-tabs .nav-link:hover {
  border-bottom-color: var(--primary-color);
}

.nav-tabs .nav-link.active {
  border-bottom-color: var(--primary-color);
  background: transparent;
}

/* Profile section improvements */
.profile-avatar {
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  max-width: 280px;
}

.profile-avatar:hover {
  transform: scale(1.05) rotate(2deg);
}

.profile-info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem;
  border-radius: 16px;
  color: white;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.social-icons a {
  display: inline-block;
  width: 50px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  margin: 0.3rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.social-icons a:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #667eea;
  transform: translateY(-5px) scale(1.1);
}

/* Experience cards */
.experience-card {
  border-left: 4px solid #667eea;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.experience-card:hover {
  transform: translateX(10px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
  border-left-color: #764ba2;
}

.experience-card img {
  max-width: 80px;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.experience-card a {
  color: #1e40af !important;
  font-weight: 700 !important;
  text-decoration: none;
}

.experience-card a:hover {
  color: #7c3aed !important;
}

.experience-card p,
.experience-card li {
  color: #000000 !important;
  font-weight: 500;
  font-size: 1rem;
}

.experience-card .fs-4 {
  color: #000000 !important;
  font-weight: 700 !important;
}

.experience-card .fs-5 {
  color: #1f2937 !important;
  font-weight: 600 !important;
}

.experience-card ul {
  color: #000000 !important;
}

.experience-card ul li {
  color: #000000 !important;
  margin-bottom: 0.5rem;
}

/* Tab improvements */
.tab-menu-heading {
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 2rem;
}

.nav.panel-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  border: none;
}

.nav.panel-tabs li a {
  border-radius: 12px;
  border: 2px solid transparent;
  font-weight: 600;
  transition: all 0.3s ease;
}

.nav.panel-tabs li a.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  border-color: transparent;
}

.nav.panel-tabs li a:hover:not(.active) {
  border-color: #667eea;
  transform: translateY(-2px);
}

/* Stats badges */
.stat-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  margin: 0.5rem;
  transition: all 0.3s ease;
}

.stat-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Slider improvements - Only for tech logos slider */
.slider {
  background: white;
  padding: 2rem 0;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin: 2rem 0;
  overflow: hidden;
}

.slider .slide img {
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.3s ease;
  max-height: 60px;
  object-fit: contain;
}

.slider .slide:hover img {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.1);
}

/* Responsive improvements */
@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .fs-3 {
    font-size: 1.5rem !important;
  }
  
  .carousel {
    margin: 1rem auto;
  }
  
  .carousel-item {
    height: 500px;
  }
  
  .carousel-item img {
    height: 500px;
    object-fit: contain;
    object-position: center;
  }
  
  .carousel-caption {
    padding: 12px 10px 60px;
    bottom: 0;
    max-height: 150px;
  }
  
  .carousel-caption h5 {
    font-size: 1.5rem;
    margin-bottom: 6px;
    letter-spacing: 1.5px;
  }
  
  .carousel-caption p {
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    max-width: 95%;
  }
  
  .carousel-indicators {
    bottom: 20px;
  }
  
  .carousel-control-prev,
  .carousel-control-next {
    width: 40px;
    height: 40px;
  }
  
  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 35px;
    height: 35px;
  }
  
  .profile-avatar {
    max-width: 200px;
  }
  
  .social-icons a {
    width: 40px;
    height: 40px;
    line-height: 40px;
  }
}

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

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.slide-in {
  animation: slideIn 0.5s ease-out;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.pulse-animation {
  animation: pulse 2s infinite;
}

/* Additional spacing and layout improvements */
.mt-custom {
  margin-top: 3rem;
}

.mb-custom {
  margin-bottom: 3rem;
}

section {
  margin: 3rem 0;
}

/* Text contrast improvements */
.display-4,
.display-1,
.display-2,
.display-3,
.display-5,
.display-6 {
  color: #111827 !important;
  font-weight: 700 !important;
}

.fs-3,
.fs-4,
.fs-5 {
  color: #1f2937 !important;
}

h1, h2, h3, h4, h5, h6 {
  color: #111827 !important;
  font-weight: 600;
}

p {
  color: #000000;
  line-height: 1.7;
  font-weight: 400;
}

li {
  color: #000000;
  font-weight: 400;
}

.text-black {
  color: #111827 !important;
}

/* Better link styling */
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.experience-card a) {
  color: #1e40af;
  text-decoration: none;
  position: relative;
  transition: all 0.3s ease;
  font-weight: 600;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.experience-card a):hover {
  color: #7c3aed;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.experience-card a)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
  transition: width 0.3s ease;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.experience-card a):hover::after {
  width: 100%;
}

/* Project Cards */
.project-card {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s ease;
  background: white;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

.project-image-wrapper {
  position: relative;
  overflow: hidden;
  height: 300px;
  background: #1a1a1a;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  padding: 10px;
}

.project-card:hover .project-image {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-overlay .btn {
  transform: translateY(20px);
  transition: transform 0.3s ease 0.1s;
}

.project-card:hover .project-overlay .btn {
  transform: translateY(0);
}

.card-title {
  color: #111827;
  font-size: 1.75rem;
}

.card-text {
  color: #374151;
  line-height: 1.7;
  font-size: 1rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .carousel,
  .btn {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --dark-color: #f8f9fa;
    --light-color: #212529;
  }
  
  body {
    background-color: #1a1a1a;
    color: var(--dark-color);
  }
  
  .card {
    background-color: #2d2d2d;
    color: var(--dark-color);
  }
}

/* Performance optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Utility classes */
.shadow-sm-hover:hover {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow-md-hover:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.shadow-lg-hover:hover {
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}
