/* Custom Styles for Portfolio */

/* Global box-sizing and overflow prevention */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

img {
  user-select: none;
  -webkit-user-drag: none;
}

/* Logo Animations */
.cursor-blink {
  animation: blink 1s step-end infinite;
  color: #f59e0b;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.logo-wrapper:hover .text-amber-500 {
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* Circuit-style Electron Animation */
.electron-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140%;
  height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

/* Circuit paths - clean geometric lines like circuit boards */
.circuit-path {
  position: absolute;
  stroke: rgb(245, 159, 11);
  fill: none;
  stroke-width: 1;
  opacity: 0.5;
}

.circuit-path-1 {
  animation: pulse-glow-path 3s ease-in-out infinite;
}

.circuit-path-2 {
  animation: pulse-glow-path 3s ease-in-out infinite 1s;
}

.circuit-path-3 {
  animation: pulse-glow-path 3s ease-in-out infinite 2s;
}

/* Electrons - glowing particles traveling clean paths */
.electron {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #f59e0b;
  border-radius: 50%;
  box-shadow:
    0 0 10px #f59e0b,
    0 0 20px #f59e0b,
    0 0 30px rgba(245, 158, 11, 0.6);
}

/* Circuit connection nodes - pulsing dots at intersections */
.circuit-node {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fb923cc6;
  border-radius: 50%;
  box-shadow:
    0 0 8px rgba(251, 146, 60, 0.633),
    0 0 12px rgba(251, 146, 60, 0.385);
  animation: node-pulse 2s ease-in-out infinite;
  top: 50%;
  left: 50%;
}

.node-1 {
  transform: translate(-60px, -20px);
  animation-delay: 0s;
}
.node-2 {
  transform: translate(0px, -10px);
  animation-delay: 0.4s;
}
.node-3 {
  transform: translate(40px, 5px);
  animation-delay: 0.8s;
}
.node-4 {
  transform: translate(-30px, 20px);
  animation-delay: 1.2s;
}

/* Animations */
@keyframes electron-move {
  0% {
    offset-distance: 0%;
    opacity: 0;
    transform: scale(0.5);
  }
  5% {
    opacity: 1;
    transform: scale(1);
  }
  95% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
    transform: scale(0.5);
  }
}

@keyframes pulse-glow-path {
  0%,
  100% {
    opacity: 0.3;
    filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.4));
  }
  50% {
    opacity: 0.6;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
  }
}

@keyframes node-pulse {
  0%,
  100% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(1.8);
    opacity: 1;
    box-shadow:
      0 0 12px rgba(251, 146, 60, 1),
      0 0 20px rgba(251, 146, 60, 0.6);
  }
}

/* Optional: Subtle scanning line effect */
.scan-line {
  position: absolute;
  top: 50%;
  left: -100%;
  width: 200%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    transparent 40%,
    rgba(245, 158, 11, 0.4) 50%,
    transparent 60%,
    transparent
  );
  animation: scan-horizontal 5s linear infinite;
}

@keyframes scan-horizontal {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #1c1917;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #92400e, #78350f);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #78350f, #92400e);
}

/* Responsive geometric shapes */
@media (max-width: 640px) {
  .geometric-shape.shape-1 {
    width: 8rem !important;
    height: 8rem !important;
  }
  .geometric-shape.shape-2 {
    width: 6rem !important;
    height: 6rem !important;
  }
  .geometric-shape.shape-3 {
    width: 4rem !important;
    height: 4rem !important;
  }
}

/* Responsive toast */
@media (max-width: 480px) {
  #toast-container {
    left: 1rem;
    right: 1rem;
  }
  .toast {
    max-width: 100%;
  }
}

