/* SplitStar - Space Theme Custom Styles */
/* Mobile-first responsive design with stellar aesthetics */

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #0F0F23 0%, #1A1B3A 50%, #0A0A1A 100%);
  color: white;
}

/* Space-themed background patterns */
.space-bg {
  background: radial-gradient(circle at 20% 80%, rgba(25, 211, 197, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(105, 53, 211, 0.1) 0%, transparent 50%),
              linear-gradient(135deg, #0F0F23 0%, #1A1B3A 50%, #0A0A1A 100%);
}

/* Mobile viewport optimization */
@viewport {
  width: device-width;
  zoom: 1;
}

/* Smooth transitions */
* {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Navigation transitions */
.nav-tab, .nav-bottom-tab {
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(25, 211, 197, 0.3), rgba(105, 53, 211, 0.3));
  color: #19D3C5;
  font-weight: 600;
  border: 1px solid rgba(25, 211, 197, 0.3);
  box-shadow: 0 0 15px rgba(25, 211, 197, 0.2);
}

.nav-bottom-tab.active {
  color: #19D3C5;
  transform: translateY(-2px);
  text-shadow: 0 0 10px rgba(25, 211, 197, 0.5);
}

.nav-bottom-tab.active i {
  color: #19D3C5;
  font-weight: 600;
  filter: drop-shadow(0 0 8px rgba(25, 211, 197, 0.6));
}

.nav-bottom-tab {
  color: #94a3b8;
  transition: all 0.3s ease;
}

/* Tab content animations */
.tab-content {
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Space card hover effects */
.space-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  background: rgba(26, 27, 58, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(25, 211, 197, 0.2);
}

.space-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(25, 211, 197, 0.1), 
              0 0 20px rgba(105, 53, 211, 0.2);
  border-color: rgba(25, 211, 197, 0.4);
}

/* Glassmorphism effects for space theme */
.glass {
  background: rgba(26, 27, 58, 0.4);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Button enhancements */
button {
  transition: all 0.2s ease;
  touch-action: manipulation;
}

button:active {
  transform: scale(0.98);
}

/* Enhanced Bottom Navigation */
.nav-tab {
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-tab:hover {
  background: rgba(25, 211, 197, 0.1);
  backdrop-filter: blur(8px);
}

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

.nav-tab.active {
  background: rgba(25, 211, 197, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(25, 211, 197, 0.3);
}

.nav-tab.active i {
  color: #19D3C5 !important;
}

.nav-tab.active span {
  color: #19D3C5 !important;
  font-weight: 600;
}

/* Space-themed Floating Action Button */
#add-expense-btn, .add-expense-bottom div {
  background: linear-gradient(135deg, #19D3C5, #6935D3);
  box-shadow: 0 8px 32px rgba(25, 211, 197, 0.4), 
              0 0 20px rgba(105, 53, 211, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#add-expense-btn:hover, .add-expense-bottom:hover div {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 40px rgba(25, 211, 197, 0.6), 
              0 0 30px rgba(105, 53, 211, 0.5);
}

#add-expense-btn:active, .add-expense-bottom:active div {
  transform: translateY(0) scale(1);
}

/* Navigation Grid Alignment */
nav .grid-cols-6 {
  grid-template-columns: 1fr 1fr 1.2fr 1fr 1fr 1fr;
}

/* Notification Badge Animation */
.nav-tab .relative span {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Modal animations */
.fixed.inset-0 {
  animation: modalFadeIn 0.3s ease-out;
  backdrop-filter: blur(4px);
}

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

.fixed .bg-white {
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Loading spinner */
.animate-spin {
  animation: spin 1s linear infinite;
}

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

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Responsive design adjustments */
@media (max-width: 640px) {
  .max-w-md {
    max-width: 100%;
  }
  
  .p-4 {
    padding: 1rem;
  }
}

/* Badge rarity colors */
.rarity-common {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  color: #374151;
}

.rarity-rare {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
}

.rarity-epic {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #7c3aed;
}

.rarity-legendary {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #d97706;
}

/* Gamification elements */
.level-badge {
  background: linear-gradient(45deg, #19D3C5, #192851);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.points-display {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Form input styles - Black text for readability */
input, select, textarea {
  color: #000000 !important;
  background-color: #ffffff !important;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 1rem;
  transition: all 0.2s ease;
}

input::placeholder, textarea::placeholder {
  color: #6b7280 !important;
}

/* Input focus states */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #19D3C5;
  box-shadow: 0 0 0 3px rgba(25, 211, 197, 0.1);
  color: #000000 !important;
  background-color: #ffffff !important;
}

/* Ensure labels are visible */
label {
  color: #ffffff !important;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

/* Option elements in select dropdowns */
option {
  color: #000000 !important;
  background-color: #ffffff !important;
}

/* Success/Error states */
.success-state {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: #10b981;
}

.error-state {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-color: #ef4444;
}

/* Progressive Web App enhancements */
@media (display-mode: standalone) {
  body {
    user-select: none;
    -webkit-user-select: none;
  }
  
  .max-w-md {
    height: 100vh;
    max-height: 100vh;
  }
}

/* Space-themed animations */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(25, 211, 197, 0.5); }
  50% { box-shadow: 0 0 20px rgba(25, 211, 197, 0.8), 0 0 30px rgba(105, 53, 211, 0.4); }
}

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

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

.glow {
  animation: glow 4s ease-in-out infinite;
}

/* Stellar gradient text */
.stellar-text {
  background: linear-gradient(135deg, #19D3C5, #6935D3, #FFFFFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Space particle effects */
.particles {
  position: relative;
  overflow: hidden;
}

.particles::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #19D3C5, transparent),
    radial-gradient(2px 2px at 40px 70px, #6935D3, transparent),
    radial-gradient(1px 1px at 90px 40px, #FFFFFF, transparent),
    radial-gradient(1px 1px at 130px 80px, #19D3C5, transparent),
    radial-gradient(2px 2px at 160px 30px, #6935D3, transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: twinkle 8s linear infinite;
  opacity: 0.6;
  pointer-events: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .bg-gray-100 {
    background-color: #ffffff;
    border: 1px solid #000000;
  }
  
  .text-gray-600 {
    color: #000000;
  }
}