/* css/theme.css - Global Styles for Meeja Metro Frontend
 * Diadaptasi dari referensi "Desa Official Website"
 */

:root {
  --background: #ffffff;
  --foreground: #222222;
  --primary: #16a34a; /* Green-600 */
  --primary-hover: #15803d; /* Green-700 */
  --secondary: #f3f4f6;
  --secondary-foreground: #111827;
  --muted: #f9fafb;
  --muted-foreground: #6b7280;
  --border: #e5e7eb;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

.dark {
  --background: #111827;
  --foreground: #f9fafb;
  --primary: #22c55e; /* Green-500 */
  --primary-hover: #4ade80; /* Green-400 */
  --secondary: #1f2937;
  --secondary-foreground: #f9fafb;
  --muted: #374151;
  --muted-foreground: #9ca3af;
  --border: #374151;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
}

body {
  background-color: var(--background);
  color: var(--foreground);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Base Prose Styles untuk artikel */
.prose {
  color: var(--foreground);
  line-height: 1.75;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--foreground);
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
.prose p {
  margin-bottom: 1.25rem;
}
.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.prose a:hover {
  color: var(--primary-hover);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--background);
}
::-webkit-scrollbar-thumb {
  background: var(--muted-foreground);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}


/* ==============================================================
 * BASE COMPONENT STYLES 
 * (Automatically styles all frontend pages that lost their classes)
 * ============================================================== */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Typography Base */
h1 { font-size: 2.25rem; font-weight: 700; margin-bottom: 1rem; color: var(--foreground); line-height: 1.2; }
h2 { font-size: 1.875rem; font-weight: 700; margin-bottom: 1rem; color: var(--foreground); }
h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; color: var(--foreground); }
h4 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--foreground); }

/* Article Layout */
article {
  background-color: var(--background);
  border-radius: 0.75rem;
  padding: 0;
  margin-bottom: 2rem;
}

header { margin-bottom: 2rem; }
header h1 { font-size: 2.5rem; margin: 1rem 0; }
header > div { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; color: var(--muted-foreground); font-size: 0.875rem; border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; }

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}
article img {
  width: 100%;
  border-radius: 1rem;
  margin: 2rem 0;
}

/* Forms & Inputs */
input[type='text'],
input[type='email'],
input[type='password'],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--foreground);
  margin-bottom: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}
label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--foreground);
}

/* Buttons */
button, 
input[type='submit'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
button:hover, input[type='submit']:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}
button[id$='-btn'] {
  background-color: var(--muted);
  color: var(--foreground);
}
button[id$='-btn']:hover {
  background-color: var(--secondary);
}

/* Cards & Sections */
section {
  margin-bottom: 3rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
}
section h3 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Comment Section specific */
#comments-section > div {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
}
#comments-section > div > div:first-child span {
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
