/**
 * Studio Cosmic North - Public Pages Styling
 * Modern cosmic-themed styles for blog, games, and products pages
 */

/* ============================================
   PAGE HEADER
   ============================================ */

.cosmic-page-header {
  text-align: center;
  padding: 4rem 2rem 3rem 2rem;
  position: relative;
  overflow: hidden;
}

.cosmic-page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    rgba(139, 92, 246, 0.15) 0%,
    rgba(99, 102, 241, 0.08) 30%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.cosmic-page-header > * {
  position: relative;
  z-index: 1;
}

.cosmic-page-header h1 {
  margin: 0 0 1rem 0;
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
  animation: fadeInUp 0.6s ease-out;
}

.cosmic-page-header p {
  font-size: 1.25rem;
  color: #9ca3af;
  margin: 0;
  animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   FILTER BAR
   ============================================ */

.cosmic-filter-bar {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 2rem auto;
  max-width: 1400px;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.6s ease-out 0.2s backwards;
}

.filter-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.cosmic-search-input,
.cosmic-filter-select {
  flex: 1;
  min-width: 200px;
  padding: 0.875rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e5e7eb;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.cosmic-search-input {
  padding-left: 3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1rem center;
  background-size: 20px;
}

.cosmic-search-input:focus,
.cosmic-filter-select:focus {
  outline: none;
  border-color: #8b5cf6;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.cosmic-search-input::placeholder {
  color: #6b7280;
}

.cosmic-filter-select {
  cursor: pointer;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.cosmic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
  animation: fadeIn 0.6s ease-out 0.3s backwards;
}

.cosmic-blog-grid {
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

/* ============================================
   CARD COMPONENTS
   ============================================ */

.cosmic-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.cosmic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #6366f1, #06b6d4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cosmic-card:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(139, 92, 246, 0.2);
}

.cosmic-card:hover::before {
  opacity: 1;
}

/* Card Image */
.cosmic-card-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cosmic-card:hover .cosmic-card-image {
  transform: scale(1.05);
}

.cosmic-card-image-wrapper {
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.1));
}

.cosmic-card-image-placeholder {
  width: 100%;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.1));
  color: #6b7280;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Card Content */
.cosmic-card-content {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cosmic-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.cosmic-card:hover .cosmic-card-title {
  color: #8b5cf6;
}

.cosmic-card-tagline {
  font-size: 1rem;
  color: #8b5cf6;
  font-weight: 500;
  margin: 0 0 0.75rem 0;
  font-style: italic;
}

.cosmic-card-description {
  font-size: 0.9375rem;
  color: #9ca3af;
  line-height: 1.6;
  margin: 0 0 1.25rem 0;
  flex: 1;
}

/* Card Meta */
.cosmic-card-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  align-items: center;
}

.cosmic-badge {
  padding: 0.375rem 0.875rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

/* Status Badges */
.status-released {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.status-beta, .status-early_access {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.status-alpha, .status-in_development {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #8b5cf6;
}

.status-concept {
  background: rgba(107, 114, 128, 0.15);
  border: 1px solid rgba(107, 114, 128, 0.3);
  color: #6b7280;
}

/* Category Badges */
.category-badge {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #6366f1;
}

/* Platform Badges */
.platform-badge {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #06b6d4;
  font-size: 0.75rem;
}

/* Price */
.cosmic-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.125rem;
  font-weight: 700;
  color: #10b981;
}

.cosmic-price.free {
  color: #06b6d4;
}

/* Card Footer */
.cosmic-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cosmic-card-views {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: #6b7280;
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   BLOG SPECIFIC
   ============================================ */

.cosmic-blog-card .cosmic-card-image {
  height: 220px;
}

.cosmic-blog-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: #9ca3af;
}

.cosmic-blog-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.cosmic-blog-meta-item i {
  width: 14px;
  height: 14px;
  color: #8b5cf6;
}

.cosmic-blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
}

.cosmic-tag {
  padding: 0.25rem 0.75rem;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  font-size: 0.75rem;
  color: #8b5cf6;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cosmic-tag:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
  transform: translateY(-2px);
}

/* ============================================
   BLOG DETAIL PAGE
   ============================================ */

.cosmic-blog-detail {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 2rem;
  animation: fadeIn 0.6s ease-out;
}

.cosmic-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: #9ca3af;
}

.cosmic-breadcrumb a {
  color: #8b5cf6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cosmic-breadcrumb a:hover {
  color: #6366f1;
}

.cosmic-post-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cosmic-post-title {
  font-size: 3rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 1.5rem 0;
  line-height: 1.2;
}

.cosmic-post-meta {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.9375rem;
  color: #9ca3af;
  margin-bottom: 1rem;
}

.cosmic-post-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cosmic-post-featured-image {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.cosmic-post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.cosmic-post-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
}

.cosmic-post-content p {
  margin: 1.75rem 0;
}

.cosmic-post-content h2,
.cosmic-post-content h3,
.cosmic-post-content h4 {
  margin: 2.5rem 0 1.25rem 0;
  color: #ffffff;
  font-weight: 600;
}

.cosmic-post-content h2 {
  font-size: 2rem;
  border-bottom: 2px solid rgba(139, 92, 246, 0.3);
  padding-bottom: 0.75rem;
}