/* Geometric Background Animations */
.geometric-shape {
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.shape-1 {
  animation: rotate-cw 60s linear infinite;
}

.shape-2 {
  animation: rotate-ccw 50s linear infinite;
}

.shape-3 {
  animation: float 8s ease-in-out infinite;
}

@keyframes rotate-cw {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotate-ccw {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Scroll Animations */
.animate-in {
  opacity: 0;
  transform: translateY(30px);
  animation: slide-up 0.8s ease forwards;
}

.animate-in:nth-child(2) {
  animation-delay: 0.2s;
}
.animate-in:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes slide-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays for children */
.animate-on-scroll:nth-child(1) {
  transition-delay: 0s;
}
.animate-on-scroll:nth-child(2) {
  transition-delay: 0.1s;
}
.animate-on-scroll:nth-child(3) {
  transition-delay: 0.2s;
}
.animate-on-scroll:nth-child(4) {
  transition-delay: 0.3s;
}
.animate-on-scroll:nth-child(5) {
  transition-delay: 0.4s;
}
.animate-on-scroll:nth-child(6) {
  transition-delay: 0.5s;
}

/* Header scrolled state */
.header-scrolled {
  background-color: rgba(28, 25, 23, 0.95) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Skills Tag Styles */
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fcd34d;
  background: rgba(146, 64, 14, 0.18);
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: 999px;
  transition: all 0.25s ease;
  cursor: default;
}

.skill-tag-icon {
  width: 16px;
  height: 16px;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.skill-tag:hover {
  background: rgba(180, 83, 9, 0.35);
  border-color: #d97706;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
  transform: translateY(-2px);
}

.skill-icon-wrap {
  width: 36px;
  height: 36px;
  background: rgba(180, 83, 9, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.skills-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.skills-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(180, 83, 9, 0.4),
    transparent
  );
}

.skills-divider-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #a8a29e;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Toast Styles */
.toast {
  background: rgba(28, 25, 23, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  color: #fef3c7;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.3s ease;
  max-width: 400px;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.toast-description {
  font-size: 0.875rem;
  color: #d6d3d1;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Experience Timeline */
.timeline-line {
  position: absolute;
  left: 1.5rem;
  top: 5rem;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #b45309, transparent);
}

/* Project card equal height in grid rows */
#projects-grid > div {
  display: flex;
  flex-direction: column;
}

#projects-grid .project-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#projects-grid .project-card > .p-6 {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#projects-grid .project-card > .p-6 > .flex.gap-4:last-child {
  margin-top: auto;
}

/* Project card image hover */
.project-image {
  transition: transform 0.5s ease;
  object-position: top;
}

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

/* Project image gallery overlay */
.project-img-wrapper {
  cursor: pointer;
  max-height: 300px;
}

.project-gallery-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.project-img-wrapper:hover .project-gallery-hint {
  opacity: 1;
}

.project-gallery-hint-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(41, 37, 36, 0.85);
  border: 1px solid rgba(180, 83, 9, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Mobile menu animation */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
  opacity: 0;
}

#mobile-menu.open {
  max-height: 300px;
  opacity: 1;
}

/* Subtle bounce for scroll-down chevron */
.subtle-bounce {
  opacity: 0;
  animation:
    arrow-entrance 0.4s ease forwards 0.8s,
    subtle-bounce 1.5s ease-in-out infinite 1.5s;
}

@keyframes arrow-entrance {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes subtle-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

input,
textarea {
  caret-color: #fabd23;
}

::selection {
  background-color: #fabd23;
  color: #1c1917;
}

#experience-timeline ::selection,
#skills-grid ::selection,
#projects-grid ::selection,
#certificates-grid ::selection,
#view-projects-button::selection {
  color: #111727;
  background-color: #fef3c7;
}

/* Waving hand animation */
.animate-wave {
  animation: wave 2.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%,
  100% {
    transform: rotate(0deg);
  }
  10% {
    transform: rotate(14deg);
  }
  20% {
    transform: rotate(-8deg);
  }
  30% {
    transform: rotate(14deg);
  }
  40% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(10deg);
  }
  60% {
    transform: rotate(0deg);
  }
}

#portfolio-logo,
nav,
#Hello-Message {
  user-select: none;
  -webkit-user-drag: none;
}

/* ==================== CERTIFICATES ==================== */

/* Provider card */
#certificates-grid > .animate-on-scroll {
  width: fit-content;
  max-width: 100%;
}

.cert-provider-card {
  position: relative;
}

.cert-provider-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 12px;
}

.cert-provider-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #b45309, #d97706);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cert-provider-icon-logo {
  background: #fff;
  padding: 4px;
  overflow: hidden;
}

.cert-provider-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.cert-provider-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fef3c7;
  flex-grow: 1;
}

.cert-provider-count {
  font-size: 0.8rem;
  color: #a8a29e;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(180, 83, 9, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Carousel wrapper */
.cert-carousel-wrapper {
  position: relative;
  padding: 8px 24px 24px;
}

.cert-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 4px;
  /* Hide scrollbar */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.cert-carousel::-webkit-scrollbar {
  display: none;
}

/* Carousel arrows */
.cert-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(180, 83, 9, 0.5);
  background: rgba(41, 37, 36, 0.9);
  backdrop-filter: blur(4px);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
}

.cert-carousel-wrapper:hover .cert-carousel-arrow {
  opacity: 1;
}

.cert-carousel-arrow:hover {
  background: rgba(180, 83, 9, 0.6);
  border-color: #d97706;
  transform: translateY(-50%) scale(1.1);
}

.cert-carousel-prev {
  left: 8px;
}

.cert-carousel-next {
  right: 8px;
}

/* Certificate thumbnail */
.cert-thumb {
  flex: 0 0 240px;
  height: 170px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(180, 83, 9, 0.25);
  transition: all 0.3s ease;
  background: #1c1917;
}

