﻿/* 
  ==========================================================================
  UUID Generator - Core Design System & Styles (Dark Mode Optimized)
  Architecture: CSS Variables, CSS Grid/Flexbox, Glassmorphism
  AdSense Ready: Pre-allocated ad slots to prevent CLS
  ========================================================================== 
*/

:root {
  /* Brand & UI Colors */
  --bg-dark: #0f1117;
  --bg-card: rgba(25, 27, 36, 0.7);
  --bg-card-hover: rgba(35, 38, 49, 0.9);
  
  --primary-accent: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --secondary-accent: #10b981; /* Emerald */
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-darker: #94a3b8;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --input-bg: #1f2230;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Shadows & Effects */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --glass-blur: blur(12px);
  
  /* Layout constraints */
  --max-width: 1200px;
    --header-height: 70px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  width: 100%;
  overflow-x: clip;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -200px;
  left: 0;
  background: var(--primary-accent);
  color: white;
  padding: 8px 16px;
  z-index: 1000;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

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

/* ================== Header ================== */
.site-header {
  height: var(--header-height);
  background: rgba(15, 17, 23, 0.9);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
}
.brand-logo svg { color: var(--primary-accent); }
.brand-badge {
  font-size: 0.7rem;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.nav-links a.active {
  color: #ffffff;
  background: #4f46e5;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}

/* ================== Main Layout (AdSense Optimized) ================== */
.main-wrapper {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 20px;
  width: 100%;
}

.generator-container,
.tool-layout-grid {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* ================== Tool UI Component ================== */
.tool-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 40px;
}

.tool-header-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 5px;
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tool-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 25px;
}

/* Version Tabs */
.version-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 25px;
}
.tab-btn {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover {
  border-color: var(--text-darker);
  color: var(--text-main);
}
.tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: #818cf8;
  color: #a5b4fc;
  box-shadow: var(--shadow-glow);
}
.badge-v { font-size: 0.75rem; color: #94a3b8; }
.tab-btn.active .badge-v { color: #c7d2fe; }

/* Inputs & Outputs */
.output-box-wrapper { margin-bottom: 20px; }
.output-display {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  text-align: center;
  padding: 20px;
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--secondary-accent);
  word-break: break-all;
  letter-spacing: 1px;
}
.output-textarea {
  width: 100%;
  height: 250px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 15px;
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  resize: vertical;
  line-height: 1.5;
}
.output-textarea:focus {
  outline: none;
  border-color: var(--primary-accent);
}

.minecraft-input-row {
  display: none;
  margin-bottom: 20px;
}
.input-field {
  width: 100%;
  padding: 12px 15px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: white;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
}
.input-field:focus {
  outline: none;
  border-color: var(--primary-accent);
}

/* Buttons */

.action-format-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0 16px;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.action-format-box:hover, .action-format-box:focus-within {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.format-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.action-format-select {
  background: transparent !important;
  color: white !important;
  border: none !important;
  color-scheme: dark;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 4px;
  outline: none;
}
.action-format-select option {
  background: #141721;
  color: white;
}

.action-btn-group {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  min-height: 48px;
}
.btn-primary, .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  min-height: 48px;
  box-sizing: border-box;
  line-height: 1.25;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary {
  flex: 2;
  background: #4f46e5;
  color: #ffffff;
}
.btn-primary:hover { background: #4338ca; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  flex: 1;
  background: var(--input-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-card-hover); }

/* Options Grid */
.options-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  padding: 18px 20px;
  border-radius: 12px;
}
.option-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.qty-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-input {
  width: 80px;
  background: var(--input-bg) !important;
  color: white !important;
  border: 1px solid var(--border-color) !important;
  padding: 6px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  color-scheme: dark;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.qty-input:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.qty-max-badge {
  font-size: 0.72rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.select-control {
  background: var(--input-bg);
  color: white;
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}



/* ================== Secondary Sections ================== */
.decoder-section, .snippets-section {
  scroll-margin-top: calc(var(--header-height) + 20px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 40px;
}
.decoder-section h2, .snippets-section h2 { font-size: 1.5rem; margin-bottom: 10px; }
.section-desc { color: var(--text-muted); margin-bottom: 20px; font-size: 0.95rem; }

.decoder-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.decoder-result-card {
  background: rgba(0,0,0,0.3);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
.decoder-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.meta-item {
  display: flex;
  flex-direction: column;
}
.meta-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;}
.meta-value { font-family: var(--font-mono); font-size: 1rem; color: var(--secondary-accent); }

/* Code Snippets */
.snippets-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 15px;
}
.snippets-tabs::-webkit-scrollbar { height: 4px; }
.snippets-tabs::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px;}
.snippet-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
}
.snippet-tab-btn.active { background: var(--input-bg); color: white; }
.code-block-wrapper {
  position: relative;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.btn-copy-code {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-copy-code:hover { background: var(--primary-accent); }
.code-content {
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #a5b4fc;
}

/* ================== SEO Article & FAQ ================== */
.seo-article-container {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 40px;
  border: 1px solid var(--border-color);
}
.seo-article h2 { margin: 30px 0 15px; color: white; }
.seo-article h3 { margin: 25px 0 10px; color: #e5e7eb; }
.seo-article p { margin-bottom: 15px; color: var(--text-muted); }
.seo-article ul { margin-left: 20px; margin-bottom: 20px; color: var(--text-muted); }
.seo-article li { margin-bottom: 8px; }
.seo-article code {
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: #a5b4fc;
}
.seo-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.seo-article th, .seo-article td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}
.seo-article th { color: white; background: rgba(0,0,0,0.2); }

/* FAQ */
.faq-section { margin-top: 50px; }
.faq-item {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 15px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-icon { transition: transform 0.3s; }
.faq-item.active .faq-icon { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  color: var(--text-muted);
}
.faq-item.active .faq-answer {
  max-height: 500px; /* Arbitrary large number */
  padding-bottom: 15px;
}

/* ================== Footer ================== */
.site-footer {
  background: #0a0b0f;
  border-top: 1px solid var(--border-color);
  padding: 60px 20px 20px;
  margin-top: auto;
}
.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col:first-child {
  max-width: 360px;
}
.footer-col h3,
.footer-col h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  margin-bottom: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: white;
  margin-bottom: 15px;
}
.footer-brand svg {
  color: var(--primary-accent);
}
.footer-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links li { margin-bottom: 0; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: white; }
.footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-contact li {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font-mono);
}
.footer-contact li a { color: var(--text-muted); }
.footer-contact li a:hover { color: white; }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  color: var(--text-darker);
  font-size: 0.85rem;
}

/* ================== Responsive ================== */


@media (max-width: 768px) {
  .nav-links {
    display: none; /* Hide for mobile, needs JS to toggle */
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-links.show { display: flex; }
  .mobile-menu-btn { display: block; }
  
  .action-btn-group { flex-direction: column; }
  .action-format-box { justify-content: space-between; padding: 12px 16px; }
  .decoder-meta-grid { grid-template-columns: 1fr; }
  .footer-container { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 32px; }
  .footer-col { width: 100%; max-width: 400px; }
  .footer-links, .footer-contact { display: flex; flex-direction: column; align-items: center; }
  .footer-brand { justify-content: center; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 10px; }
}



/* Comprehensive Mobile Overflow & Padding Fixes */
html, body {
  max-width: 100vw;
  overflow-x: clip;
}

* {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (max-width: 768px) {
  .main-wrapper { padding: 15px 10px !important; }
  .tool-card { padding: 20px 15px !important; }
  .seo-article-container { padding: 20px 15px !important; }
  .decoder-section, .snippets-section { padding: 20px 15px !important; }
  
  .output-display { 
    font-size: 1rem !important; 
    padding: 15px !important; 
    word-break: break-all;
  }
  
  .tool-header-title { font-size: 1.4rem; }
  
  .decoder-input-group { flex-direction: column; }
  .btn-secondary { width: 100%; }
}

/* Grid/Flex Blowout Fix (CRITICAL) */
.tool-layout-grid > * {
  min-width: 0;
}
.main-wrapper {
  min-width: 0;
}
.tool-main-col {
  min-width: 0;
}
.snippets-section, .decoder-section, .tool-card, .seo-article-container {
  min-width: 0;
}
.snippets-tabs {
  min-width: 0;
}
pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Fix for long code strings in article overflowing */
.seo-article code {
  word-break: break-all !important;
  white-space: pre-wrap !important;
}

/* Very Small Mobile Header Fixes */
.brand-logo, .brand-badge {
  white-space: nowrap;
}
.brand-logo {
  flex-wrap: nowrap;
}

@media (max-width: 576px) {
  .brand-badge {
    display: none !important;
  }
  .brand-logo {
    font-size: 1.2rem;
  }
}

/* Final Failsafe for Mobile Width */
html, body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: clip !important;
  margin: 0 !important;
  padding: 0 !important;
}

.tool-card { overflow-x: hidden; }
.header-container { min-width: 0; }



/* Hide Logo Text on Extra Small Screens (< 360px) */
@media (max-width: 360px) {
  .brand-logo {
    font-size: 0 !important; /* Hides the bare text node 'UUID Gen' */
  }
}


/* ==========================================================================
   Cookie Consent Banner (GDPR / CCPA / AdSense Compliance)
   ========================================================================== */
.cookie-consent-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 440px;
  width: calc(100% - 48px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.1);
  border-radius: 14px;
  padding: 18px 20px;
  z-index: 999999;
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.cookie-consent-banner.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cookie-consent-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cookie-consent-text {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.cookie-consent-text .cookie-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.cookie-consent-text a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.cookie-consent-text a:hover {
  color: #7dd3fc;
}

.cookie-consent-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cookie-accept {
  padding: 8px 16px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-cookie-accept:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
}

.btn-cookie-decline {
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cookie-decline:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 576px) {
  .cookie-consent-banner {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    padding: 16px;
  }
  .cookie-consent-actions {
    flex-direction: column-reverse;
    width: 100%;
  }
  .btn-cookie-accept,
  .btn-cookie-decline {
    width: 100%;
    text-align: center;
    padding: 10px;
  }
}
