/**
 * Buy Courses Page Styles
 * Extracted from inline styles in buy-courses.html
 * Uses Tailwind v4.0 base with custom enhancements
 * Compatible with Font Awesome 6.5+
 */

/* ==============================================
   Core Loading and Animation Styles
   ============================================== */

.loading-skeleton {
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.05) 25%, 
    rgba(255,255,255,0.1) 50%, 
    rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

.course-skeleton {
  min-height: 200px;
  border-radius: 12px;
}

/* ==============================================
   Mobile Navigation Styles
   ============================================== */

#mobile-menu {
  transition: all 0.3s ease-in-out;
}

#mobile-menu.show {
  display: block !important;
}

.show {
  display: block !important;
}

/* Mobile menu visibility enhancements */
@media (max-width: 767px) {
  #mobile-menu:not(.hidden) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: 100% !important;
    background-color: rgba(31, 41, 55, 0.95) !important;
    border-top: 1px solid rgba(34, 197, 94, 0.2) !important;
    padding: 16px !important;
    z-index: 1000 !important;
  }
  
  #mobile-menu a {
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    color: #d1d5db !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
    transition: all 0.2s !important;
    background-color: transparent !important;
  }
  
  #mobile-menu a:hover {
    background-color: rgba(34, 197, 94, 0.1) !important;
    color: white !important;
  }
  
  #mobile-menu i {
    width: 20px !important;
    height: 20px !important;
    margin-right: 12px !important;
    color: inherit !important;
    font-size: 20px !important;
  }
  
  #mobile-menu span,
  #mobile-menu .text-white,
  #mobile-menu .text-gray-300 {
    color: #d1d5db !important;
    font-size: 16px !important;
    font-weight: 500 !important;
  }
  
  #mobile-menu-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: rgba(31, 41, 55, 0.8) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    border-radius: 8px !important;
    padding: 8px !important;
    color: white !important;
    width: 40px !important;
    height: 40px !important;
  }
  
  #mobile-menu-button i {
    width: 24px !important;
    height: 24px !important;
    color: white !important;
    font-size: 24px !important;
  }
  
  /* Enhanced mobile menu visibility */
  #mobile-menu * {
    color: #d1d5db !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  #mobile-menu a * {
    color: inherit !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Ultra-visible mobile menu styling */
  #mobile-menu-button {
    background-color: #374151 !important;
    border: 2px solid #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5) !important;
  }
  
  #mobile-menu {
    background-color: rgba(31, 41, 55, 0.98) !important;
    border: 2px solid rgba(34, 197, 94, 0.5) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
  }
  
  #mobile-menu a span,
  #mobile-menu a div,
  #mobile-menu a {
    color: #e5e7eb !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
  }
  
  #mobile-menu .logout-btn {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    color: #f87171 !important;
  }
  
  #mobile-menu i {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: inherit !important;
  }
}

/* ==============================================
   Global Visibility and Theme Styles
   ============================================== */

body {
  color: #ffffff !important;
  background-color: #111827 !important;
}

h1, h2, h3, h4, h5, h6, p, span, div, a, button, li, td, th, label {
  color: inherit !important;
}

