/**
 * CUSTOM STYLES
 * Additional styles beyond Tailwind CSS
 */

/* ===== SMOOTH SCROLLING ===== */
html {
  scroll-behavior: smooth;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== REMOVE TAP HIGHLIGHT ON MOBILE ===== */
* {
  -webkit-tap-highlight-color: transparent;
}

/* ===== FONT SIZE CONTROL ===== */
html.font-size-small {
  font-size: 14px;
}

html.font-size-large {
  font-size: 18px;
}

html.font-size-xl {
  font-size: 20px;
}

/* ===== REDUCED MOTION CLASS ===== */
.reduced-motion * {
  animation: none !important;
  transition: none !important;
}

/* ===== DARK MODE ===== */
.dark-mode {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #f5f5f5;
  --text-secondary: #d1d5db;
}

.dark-mode body {
  background: linear-gradient(to bottom, #1a1a1a, #2d2d2d, #1a1a1a);
  color: #f5f5f5;
}

.dark-mode .bg-white {
  background-color: #2d2d2d !important;
}

.dark-mode .text-slate-900 {
  color: #f5f5f5 !important;
}

.dark-mode .text-slate-700 {
  color: #d1d5db !important;
}

.dark-mode .text-slate-600 {
  color: #9ca3af !important;
}

.dark-mode .border-slate-200 {
  border-color: #404040 !important;
}

.dark-mode .bg-slate-50 {
  background-color: #252525 !important;
}

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

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

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

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

@keyframes blob {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

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

/* ===== ANIMATION CLASSES ===== */
.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeIn {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-slideDown {
  animation: slideDown 0.3s ease-out forwards;
}

.animate-pulse-slow {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

.animation-delay-6000 {
  animation-delay: 6s;
}

/* ===== SCROLL REVEAL ===== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ===== STAGGER DELAYS ===== */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ===== CARD HOVER EFFECT ===== */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark-mode .card-hover:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4),
              0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* ===== BUTTON SCALE EFFECT ===== */
.btn-scale {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn-scale:active {
  transform: scale(0.95);
}

/* ===== NAVIGATION ACTIVE STATE ===== */
.nav-link.active {
  color: #10b981;
  border-bottom-color: #10b981 !important;
  font-weight: 600;
}

/* ===== PERSONA BUTTONS ===== */
.persona-btn {
  background-color: transparent;
  color: #64748b;
  border: 1px solid transparent;
}

.persona-btn:hover {
  background-color: #f0fdf4;
  color: #10b981;
  border-color: #d1fae5;
}

.persona-btn.active {
  background-color: #10b981;
  color: white;
  border-color: #10b981;
}

/* ===== MOBILE MENU ===== */
#mobileMenu {
  display: none;
}

#mobileMenu.open {
  display: block;
}

.mobile-menu-item {
  opacity: 0;
  animation: slideDown 0.3s ease-out forwards;
}

/* ===== SKIP TO CONTENT LINK ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only:focus {
  position: fixed;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ===== FOCUS STATES ===== */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
details:focus,
summary:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ===== CUSTOM SCROLLBAR (Webkit browsers) ===== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ===== PRINT STYLES ===== */
@media print {
  .no-print {
    display: none !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
  
  abbr[title]:after {
    content: " (" attr(title) ")";
  }
}

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

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  .card-hover {
    border: 2px solid currentColor;
  }
}

/* ===== DARK MODE SUPPORT (Optional) ===== */
/* Uncomment to enable dark mode */
/*
@media (prefers-color-scheme: dark) {
  body {
    background: #0f172a;
    color: #f1f5f9;
  }
  
  .bg-white {
    background: #1e293b !important;
  }
  
  .text-slate-900 {
    color: #f1f5f9 !important;
  }
  
  .text-slate-700 {
    color: #cbd5e1 !important;
  }
  
  .text-slate-600 {
    color: #94a3b8 !important;
  }
  
  .border-slate-200 {
    border-color: #334155 !important;
  }
}
*/

/* ===== UTILITY CLASSES ===== */
.text-balance {
  text-wrap: balance;
}

.grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-square {
  aspect-ratio: 1 / 1;
}

/* ===== LOADING STATE ===== */
.loading {
  pointer-events: none;
  opacity: 0.6;
}

.spinner {
  border: 2px solid #f3f4f6;
  border-top: 2px solid #10b981;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE IMAGES ===== */
img {
  max-width: 100%;
  height: auto;
}

/* ===== FORM VALIDATION ===== */
input:invalid,
textarea:invalid {
  border-color: #ef4444;
}

input:valid,
textarea:valid {
  border-color: #10b981;
}

/* ===== GRADIENT TEXT (for headings) ===== */
.gradient-text {
  background: linear-gradient(to right, #0f172a, #475569);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== CUSTOM SHADOWS ===== */
.shadow-soft {
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.shadow-glow {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}