.cert-thumb:hover {
  border-color: #d97706;
  transform: translateY(-4px);
  box-shadow:
    0 8px 25px rgba(180, 83, 9, 0.2),
    0 0 0 1px rgba(245, 158, 11, 0.1);
}

.cert-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cert-thumb:hover .cert-thumb-img {
  transform: scale(1.08);
}

.cert-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(to top, rgba(28, 25, 23, 0.95), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cert-thumb:hover .cert-thumb-overlay {
  opacity: 1;
}

.cert-thumb-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fef3c7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== CERTIFICATE MODAL ==================== */

.cert-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cert-modal-overlay.active {
  opacity: 1;
}

.cert-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 9, 0.85);
  backdrop-filter: blur(12px);
}

.cert-modal-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
  justify-content: center;
}

.cert-modal-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(180, 83, 9, 0.5);
  background: rgba(41, 37, 36, 0.9);
  backdrop-filter: blur(4px);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cert-modal-close:hover {
  background: rgba(180, 83, 9, 0.6);
  border-color: #d97706;
  transform: scale(1.1);
}

.cert-modal-body {
  flex: 1;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cert-modal-image {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid rgba(180, 83, 9, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cert-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fef3c7;
  text-align: center;
  margin: 0;
}

.cert-modal-desc {
  font-size: 0.95rem;
  color: #a8a29e;
  text-align: center;
  max-width: 600px;
  line-height: 1.6;
  margin: 0;
}

.cert-modal-counter {
  font-size: 0.8rem;
  color: #78716c;
  letter-spacing: 0.05em;
}

.cert-modal-arrow {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(180, 83, 9, 0.5);
  background: rgba(41, 37, 36, 0.9);
  backdrop-filter: blur(4px);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cert-modal-arrow:hover {
  background: rgba(180, 83, 9, 0.6);
  border-color: #d97706;
  transform: scale(1.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .cert-thumb {
    flex: 0 0 200px;
    height: 140px;
  }

  .cert-carousel-wrapper {
    padding: 8px 16px 20px;
  }

  .cert-provider-header {
    padding: 16px 16px 8px;
    flex-wrap: wrap;
  }

  .cert-carousel-arrow {
    opacity: 1;
    width: 32px;
    height: 32px;
  }

  .cert-modal-content {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .cert-modal-arrow {
    width: 40px;
    height: 40px;
  }

  .cert-modal-close {
    top: -10px;
    right: 16px;
  }

  .cert-modal-body {
    order: -1;
  }

  .cert-modal-prev,
  .cert-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .cert-modal-prev {
    left: 4px;
  }

  .cert-modal-next {
    right: 4px;
  }

  .cert-modal-title {
    font-size: 1.1rem;
  }

  .cert-modal-desc {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .cert-thumb {
    flex: 0 0 170px;
    height: 120px;
  }

  .cert-provider-name {
    font-size: 1.1rem;
  }

  .cert-provider-count {
    font-size: 0.7rem;
  }
}

/* ==================== PROJECT GALLERY MODAL ==================== */

.proj-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.proj-modal-overlay.active {
  opacity: 1;
}

.proj-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 9, 0.88);
  backdrop-filter: blur(14px);
}

.proj-modal-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 92vw;
  max-height: 90vh;
  width: 100%;
  justify-content: center;
}

.proj-modal-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(180, 83, 9, 0.5);
  background: rgba(41, 37, 36, 0.9);
  backdrop-filter: blur(4px);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.proj-modal-close:hover {
  background: rgba(180, 83, 9, 0.6);
  border-color: #d97706;
  transform: scale(1.1);
}

.proj-modal-body {
  flex: 1;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.proj-modal-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid rgba(180, 83, 9, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease;
}

.proj-modal-counter {
  font-size: 0.85rem;
  color: #78716c;
  letter-spacing: 0.05em;
}

.proj-modal-arrow {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(180, 83, 9, 0.5);
  background: rgba(41, 37, 36, 0.9);
  backdrop-filter: blur(4px);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.proj-modal-arrow:hover {
  background: rgba(180, 83, 9, 0.6);
  border-color: #d97706;
  transform: scale(1.1);
}

/* Mobile responsive - project gallery modal */
@media (max-width: 768px) {
  .proj-modal-content {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .proj-modal-arrow {
    width: 40px;
    height: 40px;
  }

  .proj-modal-close {
    top: -10px;
    right: 16px;
  }

  .proj-modal-body {
    order: -1;
  }

  .proj-modal-prev,
  .proj-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .proj-modal-prev {
    left: 4px;
  }

  .proj-modal-next {
    right: 4px;
  }

  .project-gallery-hint-icon {
    width: 40px;
    height: 40px;
  }
}
