/* ===== MICRO-INTERACTIONS - SMOOTH HOVER STATES ===== */

/* Cubic-bezier easing functions */
:root {
  --ease-smooth: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-smooth-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== BUTTONS & LINKS ===== */
.btn,
a,
button {
  transition: all 0.3s var(--ease-smooth);
}

.btn-primary,
.btn-outline-success,
.btn-view,
.btn-demo,
.btn-github {
  transition: all 0.3s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover,
.btn-outline-success:hover,
.btn-view:hover,
.btn-demo:hover,
.btn-github:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(31, 80, 220, 0.3);
}

.btn-primary:active,
.btn-outline-success:active,
.btn-view:active {
  transform: translateY(-1px) scale(0.98);
  transition: all 0.1s var(--ease-smooth);
}

/* Ripple effect on click */
.btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.btn:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

/* ===== CARDS ===== */
.card,
.project-card,
.stat-card,
.contact-info-item,
.language-item,
.project-item {
  transition: all 0.4s var(--ease-smooth);
}

.card:hover,
.project-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 30px rgba(31, 80, 220, 0.25);
}

.stat-card:hover,
.contact-info-item:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 8px 20px rgba(31, 80, 220, 0.15);
}

.language-item:hover,
.project-item:hover {
  transform: translateX(5px) scale(1.01);
  box-shadow: 0 4px 12px rgba(31, 80, 220, 0.1);
}

/* ===== CONTAINERS ===== */
.contact-form-container,
.contact-info-container,
.faq-contact-section,
.stats-container,
.chart-container {
  transition: all 0.3s var(--ease-smooth-out);
}

.contact-form-container:hover,
.contact-info-container:hover,
.faq-contact-section:hover,
.stats-container:hover,
.chart-container:hover {
  transform: scale(1.01);
  box-shadow: 0 12px 30px rgba(31, 80, 220, 0.2);
}

/* ===== FORM INPUTS ===== */
.form-control,
.form-floating input,
.form-floating textarea {
  transition: all 0.3s var(--ease-smooth-out);
}

.form-control:focus,
.form-floating input:focus,
.form-floating textarea:focus {
  transform: scale(1.01);
  box-shadow: 0 0 0 0.25rem rgba(31, 80, 220, 0.25),
    inset 0 0 10px rgba(31, 80, 220, 0.1);
  transition: all 0.2s var(--ease-smooth);
}

.form-floating > label {
  transition: all 0.3s var(--ease-smooth-out);
}

/* ===== NAVBAR ITEMS ===== */
.navbar-nav .nav-link {
  transition: all 0.3s var(--ease-smooth-out);
  position: relative;
}

.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--color-primary);
  transition: width 0.3s var(--ease-smooth);
}

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

.navbar-nav .nav-link:hover {
  color: var(--color-primary) !important;
  transform: translateY(-2px);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle-btn {
  transition: all 0.3s var(--ease-smooth);
}

.theme-toggle-btn:hover {
  background-color: rgba(31, 80, 220, 0.1);
  transform: translateY(-2px) rotate(20deg);
}

.theme-toggle-btn i {
  transition: transform 0.3s var(--ease-smooth);
}

/* ===== FILTER BUTTONS ===== */
.filter-btn {
  transition: all 0.3s var(--ease-smooth);
}

.filter-btn:hover,
.filter-btn.active {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(31, 80, 220, 0.3);
}

.filter-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ===== SOCIAL ICONS ===== */
.social-icon {
  transition: all 0.3s var(--ease-smooth);
}

.social-icon:hover {
  transform: translateY(-5px) scale(1.15) rotate(5deg);
  box-shadow: 0 8px 20px rgba(31, 80, 220, 0.3);
}

.social-icon.discord:hover {
  transform: translateY(-5px) scale(1.15) rotate(-5deg);
}

.social-icon.github:hover {
  transform: translateY(-5px) scale(1.15) rotate(5deg);
}

/* ===== ICONS & BADGES ===== */
.tech-badge {
  transition: all 0.3s var(--ease-smooth-out);
}

.tech-badge:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 4px 12px rgba(75, 191, 115, 0.2);
}

.card-icon,
.stat-icon,
.contact-icon-bg {
  transition: all 0.3s var(--ease-smooth);
}

.card:hover .card-icon,
.stat-card:hover .stat-icon,
.contact-info-item:hover .contact-icon-bg {
  transform: scale(1.15) rotate(10deg);
}

/* ===== DROPDOWN ITEMS ===== */
.dropdown-item {
  transition: all 0.2s var(--ease-smooth-out);
  position: relative;
}

.dropdown-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--color-primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease-smooth);
}

.dropdown-item:hover::before {
  transform: scaleY(1);
}

.dropdown-item:hover {
  transform: translateX(5px);
  padding-left: 20px;
}

/* ===== ACCORDION ITEMS ===== */
.accordion-button {
  transition: all 0.3s var(--ease-smooth);
}

.accordion-button:hover {
  background-color: rgba(31, 80, 220, 0.05);
  transform: translateX(5px);
}

.accordion-button:not(.collapsed) {
  transform: scale(1.02);
}

/* ===== RESPONSE ICON ===== */
.response-icon {
  transition: all 0.3s var(--ease-smooth);
}

.response-time:hover .response-icon {
  transform: scale(1.1) rotate(-10deg);
}

/* ===== AVATAR & IMAGES ===== */
.avatar-circle {
  transition: all 0.4s var(--ease-smooth);
}

.avatar-circle:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 15px 40px rgba(31, 80, 220, 0.2);
}

.card-img-top {
  transition: all 0.3s var(--ease-smooth-out);
}

.card:hover .card-img-top {
  transform: scale(1.1) rotate(2deg);
}

/* ===== PROGRESS BARS ===== */
.language-progress,
.project-progress {
  transition: all 0.8s var(--ease-smooth-out);
}

.language-item:hover .language-progress,
.project-item:hover .project-progress {
  box-shadow: 0 0 10px rgba(31, 80, 220, 0.3);
}

/* ===== TEXT ELEMENTS ===== */
.card-title,
.section-title,
.breakdown-title {
  transition: all 0.3s var(--ease-smooth-out);
}

.card:hover .card-title {
  color: var(--color-primary);
  transform: translateX(2px);
}

/* ===== MODAL ANIMATIONS ===== */
.modal.fade {
  transition: opacity 0.4s var(--ease-smooth-out);
}

.modal.show {
  animation: slideIn 0.4s var(--ease-smooth);
}

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

/* ===== LINK HOVERS ===== */
a {
  transition: all 0.3s var(--ease-smooth-out);
}

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

.contact-link {
  transition: all 0.3s var(--ease-smooth);
}

.contact-link:hover {
  transform: scale(1.05);
}

/* ===== HIGHLIGHT TEXT ===== */
.highlight {
  transition: all 0.3s var(--ease-smooth-out);
  position: relative;
}

.highlight::after {
  transition: transform 0.3s var(--ease-smooth);
}

/* ===== SMOOTH GLOBAL TRANSITIONS ===== */
*:not(.header) {
  transition-property: background-color, border-color, color, box-shadow,
    transform, opacity;
  transition-duration: 0.3s;
  transition-timing-function: var(--ease-smooth-out);
}

/* Optimisation performance */
button,
.btn,
a,
.card,
[role="button"] {
  will-change: transform, box-shadow;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
