﻿/* 
  ==========================================================================
  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: #6b7280;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --input-bg: #1f2230;
  
  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, 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;
  --ad-sidebar-width: 300px;
  --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: hidden;
  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.85);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 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.1);
  color: var(--primary-accent);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-glow);
}

.nav-links {
  display: flex;
  gap: 25px;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-main);
}

.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%;
}

.tool-layout-grid {
  display: grid;
  grid-template-columns: 1fr var(--ad-sidebar-width);
  gap: 40px;
  align-items: start;
}

/* ================== 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.1);
  border-color: var(--primary-accent);
  color: var(--primary-accent);
  box-shadow: var(--shadow-glow);
}
.badge-v { font-size: 0.75rem; opacity: 0.7; }

/* 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-btn-group {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}
.btn-primary, .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary {
  flex: 2;
  background: var(--primary-accent);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); }
.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: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  background: rgba(0,0,0,0.2);
  padding: 20px;
  border-radius: 12px;
}
.option-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}
.select-control {
  background: var(--input-bg);
  color: white;
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* ================== AdSense Slots (0 CLS) ================== */
.ad-slot-sidebar {
  width: 300px;
  min-height: 600px; /* Crucial for CLS */
  background: var(--input-bg);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-darker);
  position: sticky;
  top: calc(var(--header-height) + 30px);
}
.ad-slot-incontent {
  width: 100%;
  min-height: 90px;
  margin: 40px 0;
  background: var(--input-bg);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-darker);
}

/* ================== Secondary Sections ================== */
.decoder-section, .snippets-section {
  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: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  color: white;
  margin-bottom: 20px;
}
.footer-desc { color: var(--text-muted); font-size: 0.9rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links 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: 992px) {
  .tool-layout-grid {
    grid-template-columns: 1fr; /* Remove sidebar on small screens */
  }
  .ad-slot-sidebar { display: none; }
}

@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; }
  .decoder-meta-grid { grid-template-columns: 1fr; }
  .footer-container { grid-template-columns: 1fr; text-align: center; }
  .footer-links { display: flex; flex-direction: column; align-items: center; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 10px; }
}



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

* {
  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: hidden !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' */
  }
}

