/* OnlyFunz - Advanced CSS with Animations & Effects */

@tailwind base;
@tailwind components;
@tailwind utilities;

/* ==================== GRADIENTS ==================== */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.gradient-accent {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.gradient-dark {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.bg-gradient-accent {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

/* ==================== GLASS EFFECTS ==================== */
.glass-effect {
  backdrop-filter: blur(20px);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.glass-dark {
  backdrop-filter: blur(15px);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ==================== NAVIGATION ==================== */
.nav-glass {
  backdrop-filter: blur(25px);
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 15px 30px -5px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: width 0.6s, height 0.6s;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.btn-primary:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary * {
  position: relative;
  z-index: 1;
}

.btn-secondary {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-secondary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 15px 30px -5px rgba(236, 72, 153, 0.4);
}

.btn-ghost {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px 20px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

/* ==================== CARDS ==================== */
.creator-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.creator-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3);
}

.creator-card::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.8s ease;
}

.creator-card:hover::before {
  left: 100%;
}

.post-card {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}

/* ==================== PROFILE IMAGES ==================== */
.profile-img {
  border-radius: 50%;
  border: 3px solid transparent;
  background: linear-gradient(45deg, #667eea, #764ba2) border-box;
  background-clip: padding-box, border-box;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.profile-img:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.profile-img-large {
  width: 120px;
  height: 120px;
  border: 4px solid transparent;
  background: linear-gradient(45deg, #667eea, #764ba2) border-box;
  background-clip: padding-box, border-box;
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-img-large:hover {
  transform: scale(1.05) rotate(3deg);
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

/* ==================== ANIMATIONS ==================== */
.fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(30px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.slide-up {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { 
    opacity: 0; 
    transform: translateY(40px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Stagger Animations */
.stagger-animation > * {
  opacity: 0;
  transform: translateY(30px);
  animation: staggerIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes staggerIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating Animation */
.float {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

/* Pulse Effect */
.pulse-new {
  animation: pulseNew 2s ease-in-out infinite;
}

@keyframes pulseNew {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Glow Effect */
.glow {
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
  transition: box-shadow 0.4s ease;
}

.glow:hover {
  box-shadow: 0 0 50px rgba(102, 126, 234, 0.6);
}

/* ==================== LOADING STATES ==================== */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.1) 25%, 
    rgba(255, 255, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Page Loading Bar */
.page-loading {
  position: relative;
  overflow: hidden;
}

.page-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #667eea, transparent);
  animation: pageLoad 2s infinite;
}

@keyframes pageLoad {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ==================== FORMS ==================== */
.form-input {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: scale(1.02);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Floating Labels */
.form-group {
  position: relative;
  margin-bottom: 24px;
}

.form-label {
  position: absolute;
  top: 16px;
  left: 20px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  padding: 0 4px;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  top: -8px;
  left: 16px;
  font-size: 12px;
  color: #667eea;
  background: #111827;
}

/* ==================== ALERTS ==================== */
.alert-warning {
  background: rgba(251, 191, 36, 0.1);
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-radius: 16px;
  padding: 20px;
  color: #fbbf24;
  backdrop-filter: blur(10px);
  animation: slideIn 0.5s ease;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  padding: 20px;
  color: #10b981;
  animation: slideIn 0.5s ease;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 16px;
  padding: 20px;
  color: #ef4444;
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==================== UTILITIES ==================== */
.text-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.border-gradient {
  border: 2px solid transparent;
  background: linear-gradient(135deg, #667eea, #764ba2) border-box;
  background-clip: padding-box, border-box;
}

.smooth-transition {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, #5a67d8, #667eea);
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .creator-card {
    padding: 20px;
  }
  
  .creator-card:hover {
    transform: none;
  }
  
  .creator-card:active {
    transform: scale(0.98);
  }
  
  .btn-primary, .btn-secondary {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  .btn-primary:active, .btn-secondary:active, .btn-ghost:active {
    transform: scale(0.95);
  }
  
  .profile-img-large {
    width: 100px;
    height: 100px;
  }
  
  /* Disable complex animations on mobile */
  .float, .pulse-new {
    animation: none;
  }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible, a:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* ==================== DARK MODE ==================== */
.dark .text-primary {
  color: #60a5fa;
}

.dark .text-secondary {
  color: #f472b6;
}

.dark .bg-card {
  background: rgba(255, 255, 255, 0.05);
}

/* ==================== SPECIAL EFFECTS ==================== */
html {
  scroll-behavior: smooth;
}

.tilt:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.magnetic:hover {
  transform: translate3d(0, -5px, 0);
}