/* ================================================
   ToolShare - Custom Styles with Vibrant Colors
   ================================================ */

:root {
  /* Vibrant Primary Colors */
  --primary-gradient-start: #FF6B6B;
  --primary-gradient-end: #4ECDC4;
  --secondary-gradient-start: #F7DC6F;
  --secondary-gradient-end: #F39C12;
  --accent-gradient-start: #A29BFE;
  --accent-gradient-end: #6C5CE7;
  
  /* Bright Colors */
  --success-color: #00D2A0;
  --danger-color: #FF6B6B;
  --warning-color: #FFD93D;
  --info-color: #6BCF7F;
  
  /* Neon Colors */
  --neon-pink: #FF10F0;
  --neon-blue: #00F0FF;
  --neon-green: #39FF14;
  --neon-yellow: #FFFF00;
  --neon-orange: #FF6600;
  --neon-purple: #BC13FE;
}

/* ================================================
   Arabic Font Support with Better Rendering
   ================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;900&display=swap');

body[dir="rtl"] {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body[dir="ltr"] {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ================================================
   Vibrant Hero Background
   ================================================ */
.hero-bg {
  background: linear-gradient(135deg, 
    var(--primary-gradient-start) 0%, 
    var(--primary-gradient-end) 50%,
    var(--accent-gradient-start) 100%);
  position: relative;
  overflow: hidden;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* ================================================
   Smooth Transitions
   ================================================ */
* {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================
   Vibrant Card Hover Effects
   ================================================ */
.card-hover {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid transparent;
}

.card-hover:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(255, 107, 107, 0.3);
  border-color: var(--primary-gradient-start);
}

/* ================================================
   Gradient Backgrounds for Cards
   ================================================ */
.gradient-card-1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-card-2 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-card-3 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-card-4 {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.gradient-card-5 {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.gradient-card-6 {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

/* ================================================
   Vibrant Badges
   ================================================ */
.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.badge-success {
  background: linear-gradient(135deg, #00D2A0 0%, #00B894 100%);
  color: white;
}

.badge-warning {
  background: linear-gradient(135deg, #FFD93D 0%, #FFA502 100%);
  color: #2d3436;
}

.badge-info {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: white;
}

.badge-danger {
  background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
  color: white;
}

.badge-purple {
  background: linear-gradient(135deg, #A29BFE 0%, #6C5CE7 100%);
  color: white;
}

/* ================================================
   Animated Buttons
   ================================================ */
button, .btn {
  position: relative;
  overflow: hidden;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

button::before, .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:hover::before, .btn:hover::before {
  width: 300px;
  height: 300px;
}

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

/* ================================================
   Glowing Effects
   ================================================ */
.glow-effect {
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.6),
              0 0 40px rgba(78, 205, 196, 0.4);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6),
                0 0 40px rgba(78, 205, 196, 0.4);
  }
  to {
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.8),
                0 0 60px rgba(78, 205, 196, 0.6);
  }
}

/* ================================================
   Modal with Vibrant Background
   ================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 3px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 20px;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary-gradient-start), var(--accent-gradient-end));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
}

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

/* ================================================
   Toast Notifications with Colors
   ================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1.25rem 1.75rem;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-width: 300px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

[dir="rtl"] .toast {
  right: auto;
  left: 2rem;
}

.toast.success {
  background: linear-gradient(135deg, #00D2A0 0%, #00B894 100%);
  color: white;
}

.toast.error {
  background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
  color: white;
}

.toast.info {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* ================================================
   Spinner with Gradient
   ================================================ */
.spinner {
  animation: spin 1s linear infinite;
  color: var(--primary-gradient-start);
}

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

/* ================================================
   Rating Stars with Animation
   ================================================ */
.rating-stars {
  color: #FFD93D;
  text-shadow: 0 2px 5px rgba(255, 217, 61, 0.3);
}

.rating-stars i {
  transition: all 0.2s ease;
}

.rating-stars i:hover {
  transform: scale(1.3);
  filter: drop-shadow(0 0 8px #FFD93D);
}

/* ================================================
   Pulse Animation
   ================================================ */
@keyframes pulse {
  0%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(1.1);
    opacity: 0.8;
  }
}

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

/* ================================================
   Fade In Animation
   ================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.6s ease;
}

/* ================================================
   Custom Scrollbar
   ================================================ */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--accent-gradient-start) 0%, var(--accent-gradient-end) 100%);
}

/* ================================================
   Form Inputs with Vibrant Focus
   ================================================ */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-gradient-start);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2);
  transform: scale(1.02);
}

/* ================================================
   Navigation Bar Gradient
   ================================================ */
nav {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Fix navigation overflow issues */
nav .flex {
  overflow: visible;
}

nav button,
nav a {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Dropdown menu positioning fix */
#user-dropdown {
  position: absolute;
  left: 0;
  margin-top: 0.5rem;
  min-width: 14rem;
  z-index: 9999;
}

[dir="rtl"] #user-dropdown {
  right: 0;
  left: auto;
}

/* Ensure buttons don't overflow */
@media (max-width: 768px) {
  nav .flex {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  nav button {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
}

/* ================================================
   Feature Cards
   ================================================ */
.feature-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid transparent;
}

.feature-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary-gradient-start);
  box-shadow: 0 20px 40px rgba(255, 107, 107, 0.2);
}

.feature-card i {
  transition: all 0.3s ease;
}

.feature-card:hover i {
  transform: scale(1.2) rotate(5deg);
}

/* ================================================
   Floating Animation
   ================================================ */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

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

/* ================================================
   Gradient Text
   ================================================ */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--accent-gradient-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

/* ================================================
   Image Placeholder with Gradient
   ================================================ */
.image-placeholder {
  background: linear-gradient(135deg, 
    var(--primary-gradient-start) 0%, 
    var(--primary-gradient-end) 50%,
    var(--accent-gradient-start) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.image-placeholder::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* ================================================
   Responsive Design
   ================================================ */
@media (max-width: 640px) {
  .hero-bg h1 {
    font-size: 2rem;
  }
  
  .hero-bg p {
    font-size: 1rem;
  }
  
  .modal-content {
    padding: 1.5rem;
    border-radius: 15px;
  }
  
  .toast {
    bottom: 1rem;
    right: 1rem;
    min-width: auto;
    max-width: 90%;
  }
  
  [dir="rtl"] .toast {
    left: 1rem;
  }
}

/* ================================================
   Print Styles
   ================================================ */
@media print {
  nav,
  footer,
  .no-print,
  button {
    display: none !important;
  }
}

/* ================================================
   Accessibility
   ================================================ */
.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;
}

/* ================================================
   Loading State
   ================================================ */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================
   Profile Page Tabs
   ================================================ */
.tab-active {
  background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--accent-gradient-end) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.tab-inactive {
  background: #f3f4f6;
  color: #6b7280;
}

.tab-inactive:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Line clamp utility */
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
