/* ================================================
   PrintoColor - Coloring Pages Website Stylesheet
   ================================================ */

/* CSS Variables */
:root {
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-primary-light: #818cf8;
  --color-secondary: #f59e0b;
  --color-secondary-dark: #d97706;
  --color-success: #10b981;
  --color-error: #ef4444;
  
  --color-text: #1f2937;
  --color-text-light: #6b7280;
  --color-text-muted: #9ca3af;
  
  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;
  --color-bg-card: #ffffff;
  --color-border: #e5e7eb;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Poppins', var(--font-sans);
  
  --max-width: 1200px;
  --header-height: 70px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

/* ================================================
   Header & Navigation
   ================================================ */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.logo:hover {
  color: var(--color-primary);
}

.logo-icon {
  font-size: 1.75rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-text-light);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.2s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
}

/* ================================================
   Page Container
   ================================================ */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

/* ================================================
   Breadcrumb
   ================================================ */
.breadcrumb {
  margin-bottom: 1.5rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: '›';
  margin-left: 0.5rem;
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-text-light);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb [aria-current="page"] {
  color: var(--color-text);
  font-weight: 500;
}

/* ================================================
   Page Header
   ================================================ */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.page-description {
  font-size: 1.125rem;
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .page-title {
    font-size: 1.875rem;
  }
  
  .page-description {
    font-size: 1rem;
  }
}

/* ================================================
   Preview Section
   ================================================ */
.preview-section {
  margin-bottom: 2rem;
}

.image-container {
  max-width: 600px;
  margin: 0 auto;
}

.preview-link {
  display: block;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.preview-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.preview-image {
  width: 100%;
  height: auto;
  background: var(--color-bg-alt);
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(99, 102, 241, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
  opacity: 0;
  transition: all 0.3s ease;
}

.preview-link:hover .preview-overlay {
  background: rgba(99, 102, 241, 0.85);
  opacity: 1;
}

.preview-overlay svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ================================================
   Action Buttons
   ================================================ */
.action-section {
  margin-bottom: 3rem;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-md), 0 0 0 0 rgba(99, 102, 241, 0.5);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
}

.btn-download {
  font-size: 1.125rem;
  padding: 1rem 2rem;
}

@media (max-width: 480px) {
  .action-buttons {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

/* ================================================
   Info Section
   ================================================ */
.info-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.info-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
}

.info-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.print-steps,
.tips-list {
  padding-left: 1.25rem;
}

.print-steps li,
.tips-list li {
  margin-bottom: 0.5rem;
  color: var(--color-text-light);
}

.print-steps strong {
  color: var(--color-text);
}

kbd {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  font-family: monospace;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--color-border);
}

/* ================================================
   Related Section
   ================================================ */
.related-section {
  margin-bottom: 2rem;
}

.related-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.related-placeholder,
.related-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem;
}

.view-all-btn {
  display: block;
  width: fit-content;
  margin: 0 auto;
}

/* ================================================
   Coloring Page Card (for grids)
   ================================================ */
.coloring-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.coloring-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.coloring-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.coloring-card-content {
  padding: 1rem;
}

.coloring-card-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.coloring-card-category {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* ================================================
   Footer
   ================================================ */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.125rem;
}

.footer-copy {
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.footer-nav a:hover {
  color: var(--color-primary);
}

/* ================================================
   Toast Notifications
   ================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-text);
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-lg);
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ================================================
   Homepage Styles
   ================================================ */
.hero {
  text-align: center;
  padding: 4rem 0;
  background: linear-gradient(135deg, #f0f4ff 0%, #fef3f2 100%);
  border-radius: var(--radius-xl);
  margin-bottom: 3rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--color-text-light);
  max-width: 500px;
  margin: 0 auto 2rem;
}

@media (max-width: 768px) {
  .hero {
    padding: 2.5rem 1.5rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
}

/* Category Section */
.category-section {
  margin-bottom: 3rem;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.category-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.category-header a {
  font-weight: 500;
  font-size: 0.9375rem;
}

/* ================================================
   Print Styles
   ================================================ */
@media print {
  .site-header,
  .site-footer,
  .breadcrumb,
  .action-buttons,
  .info-section,
  .related-section {
    display: none !important;
  }
  
  .page-container {
    padding: 0;
    max-width: none;
  }
  
  .preview-image {
    max-width: 100%;
    page-break-inside: avoid;
  }
}

/* ================================================
   Utility Classes
   ================================================ */
.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;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