.cosmic-post-content h3 {
  font-size: 1.5rem;
}

.cosmic-post-content h4 {
  font-size: 1.25rem;
}

.cosmic-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 2rem 0;
}

.cosmic-post-content a {
  color: #8b5cf6;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.cosmic-post-content a:hover {
  color: #6366f1;
}

.cosmic-post-content ul,
.cosmic-post-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.cosmic-post-content li {
  margin: 0.75rem 0;
}

.cosmic-post-content code {
  background: rgba(139, 92, 246, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  color: #8b5cf6;
}

.cosmic-post-content pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}

.cosmic-post-content pre code {
  background: none;
  padding: 0;
  color: #e5e7eb;
}

/* Related Posts */
.cosmic-related-posts {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid rgba(139, 92, 246, 0.2);
}

.cosmic-related-posts h3 {
  font-size: 1.75rem;
  color: #ffffff;
  margin: 0 0 2rem 0;
}

.cosmic-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.cosmic-related-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.cosmic-related-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-4px);
}

.cosmic-related-card h4 {
  font-size: 1.125rem;
  margin: 0 0 0.5rem 0;
}

.cosmic-related-card h4 a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cosmic-related-card h4 a:hover {
  color: #8b5cf6;
}

.cosmic-related-card-date {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.cosmic-related-card p {
  font-size: 0.875rem;
  color: #9ca3af;
  line-height: 1.6;
  margin: 0;
}

/* ============================================
   GAME/PRODUCT DETAIL PAGES
   ============================================ */

.cosmic-detail-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
  animation: fadeIn 0.6s ease-out;
}

.cosmic-detail-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.cosmic-detail-media {
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.cosmic-detail-main-image {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.cosmic-detail-main-image img {
  width: 100%;
  height: auto;
  display: block;
}

.cosmic-detail-thumbnails {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.cosmic-detail-thumbnail {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.cosmic-detail-thumbnail:hover {
  border-color: #8b5cf6;
}

.cosmic-detail-thumbnail img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}

.cosmic-detail-info h1 {
  font-size: 3rem;
  color: #ffffff;
  margin: 0 0 1rem 0;
}

.cosmic-detail-tagline {
  font-size: 1.25rem;
  color: #8b5cf6;
  margin: 0 0 2rem 0;
  font-style: italic;
}

.cosmic-detail-description {
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
}

.cosmic-detail-specs {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.cosmic-detail-specs h3 {
  font-size: 1.25rem;
  color: #ffffff;
  margin: 0 0 1.25rem 0;
}

.cosmic-spec-row {
  display: flex;
  justify-content: space-between;
  padding: 0.875rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cosmic-spec-row:last-child {
  border-bottom: none;
}

.cosmic-spec-label {
  font-weight: 600;
  color: #9ca3af;
}

.cosmic-spec-value {
  color: #ffffff;
  text-align: right;
}

.cosmic-detail-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Ensure all buttons have consistent styling */
.cosmic-detail-actions .btn,
.cosmic-card-footer .btn,
.cosmic-pagination .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  text-align: center !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

/* ============================================
   PAGINATION
   ============================================ */

.cosmic-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0;
  flex-wrap: wrap;
}

.cosmic-pagination-btn,
.cosmic-pagination-num {
  padding: 0.625rem 1.125rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
  font-weight: 500;
}

.cosmic-pagination-btn:hover:not(.cosmic-pagination-disabled),
.cosmic-pagination-num:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: #8b5cf6;
  transform: translateY(-2px);
}

.cosmic-pagination-num {
  min-width: 40px;
  text-align: center;
}

.cosmic-pagination-current {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border-color: transparent;
  color: #ffffff;
  font-weight: 700;
}

.cosmic-pagination-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cosmic-pagination-ellipsis {
  padding: 0.625rem;
  color: #6b7280;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.cosmic-empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: #9ca3af;
}

.cosmic-empty-state h3 {
  font-size: 1.75rem;
  color: #e5e7eb;
  margin: 0 0 0.75rem 0;
}

.cosmic-empty-state p {
  font-size: 1.125rem;
  margin: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
  .cosmic-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  
  .cosmic-detail-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .cosmic-detail-media {
    position: static;
  }
}

@media (max-width: 768px) {
  .cosmic-page-header h1 {
    font-size: 2.5rem;
  }
  
  .cosmic-page-header p {
    font-size: 1rem;
  }
  
  .filter-form {
    flex-direction: column;
  }
  
  .cosmic-search-input,
  .cosmic-filter-select {
    width: 100%;
  }
  
  .cosmic-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }
  
  .cosmic-card-image,
  .cosmic-blog-card .cosmic-card-image {
    height: 200px;
  }
  
  .cosmic-post-title {
    font-size: 2rem;
  }
  
  .cosmic-post-content {
    font-size: 1rem;
  }
  
  .cosmic-detail-info h1 {
    font-size: 2rem;
  }
  
  .cosmic-detail-thumbnails {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .cosmic-page-header {
    padding: 3rem 1rem 2rem 1rem;
  }
  
  .cosmic-page-header h1 {
    font-size: 2rem;
  }
  
  .cosmic-card-content {
    padding: 1.25rem;
  }
  
  .cosmic-pagination-btn,
  .cosmic-pagination-num {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
