
/* ==========================================================================
   CRUNEVO - Enhanced Visual Design System
   ========================================================================== */

:root {
  --crunevo-primary: #6b73ff;
  --crunevo-primary-light: #9f7aea;
  --crunevo-primary-dark: #5850ec;
  --crunevo-secondary: #805ad5;
  --crunevo-accent: #ed8936;
  --crunevo-success: #48bb78;
  --crunevo-warning: #ed8936;
  --crunevo-danger: #f56565;
  --crunevo-info: #4299e1;
  --crunevo-light: #f8f9fa;
  --crunevo-dark: #2d3748;
  --crunevo-gray-50: #f9fafb;
  --crunevo-gray-100: #f3f4f6;
  --crunevo-gray-200: #e5e7eb;
  --crunevo-gray-300: #d1d5db;
  --crunevo-gray-400: #9ca3af;
  --crunevo-gray-500: #6b7280;
  --crunevo-gray-600: #4b5563;
  --crunevo-gray-700: #374151;
  --crunevo-gray-800: #1f2937;
  --crunevo-gray-900: #111827;
  
  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 50%;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--crunevo-gray-800);
  background-color: var(--crunevo-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Enhanced Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--crunevo-gray-900);
  margin-bottom: var(--space-4);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

p {
  margin-bottom: var(--space-4);
  color: var(--crunevo-gray-700);
}

/* ==========================================================================
   Enhanced Cards
   ========================================================================== */

.card {
  background: white;
  border: 1px solid var(--crunevo-gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   Floating Action Buttons
   ========================================================================== */

.floating-edit-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #8B5CF6, #9F7AEA);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
}

.floating-edit-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, #7C3AED, #8B5CF6);
}

.card:hover .floating-edit-btn,
.profile-header:hover .floating-edit-btn {
  opacity: 1;
  transform: scale(1);
}

.floating-cart-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #8B5CF6, #9F7AEA);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.floating-cart-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.4);
}

.floating-cart-btn .cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #F59E0B;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Achievement Badges with Animations
   ========================================================================== */

.achievement-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}

.achievement-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(45deg, currentColor, transparent, currentColor);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: subtract;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.achievement-badge:hover::before {
  opacity: 1;
}

.achievement-badge.bronze {
  background: linear-gradient(135deg, #CD7F32, #B8860B);
  color: #CD7F32;
}

.achievement-badge.silver {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: #C0C0C0;
}

.achievement-badge.gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #FFD700;
}

.achievement-badge.diamond {
  background: linear-gradient(135deg, #8B5CF6, #9F7AEA);
  color: #8B5CF6;
}

.achievement-badge:hover {
  transform: scale(1.1);
}

.achievement-unlock {
  animation: achievementPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes achievementPop {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(360deg);
    opacity: 1;
  }
}

/* ==========================================================================
   Instagram-style Story Rings
   ========================================================================== */

.story-ring {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(45deg, #8B5CF6, #9F7AEA, #10B981);
  cursor: pointer;
  transition: all 0.3s ease;
}

.story-ring.viewed {
  background: var(--crunevo-gray-300);
}

.story-ring:hover {
  transform: scale(1.05);
}

.story-ring .story-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid white;
  object-fit: cover;
}

.story-ring.animated {
  animation: storyPulse 2s infinite;
}

@keyframes storyPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ==========================================================================
   Modern Progress Bars
   ========================================================================== */

.progress-modern {
  height: 12px;
  background: var(--crunevo-gray-200);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.progress-modern .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #8B5CF6, #9F7AEA);
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-modern .progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%
  );
  background-size: 20px 20px;
  animation: progressShimmer 1s linear infinite;
}

@keyframes progressShimmer {
  0% {
    background-position: -20px 0;
  }
  100% {
    background-position: 20px 0;
  }
}

/* ==========================================================================
   Hover Effects for Products
   ========================================================================== */

.product-card {
  position: relative;
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--crunevo-gray-200);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: var(--crunevo-primary);
}

.product-card .product-image {
  position: relative;
  overflow: hidden;
}

