/* ================================
   SexArt - Dark Theme Stylesheet
   ================================ */

/* CSS Variables */
:root {
  --bg-primary: #0d0d0d;
  --bg-surface: #1a1a1a;
  --bg-elevated: #242424;
  --accent-primary: #ff6b00;
  --accent-hover: #ff8533;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --border-color: #2a2a2a;
  --success-color: #22c55e;
  --error-color: #ef4444;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ================================
   Header
   ================================ */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--accent-hover);
}

.nav a {
  color: var(--text-secondary);
  margin-left: 1.5rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text-primary);
}

/* ================================
   Main Content
   ================================ */
.main-content {
  flex: 1;
  padding: 2rem 0;
}

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-secondary);
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--text-primary);
}

.breadcrumb .separator {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

/* ================================
   Models Grid (Homepage)
   ================================ */
.models-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 1024px) {
  .models-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Model Card */
.model-card {
  display: block;
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.model-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.model-image {
  aspect-ratio: 1;
  overflow: hidden;
}

.model-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

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

.model-info {
  padding: 1rem;
  text-align: center;
}

.model-info h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.product-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ================================
   Model Page Header
   ================================ */
.model-header {
  margin-bottom: 2rem;
}

.model-profile {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.model-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-primary);
}

.model-details h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.model-details .product-count {
  font-size: 0.875rem;
}

/* ================================
   Products Grid
   ================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Product Card */
.product-card {
  display: block;
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-primary);
  aspect-ratio: 1;
}

.product-image img {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform var(--transition);
  object-fit: cover;
}

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

.product-type-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background-color: rgba(0, 0, 0, 0.7);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-info {
  padding: 1rem;
}

.product-info h2 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ================================
   Product Detail Page
   ================================ */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .product-detail {
    grid-template-columns: 2fr 1fr;
  }
}

/* Product Gallery */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--bg-surface);
}

.product-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-type-overlay {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(0, 0, 0, 0.8);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Thumbnail Grid */
.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.thumbnail {
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition);
  background-color: var(--bg-primary);
}

.thumbnail:hover {
  opacity: 1;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Product Sidebar */
.product-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.product-meta h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.model-link {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.model-link a {
  color: var(--accent-primary);
}

.product-type {
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-video {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.badge-gallery {
  background-color: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

/* Purchase Box */
.purchase-box {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.purchase-box .price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.purchase-box .price-note {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.purchase-box form {
  margin-bottom: 1rem;
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ================================
   Buttons
   ================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: var(--bg-primary);
}

.btn-secondary {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-surface);
  border-color: var(--text-muted);
}

.btn-large {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* ================================
   Success Page
   ================================ */
.success-page {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 0;
}

.processing-state,
.success-state {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

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

.processing-state h1,
.success-state h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.refresh-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.success-icon {
  color: var(--success-color);
  margin-bottom: 1.5rem;
}

.product-name {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.download-box {
  background-color: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.expiry-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.success-notes {
  text-align: left;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.success-notes h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.success-notes ul {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: 1.25rem;
}

.success-notes li {
  margin-bottom: 0.5rem;
}

/* ================================
   Error Page
   ================================ */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.error-content {
  text-align: center;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-content h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.error-content p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ================================
   Empty State
   ================================ */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

/* ================================
   Age Gate Modal
   ================================ */
.age-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.age-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
}

.age-modal-content {
  position: relative;
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.age-modal-icon {
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
}

.age-modal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.age-modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.7;
}

.age-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.age-modal-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ================================
   Footer
   ================================ */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
}

.site-footer p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.site-footer .disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ================================
   Utilities
   ================================ */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
