/* ResumeInsight Enhanced Styles */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-blue: #3B82F6;
  --primary-cyan: #06B6D4;
  --primary-purple: #8B5CF6;
  --accent-green: #10B981;
  --accent-orange: #F59E0B;
  --accent-red: #EF4444;
  --dark-900: #0F172A;
  --dark-800: #1E293B;
  --dark-700: #334155;
  --dark-600: #475569;
  --glass-bg: rgba(30, 41, 59, 0.8);
  --glass-border: rgba(71, 85, 105, 0.3);
}

* {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

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

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.animate-fade-in {
  animation: fade-in 0.8s ease-out;
}

.animate-slide-up {
  animation: slide-up 0.6s ease-out forwards;
  opacity: 0;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

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

.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  background-size: 200px 100%;
  animation: shimmer 2s infinite;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(100, 116, 139, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.8);
}

/* Enhanced Components */
.glass-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-border {
  position: relative;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan), var(--primary-purple));
  border-radius: 12px;
  padding: 2px;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--dark-800);
  border-radius: 10px;
  z-index: -1;
}

.skill-tag {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 600;
  animation: slide-up 0.4s ease-out;
  margin-right: 0.75rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.skill-tag:hover::before {
  left: 100%;
}

.skill-tag.matched {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6EE7B7;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.skill-tag.matched:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.skill-tag.missing {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #FCA5A5;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.skill-tag.missing:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

/* Enhanced Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan));
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

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

.btn-secondary {
  background: rgba(139, 92, 246, 0.2);
  color: #A78BFA;
  border: 1px solid rgba(139, 92, 246, 0.5);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

/* Score Cards */
.score-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.score-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-blue), var(--primary-cyan));
  transform: scaleX(0);
  transition: transform 0.5s ease;
}

.score-card:hover::before {
  transform: scaleX(1);
}

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

/* Loading States */
.loading-dots {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.loading-dots div {
  position: absolute;
  top: 33px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--primary-cyan);
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-dots div:nth-child(1) {
  left: 8px;
  animation: loading-dots1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
  left: 8px;
  animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
  left: 32px;
  animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
  left: 56px;
  animation: loading-dots3 0.6s infinite;
}

@keyframes loading-dots1 {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

@keyframes loading-dots3 {
  0% { transform: scale(1); }
  100% { transform: scale(0); }
}

@keyframes loading-dots2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(24px, 0); }
}

li {
  padding-left: 0.5rem;
  margin-bottom: 0.5rem;
}

li:before {
  content: "→ ";
  color: rgb(96, 165, 250);
  font-weight: bold;
  margin-right: 0.5rem;
}

#gaps li:before {
  color: rgb(249, 115, 22);
}

#suggestions li:before {
  color: rgb(59, 130, 246);
}

#strengthsList li:before {
  color: rgb(34, 197, 94);
}

/* Modern Upload Section Enhancements */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes border-dance {
  0%, 100% {
    border-color: rgba(59, 130, 246, 0.3);
  }
  25% {
    border-color: rgba(6, 182, 212, 0.3);
  }
  50% {
    border-color: rgba(139, 92, 246, 0.3);
  }
  75% {
    border-color: rgba(6, 182, 212, 0.3);
  }
}

.upload-hover-effect {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-hover-effect:hover {
  transform: scale(1.02);
}

/* Stats Grid Animation Delays */
.stats-grid-item-1 {
  animation-delay: 0s;
}
.stats-grid-item-2 {
  animation-delay: 0.1s;
}
.stats-grid-item-3 {
  animation-delay: 0.2s;
}
.stats-grid-item-4 {
  animation-delay: 0.3s;
}

/* Progress Bar Animation */
@keyframes progress-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.progress-animate {
  animation: progress-pulse 2s ease-in-out infinite;
}

/* Card Reveal Animation */
@keyframes card-reveal {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-reveal {
  animation: card-reveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Enhanced Glow Effects */
.glow-blue {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), 0 0 40px rgba(59, 130, 246, 0.1);
}

.glow-cyan {
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3), 0 0 40px rgba(6, 182, 212, 0.1);
}

.glow-purple {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3), 0 0 40px rgba(139, 92, 246, 0.1);
}