/* Text color utilities */
.text-white { color: #ffffff !important; }
.text-gray-300 { color: #d1d5db !important; }
.text-gray-400 { color: #9ca3af !important; }
.text-green-400 { color: #4ade80 !important; }
.text-blue-400 { color: #60a5fa !important; }
.text-purple-400 { color: #c084fc !important; }
.text-yellow-400 { color: #facc15 !important; }
.text-red-400 { color: #f87171 !important; }
.text-orange-400 { color: #fb923c !important; }
.text-indigo-400 { color: #818cf8 !important; }

/* Background colors */
.bg-gray-900 { background-color: #111827 !important; }
.bg-gray-800 { background-color: #1f2937 !important; }
.bg-gray-700 { background-color: #374151 !important; }

/* FontAwesome icons visibility */
i.fas, i.far, i.fab {
  color: inherit !important;
}

main {
  color: #ffffff !important;
}

header {
  background-color: rgba(31, 41, 55, 0.95) !important;
  border-bottom: 1px solid rgba(34, 197, 94, 0.2) !important;
}

nav a {
  color: #d1d5db !important;
}

button {
  color: #ffffff !important;
}

input, select, textarea {
  color: #ffffff !important;
  background-color: #374151 !important;
  border: 1px solid #4b5563 !important;
}

.glassmorphism,
.bg-gradient-to-br {
  background: rgba(31, 41, 55, 0.8) !important;
  border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

footer {
  background-color: #000000 !important;
  color: #9ca3af !important;
}

.nav-link-enhanced {
  position: relative;
  z-index: 10;
}

/* ==============================================
   Dashboard and Card Styles
   ============================================== */

.dashboard-card {
  background: rgba(31, 41, 55, 0.8) !important;
  border: 1px solid rgba(34, 197, 94, 0.3) !important;
  backdrop-filter: blur(10px);
}

.tab-btn {
  cursor: pointer !important;
  position: relative;
  z-index: 20;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: white !important;
  background-color: rgba(34, 197, 94, 0.1) !important;
}

.tab-btn.active {
  color: #4ade80 !important;
  border-bottom-color: #4ade80 !important;
}

/* ==============================================
   Hero Section Styles
   ============================================== */

.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(to bottom right,
    #111827,    /* gray-900 */
    #1f2937,    /* gray-800 */
    #000000);   /* black */
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 16px;
  margin: 0 24px;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 4px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(34, 197, 94, 0.4) 20%, 
    rgba(59, 130, 246, 0.4) 50%, 
    rgba(34, 197, 94, 0.4) 80%, 
    transparent 100%);
  border-radius: 16px 16px 0 0;
  z-index: 3;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M0,0 L1440,0 Q1420,30 1400,60 Q1380,90 1360,120 Q1340,150 1320,180 Q1300,210 1280,240 Q1260,270 1240,300 Q1220,330 1200,360 Q1180,330 1160,300 Q1140,270 1120,240 Q1100,210 1080,180 Q1060,150 1040,120 Q1020,90 1000,60 Q980,30 960,0 L0,0 Z' fill='url(%23waveGradient)' opacity='0.05'/%3e%3cpath d='M0,400 Q360,350 720,375 Q1080,400 1440,350 L1440,400 L0,400 Z' fill='url(%23waveGradient2)' opacity='0.08'/%3e%3cdefs%3e%3clinearGradient id='waveGradient' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3e%3cstop offset='0%25' style='stop-color:%2322c55e;stop-opacity:0.15' /%3e%3cstop offset='100%25' style='stop-color:%233b82f6;stop-opacity:0.15' /%3e%3c/linearGradient%3e%3clinearGradient id='waveGradient2' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3e%3cstop offset='0%25' style='stop-color:%233b82f6;stop-opacity:0.1' /%3e%3cstop offset='100%25' style='stop-color:%2322c55e;stop-opacity:0.1' /%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e") no-repeat;
  background-size: cover;
  pointer-events: none;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    rgba(34, 197, 94, 0.05),  /* green-500/5 */
    rgba(59, 130, 246, 0.05)); /* blue-500/5 */
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: 32px 32px;
}

@media (max-width: 768px) {
  .hero-content {
    padding: 24px 24px;
  }
  
  .hero-section {
    margin: 0 16px;
  }
}

.professional-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 9999px;
  padding: 8px 16px;
  margin-bottom: 16px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.gradient-text {
  background: linear-gradient(135deg, #22c55e 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==============================================
   Metric Card Styles
   ============================================== */

.metric-card-enhanced {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.metric-card-enhanced:hover {
  border-color: rgba(34, 197, 94, 0.4);
  transform: translateY(-2px);
}

.metric-number {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.metric-label {
  color: #9ca3af;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==============================================
   Desktop Navigation Styles
   ============================================== */

@media (max-width: 0) {
  .hidden { display: none !important; }
  .md\:hidden { display: block !important; }
  .md\:flex { display: none !important; }
}

@media (max-width: 767px) {
  #mobile-menu-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    padding: 8px;
    color: white;
  }
  
  .hidden.md\:flex {
    display: none !important;
  }
  
  #mobile-menu {
    background: rgba(31, 41, 55, 0.95);
    border-top: 1px solid rgba(34, 197, 94, 0.2);
    padding: 16px;
  }
  
  #mobile-menu a {
    display: block;
    padding: 12px 16px;
    color: #d1d5db;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
  }
  
  #mobile-menu a:hover {
    background: rgba(16, 185, 129, 0.1);
    color: white;
  }
}

@media (min-width: 768px) {
  .hidden.md\:flex {
    display: flex !important;
    align-items: center;
    gap: 8px;
  }
  
  .hidden.md\:flex a {
    padding: 8px 16px;
    border-radius: 8px;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.2s;
  }
  
  .hidden.md\:flex a:hover {
    background: rgba(16, 185, 129, 0.1);
    color: white;
  }
  
  #mobile-menu-button {
    display: none !important;
  }
}

/* ==============================================
   Buy Courses Specific Styles
   ============================================== */

.price-tag {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.discounted-price {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  position: relative;
}

.original-price {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 0.9rem;
  margin-right: 8px;
}

.buy-course-card {
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.95) 100%);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  backdrop-filter: blur(10px);
}

.buy-course-card:hover {
  transform: translateY(-8px);
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(34, 197, 94, 0.1);
}

.buy-course-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(34, 197, 94, 0.6) 20%, 
    rgba(59, 130, 246, 0.6) 50%, 
    rgba(34, 197, 94, 0.6) 80%, 
    transparent 100%);
  z-index: 1;
}

.bundle-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
  border: 2px solid rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}

.bundle-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #3b82f6, #9333ea, #3b82f6);
  background-size: 200% 200%;
  animation: gradient-border 3s ease infinite;
  border-radius: 16px;
  z-index: -1;
}

@keyframes gradient-border {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.bundle-badge {
  background: linear-gradient(135deg, #3b82f6 0%, #9333ea 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==============================================
   Filter and Search Styles
   ============================================== */

.filter-btn {
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.5);
  color: #d1d5db;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.filter-btn:hover {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
  color: white;
}

.filter-btn.active {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.6);
  color: #22c55e;
}

.search-container {
  position: relative;
}

.search-input {
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.5);
  color: white;
  padding: 12px 16px 12px 44px;
  border-radius: 12px;
  width: 100%;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

/* ==============================================
   Button Styles
   ============================================== */

.buy-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.buy-btn:disabled {
  background: rgba(75, 85, 99, 0.5);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.enroll-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.enroll-btn:hover {
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* ==============================================
   Course Level and Stats Styles
   ============================================== */

.level-badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.level-beginner {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.level-intermediate {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.level-advanced {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.course-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #9ca3af;
  font-size: 0.875rem;
}

.course-stat i {
  width: 16px;
  height: 16px;
  color: #22c55e;
}

/* ==============================================
   Responsive Design
   ============================================== */

@media (max-width: 640px) {
  .buy-course-card {
    margin-bottom: 1rem;
  }
  
  .filter-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .filter-buttons {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* ==============================================
   Loading States
   ============================================== */

.courses-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.courses-loading .course-skeleton {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(75, 85, 99, 0.3);
  border-radius: 16px;
  height: 400px;
}

/* ==============================================
   Utility Classes
   ============================================== */

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

.image-container {
  position: relative;
  overflow: hidden;
}

.image-container img {
  transition: transform 0.3s ease;
}

.buy-course-card:hover .image-container img {
  transform: scale(1.05);
}

/* Course Image Container - matching index.html styling */
.course-image-container {
  position: relative;
  overflow: hidden;
  height: 200px;
  min-height: 200px;
}

.course-image-container img {
  transition: transform 0.3s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.buy-course-card:hover .course-image-container img {
  transform: scale(1.05);
}

/* ==============================================
   Accessibility Enhancements
   ============================================== */

@media (prefers-reduced-motion: reduce) {
  .loading-skeleton,
  .pulse-dot,
  .gradient-border,
  .buy-course-card,
  .filter-btn,
  .search-input,
  .buy-btn {
    animation: none;
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .buy-course-card {
    border-width: 2px;
    border-color: #22c55e;
  }
  
  .filter-btn.active {
    border-width: 2px;
    background: #22c55e;
    color: #000000;
  }
  
  .buy-btn {
    border: 2px solid #059669;
  }
}

/* Focus management for keyboard navigation */
.buy-btn:focus,
.filter-btn:focus,
.search-input:focus,
.tab-btn:focus {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

/* ==============================================
   Print Styles
   ============================================== */

@media print {
  .mobile-menu,
  .search-container,
  .filter-buttons,
  .buy-btn,
  .enroll-btn {
    display: none !important;
  }
  
  .buy-course-card {
    break-inside: avoid;
    border: 1px solid #000;
    box-shadow: none;
  }
  
  .hero-section {
    background: white;
    color: black;
  }
}