.product-card .product-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(139, 92, 246, 0.1) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.product-card:hover .product-image::after {
  transform: translateX(100%);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #F59E0B, #EAB308);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

.product-badge.new {
  background: linear-gradient(135deg, #10B981, #059669);
}

.product-badge.popular {
  background: linear-gradient(135deg, #EF4444, #DC2626);
}

.card-body {
  padding: var(--space-6);
}

/* Feed specific cards */
.feed-create-card {
  background: white;
  border: 2px solid var(--crunevo-gray-100);
  transition: all var(--transition-normal);
}

.feed-create-card:focus-within {
  border-color: var(--crunevo-primary);
  box-shadow: 0 0 0 3px rgb(102 126 234 / 0.1);
}

.post-card {
  background: white;
  border: 1px solid var(--crunevo-gray-100);
  transition: all var(--transition-normal);
}

.post-card:hover {
  border-color: var(--crunevo-gray-200);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Enhanced Buttons
   ========================================================================== */

.btn {
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  line-height: 1.5;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  min-height: 40px;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgb(102 126 234 / 0.3);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Primary button */
.btn-primary {
  background: linear-gradient(135deg, #6b73ff, #805ad5);
  color: white;
  border: none;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--crunevo-primary-dark), var(--crunevo-secondary));
  color: white;
}

/* Outline button */
.btn-outline-primary {
  color: var(--crunevo-primary);
  border-color: var(--crunevo-primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--crunevo-primary);
  color: white;
  border-color: var(--crunevo-primary);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--crunevo-gray-600);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  background: var(--crunevo-gray-100);
  color: var(--crunevo-gray-800);
  transform: none;
}

.btn-ghost.active {
  background: var(--crunevo-primary);
  color: white;
}

/* Button sizes */
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: 0.8rem;
  min-height: 32px;
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
  min-height: 48px;
}

/* Rounded pills */
.rounded-pill {
  border-radius: 50px !important;
}

.rounded-circle {
  border-radius: 50% !important;
}

/* ==========================================================================
   Enhanced Forms
   ========================================================================== */

.form-control {
  border: 1px solid var(--crunevo-gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  background: white;
  color: var(--crunevo-gray-800);
  min-height: 44px;
}

.form-control:focus {
  border-color: var(--crunevo-primary);
  box-shadow: 0 0 0 3px rgb(102 126 234 / 0.1);
  outline: none;
}

.form-control::placeholder {
  color: var(--crunevo-gray-400);
}

/* Textarea specific */
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.resize-none {
  resize: none !important;
}

/* ==========================================================================
   Enhanced Avatars
   ========================================================================== */

.feed-avatar {
  border: 2px solid var(--crunevo-gray-200);
  transition: all var(--transition-fast);
}

.feed-avatar:hover {
  border-color: var(--crunevo-primary);
  transform: scale(1.05);
}

/* ==========================================================================
   Enhanced Badges
   ========================================================================== */

.badge {
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
}

.verified-badge {
  background-color: transparent !important;
  border: none !important;
  color: #a855f7 !important;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ==========================================================================
   Post Specific Styles
   ========================================================================== */

.post-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--crunevo-gray-800);
}

.post-image {
  cursor: pointer;
  transition: all var(--transition-normal);
}

.post-image:hover {
  transform: scale(1.02);
}

.image-overlay {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.image-container:hover .image-overlay {
  opacity: 1;
}

.post-stats {
  font-size: 0.8rem;
  color: var(--crunevo-gray-500);
}

.post-actions {
  margin: 0 -var(--space-2);
}

.post-actions .btn {
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
}

/* ==========================================================================
   Quick Comments
   ========================================================================== */

.quick-comments {
  background: var(--crunevo-gray-50);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: 0 -var(--space-4);
}

/* ==========================================================================
   Enhanced Dark Mode
   ========================================================================== */

[data-bs-theme="dark"] {
  --crunevo-gray-50: #111827;
  --crunevo-gray-100: #1f2937;
  --crunevo-gray-200: #374151;
  --crunevo-gray-300: #4b5563;
  --crunevo-gray-400: #6b7280;
  --crunevo-gray-500: #9ca3af;
  --crunevo-gray-600: #d1d5db;
  --crunevo-gray-700: #e5e7eb;
  --crunevo-gray-800: #f3f4f6;
  --crunevo-gray-900: #f9fafb;
}

[data-bs-theme="dark"] body {
  background-color: var(--crunevo-gray-50);
  color: var(--crunevo-gray-800);
}

[data-bs-theme="dark"] .card {
  background: var(--crunevo-gray-100);
  border-color: var(--crunevo-gray-200);
  color: var(--crunevo-gray-800);
}

[data-bs-theme="dark"] .form-control {
  background: var(--crunevo-gray-100);
  border-color: var(--crunevo-gray-200);
  color: var(--crunevo-gray-800);
}

[data-bs-theme="dark"] .form-control:focus {
  background: var(--crunevo-gray-100);
  border-color: var(--crunevo-primary);
}

[data-bs-theme="dark"] .btn-ghost {
  color: var(--crunevo-gray-600);
}

[data-bs-theme="dark"] .btn-ghost:hover {
  background: var(--crunevo-gray-200);
  color: var(--crunevo-gray-800);
}

[data-bs-theme="dark"] .quick-comments {
  background: var(--crunevo-gray-200);
}

/* ==========================================================================
   Shimmer Loading Effect
   ========================================================================== */

.shimmer {
  background: linear-gradient(90deg, var(--crunevo-gray-200) 25%, var(--crunevo-gray-100) 50%, var(--crunevo-gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

[data-bs-theme="dark"] .shimmer {
  background: linear-gradient(90deg, var(--crunevo-gray-200) 25%, var(--crunevo-gray-300) 50%, var(--crunevo-gray-200) 75%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  background: white;
  border-radius: var(--radius-xl);
  border: 2px dashed var(--crunevo-gray-300);
  margin: var(--space-8) 0;
}

[data-bs-theme="dark"] .empty-state {
  background: var(--crunevo-gray-100);
  border-color: var(--crunevo-gray-200);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.8;
}

.empty-state h4 {
  color: var(--crunevo-gray-600);
  margin-bottom: var(--space-2);
}

.empty-state p {
  color: var(--crunevo-gray-500);
  margin-bottom: var(--space-6);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Mobile optimizations */
@media (max-width: 768px) {
  .container-fluid {
    padding: 0 var(--space-3);
  }
  
  .card-body {
    padding: var(--space-4);
  }
  
  .btn {
    min-height: 44px;
  }
  
  .form-control {
    min-height: 44px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }
}

/* Small screens */
@media (max-width: 360px) {
  .container-fluid {
    padding: 0 var(--space-2);
  }
  
  .card {
    margin-bottom: var(--space-3);
    border-radius: var(--radius-lg);
  }
  
  .card-body {
    padding: var(--space-3);
  }
}

/* Touch-friendly elements */
@media (hover: none) and (pointer: coarse) {
  .btn, .nav-link, .dropdown-item {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .card:hover,
  .btn:hover,
  .post-image:hover {
    transform: none;
  }
}

/* ==========================================================================
   Sidebar Enhancements
   ========================================================================== */

.sidebar-left,
.sidebar-right {
  padding: var(--space-4);
  height: calc(100vh - 80px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: var(--space-1);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  color: var(--crunevo-gray-700);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--crunevo-primary);
  color: white;
  transform: translateX(4px);
}

[data-bs-theme="dark"] .sidebar-nav a {
  color: var(--crunevo-gray-600);
}

[data-bs-theme="dark"] .sidebar-nav a:hover,
[data-bs-theme="dark"] .sidebar-nav a.active {
  background: var(--crunevo-primary);
  color: white;
}

/* ==========================================================================
   Notification Enhancements
   ========================================================================== */

.toast {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.toast-container {
  z-index: 1060;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-gradient {
  background: linear-gradient(135deg, var(--crunevo-primary), var(--crunevo-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--crunevo-primary), var(--crunevo-secondary));
}

.cursor-pointer {
  cursor: pointer;
}

.transition-all {
  transition: all var(--transition-normal);
}

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
