/* assets/style.css - Custom styles for SourceCodeMarket */
:root{
  --brand:#2563eb; /* stronger blue for contrast */
  --brand-2:#22c55e; /* green accent */
  --ink:#111827; /* near-black text */
  --muted:#4b5563; /* dark gray */
  --surface:#ffffff;
  --ring: rgba(37,99,235,.28);
}
body {
    background: radial-gradient(1200px 800px at 10% -10%, rgba(51,153,204,.06), transparent 60%),
                radial-gradient(1000px 800px at 110% 10%, rgba(109,213,237,.06), transparent 60%), #f7f9fb;
    color: var(--ink);
    font-family: 'Segoe UI', Arial, sans-serif;
}
.navbar-brand {
    font-weight: bold;
    color: var(--brand) !important;
}
.card {
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.btn-primary, .btn-success {
    border-radius: 20px;
    padding-left: 24px;
    padding-right: 24px;
    background-image: none; background-color: var(--brand);
    border-color: var(--brand); color:#fff;
    box-shadow: 0 8px 18px rgba(34,197,94,.25);
    transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-success{ background-color: var(--brand-2); border-color: var(--brand-2) }
.btn-outline-primary{ border-color: var(--brand); color: var(--brand); }
.table th, .table td {
    vertical-align: middle;
}
footer {
    background: #0f172a;
    color:#cbd5e1;
    border-top: 1px solid #eaeaea;
}
.alert {
    border-radius: 8px;
}
@media (max-width: 768px) {
    .card-title {
        font-size: 1.1rem;
    }
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Modern enhancements */
.hero-section {
    position: relative;
    background: linear-gradient(120deg, #0f172a, #1e293b);
    color:#f8fafc;
    padding-top: 4rem; padding-bottom: 4rem;
    animation: none;
    box-shadow: inset 0 -8px 30px rgba(255,255,255,.25);
}
.hero-section .lead{ color:#cbd5e1 }
.hero-section .btn-primary{
  background-color: var(--brand);
  background-image: linear-gradient(135deg, var(--brand), #1d4ed8);
  border: none; color:#fff;
}
.hero-section .btn-primary:hover{ filter: brightness(1.05) }

/* Buttons ensure contrast */
.btn-primary, .btn-success{
  background-image: none; background-color: var(--brand);
  border-color: var(--brand); color:#fff;
}
.btn-success{ background-color: var(--brand-2); border-color: var(--brand-2) }
.btn-outline-primary{ border-color: var(--brand); color: var(--brand) }

/* Reduce glossy sheen intensity */
.card{
  background: #fff; border: 1px solid #e5e7eb;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
.product-card::after{ display:none }

/* Typography and spacing */
.card-title{ font-weight:600; color: var(--ink) }
.text-muted{ color:#6b7280 !important }

/* Focus visibility */
:focus-visible{ outline: 3px solid var(--ring); outline-offset: 2px }

/* Hover effects subtle */
.product-card{ transition: transform .15s ease, box-shadow .15s ease }
.product-card:hover{ transform: translateY(-2px); box-shadow:0 10px 24px rgba(0,0,0,.08) }

/* Footer contrast */
footer{ background:#0f172a; color:#cbd5e1 }
footer a{ color:#e2e8f0 }

/* Navbar contrast */
.navbar{ background: rgba(255,255,255,.92) !important; border-bottom:1px solid #e5e7eb !important }
.navbar-brand{ color: var(--brand) !important }

/* Responsive tweaks */
@media (max-width: 992px){
  .hero-section .display-5{ font-size: 2rem }
}
@media (max-width: 768px){
  .card-img-top{ height: 150px !important }
  .navbar .container{ padding-left: 12px; padding-right: 12px }
}
@media (max-width: 480px){
  .badge{ font-size:.8rem }
  .btn{ padding-left:18px; padding-right:18px }
}

/* Motion accessibility */
@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important }
}

/* Price chip overlay */
.price-chip{
  position:absolute; top:10px; left:10px; z-index:2;
  background: rgba(15,23,42,.9); color:#fff; 
  padding:6px 10px; border-radius: 999px; 
  font-weight:600; font-size:.9rem; letter-spacing:.2px;
  box-shadow: 0 6px 16px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(6px);
}
.price-chip.is-free{ background: linear-gradient(135deg, var(--brand-2), #16a34a); }

/* Stretched link focus ring visible */
.stretched-link:focus-visible{ outline: 3px solid var(--ring); outline-offset: 3px }

/* Skeleton Loading Animation - Production Ready */
.skeleton {
  background: linear-gradient(90deg, #f8fafc 25%, #e2e8f0 50%, #f8fafc 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: 0.375rem;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.skeleton-image {
  width: 100%;
  height: 160px;
  background: #f1f5f9;
  border-radius: 0;
}

.skeleton-text {
  height: 1rem;
  margin: 0.5rem 0;
  border-radius: 0.375rem;
  background: #f1f5f9;
}

.skeleton-text.title {
  height: 1.375rem;
  width: 85%;
  margin-bottom: 0.75rem;
}

.skeleton-text.description {
  height: 0.875rem;
  width: 100%;
  margin-bottom: 0.375rem;
}

.skeleton-text.description:nth-child(3) {
  width: 90%;
}

.skeleton-text.description:last-child {
  width: 65%;
}

.skeleton-button {
  height: 2.375rem;
  width: 110px;
  border-radius: 1.25rem;
  margin-top: 1rem;
  background: #e2e8f0;
}

.skeleton-price {
  height: 1.125rem;
  width: 70px;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  background: #f1f5f9;
}

/* Production optimizations */
.skeleton-container {
  display: block;
}

.content-loaded .skeleton-container {
  display: none !important;
}

.products-container {
  min-height: 400px;
  position: relative;
}

.products-grid {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.products-grid.show {
  opacity: 1;
}

/* Responsive skeleton adjustments */
@media (max-width: 992px) {
  .skeleton-image {
    height: 150px;
  }
  
  .skeleton-text.title {
    height: 1.25rem;
    width: 80%;
  }
}

@media (max-width: 768px) {
  .skeleton-image {
    height: 140px;
  }
  
  .skeleton-button {
    width: 100px;
    height: 2.25rem;
  }
  
  .skeleton-text.description {
    height: 0.8rem;
  }
}

@media (max-width: 576px) {
  .skeleton-image {
    height: 130px;
  }
  
  .skeleton-text.title {
    height: 1.125rem;
    width: 75%;
  }
  
  .skeleton-price {
    width: 60px;
    height: 1rem;
  }
  
  .skeleton-button {
    width: 90px;
    height: 2rem;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: #f1f5f9;
  }
  
  .products-grid {
    transition: none;
  }
}


/* Category Filter Bar */
.category-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px 0;
}
.category-pill {
  font-size: 0.85rem;
  padding: 4px 16px;
  border-radius: 999px;
  transition: all 0.2s ease;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.category-pill.btn-outline-secondary {
  border-color: #d1d5db;
  color: #374151;
  background: transparent;
}
.category-pill.btn-outline-secondary:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #111827;
  transform: translateY(-1px);
}
.category-pill.btn-primary {
  background: linear-gradient(135deg, var(--brand), #1d4ed8);
  border: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.category-pill.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Toast Notification Container */
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  color: #374151;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

/* Toast Notification Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-notification {
  pointer-events: auto;
  background: #1f2937;
  color: #f9fafb;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  animation: toast-in 0.3s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.toast-notification.success { border-left: 4px solid #22c55e; }
.toast-notification.error { border-left: 4px solid #ef4444; }
.toast-notification.info { border-left: 4px solid #3b82f6; }
.toast-notification .toast-icon { font-size: 1.2rem; }
.toast-notification .toast-msg { flex: 1; }
.toast-notification .toast-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 1.1rem;
  border-radius: 4px;
}
.toast-notification .toast-close:hover { color: #fff; }

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Back to Top Button */
#backToTop {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1040;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #1d4ed8);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}
#backToTop.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#backToTop:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}
#backToTop:active {
  transform: translateY(-1px);
}

/* Page Loading Indicator */
#pageLoader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  background: transparent;
  pointer-events: none;
}
#pageLoader .loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), #22c55e, #f59e0b);
  transition: width 0.3s ease;
  border-radius: 0 2px 2px 0;
}

/* Newsletter Form */
.newsletter-form .input-group {
  max-width: 400px;
}
.newsletter-form .form-control {
  border-radius: 999px 0 0 999px !important;
  border: 2px solid #e5e7eb;
  padding: 10px 18px;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: #fff;
}
.newsletter-form .form-control::placeholder {
  color: rgba(255,255,255,0.5);
}
.newsletter-form .form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.newsletter-form .btn {
  border-radius: 0 999px 999px 0 !important;
  padding: 10px 22px;
  font-weight: 600;
}
.newsletter-form .btn:active {
  transform: scale(0.97);
}

/* Related Products Section */
.related-products {
  border-top: 1px solid #e5e7eb;
  margin-top: 0;
}
.related-products .product-card .price-chip {
  font-size: 0.8rem;
  padding: 4px 8px;
}
.related-products .product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.related-products .card-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Enhanced mobile responsiveness for new elements */
@media (max-width: 576px) {
  .category-pill {
    font-size: 0.78rem;
    padding: 3px 12px;
  }
  .toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  .toast-notification {
    min-width: auto;
    max-width: 100%;
    font-size: 0.85rem;
    padding: 10px 16px;
  }
  #backToTop {
    width: 38px;
    height: 38px;
    bottom: 70px;
    right: 14px;
    font-size: 1rem;
  }
  .newsletter-form .input-group {
    max-width: 100%;
  }
  .related-products .col-6 {
    padding-left: 6px;
    padding-right: 6px;
  }
}



/* ===== Video Page Styles ===== */
.video-page {
  background: #f8f9fa;
  min-height: 80vh;
}
.video-player-wrapper {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  position: relative;
}
.video-player-wrapper .plyr,
.plyr--video {
  border-radius: 12px;
}
.video-info .video-title {
  color: #111827;
  line-height: 1.3;
}
.video-description {
  border-left: 3px solid var(--brand, #2563eb);
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.6;
}
/* Playlist Sidebar */
.playlist-sidebar {
  position: sticky;
  top: 90px;
}
.playlist-list {
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.playlist-list::-webkit-scrollbar {
  width: 5px;
}
.playlist-list::-webkit-scrollbar-track {
  background: transparent;
}
.playlist-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
.playlist-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.playlist-item:hover {
  background: #f1f5f9;
  text-decoration: none;
  color: inherit;
  border-color: #e2e8f0;
  transform: translateX(3px);
}
.playlist-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(37,99,235,0.08);
}
.playlist-thumb {
  position: relative;
  flex-shrink: 0;
  width: 168px;
  height: 94px;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
}
.playlist-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.playlist-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.playlist-playing {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: 2px solid rgba(255,255,255,0.5);
}
.playlist-info {
  flex: 1;
  min-width: 0;
}
.playlist-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.playlist-meta {
  font-size: 0.78rem;
  color: #6b7280;
}
/* Video Page Responsive */
@media (max-width: 991.98px) {
  .playlist-list {
    max-height: none;
    overflow-y: visible;
  }
  .playlist-sidebar {
    position: static;
  }
  .playlist-thumb {
    width: 140px;
    height: 79px;
  }
}
@media (max-width: 576px) {
  .playlist-item {
    padding: 8px 10px;
  }
  .playlist-thumb {
    width: 120px;
    height: 68px;
  }
  .playlist-title {
    font-size: 0.82rem;
  }
  .video-title {
    font-size: 1.25rem;
  }
}