/* Text Gradient Animations */
@keyframes text-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.text-shimmer {
  background: linear-gradient(90deg, #3B82F6, #06B6D4, #8B5CF6, #3B82F6);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-shimmer 3s linear infinite;
}

/* Modern Input Focus States */
textarea:focus,
select:focus,
input[type="file"]:focus + label {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 10px 30px -10px rgba(59, 130, 246, 0.3);
}

/* Spinner Animation */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(59, 130, 246, 0.3);
  border-top: 4px solid #3B82F6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

/* Answer Toggle Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 500px;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    max-height: 500px;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
}

/* Mobile Sidebar Styles */
#mobileSidebarOverlay {
  transition: opacity 0.3s ease;
}

#mobileSidebarOverlay.show {
  display: block;
  opacity: 1;
}

#mobileSidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90vw;
}

#mobileSidebar.open {
  transform: translateX(0);
}

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

/* Mobile Menu Button Animation */
#mobileMenuBtn:active {
  transform: scale(0.95);
}

/* Sidebar Link Active State */
#mobileSidebar a.active {
  background-color: rgba(51, 65, 85, 0.1);
  color: #0F172A;
}

/* Smooth Sidebar Animations */
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* Mobile Sidebar Content Animations */
#mobileSidebar nav a {
  animation: fade-in 0.3s ease-out forwards;
  opacity: 0;
}

#mobileSidebar.open nav a {
  animation: fade-in 0.3s ease-out forwards;
}

#mobileSidebar.open nav a:nth-child(1) { animation-delay: 0.05s; }
#mobileSidebar.open nav a:nth-child(2) { animation-delay: 0.1s; }
#mobileSidebar.open nav a:nth-child(3) { animation-delay: 0.15s; }
#mobileSidebar.open nav a:nth-child(4) { animation-delay: 0.2s; }
#mobileSidebar.open nav a:nth-child(5) { animation-delay: 0.25s; }
#mobileSidebar.open nav a:nth-child(6) { animation-delay: 0.3s; }
#mobileSidebar.open nav a:nth-child(7) { animation-delay: 0.35s; }

/* Responsive Improvements */
@media (max-width: 768px) {
  .animate-slide-up {
    animation-delay: 0s !important;
  }
  
  .glass-card {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  /* Adjust navbar padding for mobile */
  nav .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Mobile sidebar width adjustment */
  #mobileSidebar {
    width: min(320px, 85vw);
  }
}

@media (max-width: 480px) {
  #mobileSidebar {
    width: min(280px, 90vw);
  }
}

/* Theme Light (Landing Page Aesthetic) Overrides */
body.theme-light {
  background-color: #FAF8F5 !important;
  background-image: none !important;
  color: #1E293B !important;
}

body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light h4,
body.theme-light h5,
body.theme-light h6 {
  color: #0F172A !important;
}

body.theme-light p,
body.theme-light span,
body.theme-light li {
  color: #334155;
}

body.theme-light .text-white {
  color: #0F172A !important;
}

body.theme-light .text-gray-100,
body.theme-light .text-gray-200,
body.theme-light .text-gray-300,
body.theme-light .text-slate-300,
body.theme-light .text-blue-100,
body.theme-light .text-indigo-100 {
  color: #334155 !important;
}

body.theme-light .text-gray-400,
body.theme-light .text-slate-400 {
  color: #64748B !important;
}

body.theme-light .text-cyan-400 {
  color: #0891B2 !important;
}

body.theme-light .text-blue-400 {
  color: #2563EB !important;
}

body.theme-light .text-purple-400 {
  color: #7C3AED !important;
}

body.theme-light .text-emerald-400 {
  color: #059669 !important;
}

body.theme-light .text-amber-400 {
  color: #D97706 !important;
}

body.theme-light .text-rose-400 {
  color: #E11D48 !important;
}

body.theme-light .text-violet-400 {
  color: #7C3AED !important;
}

