/* ============================================
   Portfolio Website — Custom Styles
   Nithis Deedankor
   ============================================ */

/* ---- Smooth Scrolling ---- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

/* ---- Selection ---- */
::selection {
  background-color: rgba(59, 130, 246, 0.3);
  color: #fff;
}

/* ---- Focus Styles ---- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Text Justify ---- */
.text-justify {
  text-align: justify;
  text-justify: inter-word;
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  transition: left 0.3s ease;
  z-index: 0;
}

.btn-primary:hover::before {
  left: 0;
}

.btn-primary > * {
  position: relative;
  z-index: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #d1d5db;
  border: 1px solid #374151;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  color: #fff;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* ---- Cards ---- */
.card {
  background: rgba(26, 26, 46, 0.5);
  border: 1px solid rgba(55, 65, 81, 0.5);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ---- Clickable Cards (Experience & Projects) ---- */
.card.cursor-pointer {
  cursor: pointer;
  position: relative;
}

.card.cursor-pointer::after {
  content: 'Click for details →';
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  font-size: 0.65rem;
  color: #4b5563;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card.cursor-pointer:hover::after {
  opacity: 1;
  color: #60a5fa;
}

/* ---- Skill Badges ---- */
.skill-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: #d1d5db;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 9999px;
  transition: all 0.25s ease;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}

.skill-badge:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  transform: translateY(-1px);
}

.skill-badge::after {
  content: 'ⓘ';
  margin-left: 4px;
  font-size: 0.65rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: #60a5fa;
}

.skill-badge:hover::after {
  opacity: 1;
}

/* ---- Tech Tags ---- */
.tech-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: #9ca3af;
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(55, 65, 81, 0.4);
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tech-tag:hover {
  color: #d1d5db;
  border-color: rgba(59, 130, 246, 0.3);
}

/* ---- Section Heading Animation ---- */
.section-heading {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-heading.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Fade In Up Animation ---- */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Staggered fade for cards ---- */
.card.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.card.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Navbar Shadow on Scroll ---- */
#navbar.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  background: rgba(10, 10, 10, 0.95);
}

/* ---- Active Nav Link ---- */
.nav-link.active {
  color: #60a5fa !important;
}

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

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* ---- Pulse Glow for Accent Elements ---- */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(59, 130, 246, 0);
  }
}

/* ---- Gradient Text ---- */
.gradient-text {
  background: linear-gradient(135deg, #60a5fa, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Mobile Menu Transition ---- */
#mobile-menu {
  transition: all 0.3s ease;
}

#mobile-menu:not(.hidden) {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Hero Profile Image Effect ---- */
@media (min-width: 768px) {
  .ring-accent\/30 {
    animation: pulse-glow 3s infinite;
  }
}

/* ---- Modal Styles ---- */
#modal-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#modal-overlay.visible {
  opacity: 1;
}

#modal-container {
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease;
}

#modal-overlay.visible #modal-container {
  transform: scale(1) translateY(0);
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Modal content styles */
#modal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

#modal-content .modal-duration {
  font-size: 0.875rem;
  color: #60a5fa;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

#modal-content .modal-subtitle {
  font-size: 0.875rem;
  color: #9ca3af;
  margin-bottom: 1.5rem;
}

#modal-content .modal-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

#modal-content ul {
  list-style: none;
  padding: 0;
}

#modal-content ul li {
  padding: 0.4rem 0;
  color: #d1d5db;
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

#modal-content ul li::before {
  content: '▹';
  color: #3b82f6;
  flex-shrink: 0;
}

#modal-content .modal-download-area {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(59, 130, 246, 0.05);
  border: 1px dashed rgba(59, 130, 246, 0.2);
  border-radius: 0.5rem;
  text-align: center;
}

#modal-content .modal-download-area p {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

/* ---- Skill Tooltip ---- */
#skill-tooltip {
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#skill-tooltip.visible {
  opacity: 1;
}

/* ---- Resume Dropdown ---- */
#resume-selector {
  -webkit-appearance: none;
  -moz-appearance: none;
}

#resume-selector option {
  background: #1a1a2e;
  color: #d1d5db;
  padding: 0.5rem;
}

/* ---- Responsive Typography Adjustments ---- */
@media (max-width: 640px) {
  #hero h1 {
    font-size: 2.25rem;
    line-height: 1.2;
  }

  #hero p.text-xl {
    font-size: 1.125rem;
  }

  .card {
    padding: 1.25rem;
  }

  .card.cursor-pointer::after {
    content: 'Tap for details →';
    font-size: 0.6rem;
  }
}

/* ---- Print Styles ---- */
@media print {
  nav,
  .btn-primary,
  .btn-secondary,
  footer,
  #mobile-menu-btn,
  #modal-overlay,
  #skill-tooltip {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  .card {
    border: 1px solid #ccc;
    background: #fff;
    break-inside: avoid;
  }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in-up,
  .section-heading,
  .card.fade-in-up {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .btn-primary::before {
    transition: none;
  }

  .animate-bounce {
    animation: none;
  }

  #modal-container {
    transition: none;
  }
}