/* Gradient text adjustments */
body.theme-light .from-blue-400 {
  --tw-gradient-from: #2563EB !important;
}
body.theme-light .via-cyan-400 {
  --tw-gradient-via: #0891B2 !important;
}
body.theme-light .to-purple-400 {
  --tw-gradient-to: #7D3AED !important;
}
body.theme-light .from-indigo-400 {
  --tw-gradient-from: #4F46E5 !important;
}
body.theme-light .to-purple-400 {
  --tw-gradient-to: #7C3AED !important;
}
body.theme-light .from-green-300 {
  --tw-gradient-from: #059669 !important;
}
body.theme-light .to-emerald-300 {
  --tw-gradient-to: #047857 !important;
}
body.theme-light .from-orange-300 {
  --tw-gradient-from: #D97706 !important;
}
body.theme-light .to-yellow-300 {
  --tw-gradient-to: #B45309 !important;
}
body.theme-light .from-blue-300 {
  --tw-gradient-from: #2563EB !important;
}
body.theme-light .to-cyan-300 {
  --tw-gradient-to: #0891B2 !important;
}
body.theme-light .from-purple-300 {
  --tw-gradient-from: #7C3AED !important;
}
body.theme-light .via-pink-300 {
  --tw-gradient-via: #DB2777 !important;
}
body.theme-light .to-purple-300 {
  --tw-gradient-to: #6D28D9 !important;
}
body.theme-light .from-red-300 {
  --tw-gradient-from: #DC2626 !important;
}
body.theme-light .via-orange-300 {
  --tw-gradient-via: #EA580C !important;
}
body.theme-light .to-red-300 {
  --tw-gradient-to: #B91C1C !important;
}

/* Card / Box Background Overrides */
body.theme-light .bg-slate-900,
body.theme-light .bg-slate-950,
body.theme-light .bg-slate-800,
body.theme-light .bg-slate-800\/80,
body.theme-light .bg-slate-800\/50,
body.theme-light .bg-slate-800\/40,
body.theme-light .bg-slate-700\/30,
body.theme-light .bg-slate-700\/50,
body.theme-light .bg-slate-800\/90,
body.theme-light .bg-slate-900\/80,
body.theme-light .bg-slate-900\/50,
body.theme-light .bg-slate-950\/50,
body.theme-light .bg-slate-900\/40,
body.theme-light .bg-gradient-to-br[class*="slate-800"],
body.theme-light .bg-gradient-to-br[class*="slate-900"],
body.theme-light .bg-gradient-to-br[class*="indigo-900"],
body.theme-light .bg-gradient-to-br[class*="emerald-900"],
body.theme-light .bg-gradient-to-br[class*="amber-900"],
body.theme-light .bg-gradient-to-br[class*="rose-900"],
body.theme-light .bg-gradient-to-br[class*="violet-900"],
body.theme-light .bg-gradient-to-br[class*="blue-600\/20"],
body.theme-light .bg-gradient-to-br[class*="purple-600\/20"],
body.theme-light .bg-gradient-to-br[class*="green-600\/20"],
body.theme-light .bg-gradient-to-br[class*="green-600\/30"],
body.theme-light .bg-gradient-to-br[class*="orange-600\/20"] {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02) !important;
}

body.theme-light .border-slate-800,
body.theme-light .border-slate-700,
body.theme-light .border-slate-700\/50,
body.theme-light .border-slate-600,
body.theme-light .border-slate-600\/50,
body.theme-light .border-slate-600\/30,
body.theme-light .border-indigo-500\/30,
body.theme-light .border-emerald-500\/30,
body.theme-light .border-amber-500\/30,
body.theme-light .border-rose-500\/30,
body.theme-light .border-violet-500\/30,
body.theme-light .border-blue-500\/30,
body.theme-light .border-purple-500\/30,
body.theme-light .border-green-500\/30,
body.theme-light .border-orange-500\/30 {
  border-color: #E2E8F0 !important;
}

body.theme-light .border-dashed {
  border-color: #CBD5E1 !important;
}

body.theme-light .border-dashed:hover {
  border-color: #3B82F6 !important;
  background-color: #F8FAFC !important;
}

/* Inputs, Textareas, and Selects */
body.theme-light input,
body.theme-light textarea,
body.theme-light select {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
}

body.theme-light input:focus,
body.theme-light textarea:focus,
body.theme-light select:focus {
  border-color: #3B82F6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

body.theme-light input::placeholder,
body.theme-light textarea::placeholder {
  color: #94A3B8 !important;
}

/* Modal and overlay updates */
body.theme-light .fixed.inset-0.bg-black\/70 {
  background-color: rgba(15, 23, 42, 0.6) !important;
}

/* Specific buttons or hover states */
body.theme-light .hover\:bg-slate-700\/30:hover {
  background-color: #F1F5F9 !important;
}

body.theme-light .bg-slate-700\/50 {
  background-color: #F1F5F9 !important;
  color: #1E293B !important;
}
