/* ==========================================================================
   CSS Variables & Theming
   ========================================================================== */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --success-bg: #d1fae5;
    --error: #ef4444;
    --error-bg: #fee2e2;
    --focus-ring: rgba(37, 99, 235, 0.3);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --shadow-sm: 0 1px 2px 0 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);
    
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

html {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--background);
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

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

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Layout & Containers
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    flex: 1;
    padding: 3rem 0;
}

.section {
    margin-bottom: 4rem;
}

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

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
}

.site-logo:hover {
    text-decoration: none;
}

.main-nav .nav-list {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-main);
    font-weight: 500;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    text-decoration: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
}

/* ==========================================================================
   Components (Cards, Buttons, Forms)
   ========================================================================== */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: var(--background);
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ==========================================================================
   UUID Generator Specific
   ========================================================================== */
.generator-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.generator-controls .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.generator-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.results-container {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.results-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--background);
}

.uuid-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    word-break: break-all;
}

.uuid-item:last-child {
    border-bottom: none;
}

.uuid-text {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-main);
}

.status-message {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: none;
    font-weight: 500;
}

.status-message.visible {
    display: block;
}

.status-message.success {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid #a7f3d0;
}

.status-message.error {
    background-color: var(--error-bg);
    color: var(--error);
    border: 1px solid #fecaca;
}

.validate-result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    display: none;
}

.validate-result.success-box {
    display: block;
    background-color: var(--success-bg);
    border: 1px solid var(--success);
}

.validate-result.error-box {
    display: block;
    background-color: var(--error-bg);
    border: 1px solid var(--error);
}

.success { color: var(--success); font-weight: 600; }
.error { color: var(--error); font-weight: 600; }

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.hidden { display: none !important; }

/* ==========================================================================
   Redesign Additions (Hero, Blog Cards, Feature Cards)
   ========================================================================== */
.hero { 
    text-align: center; 
    padding: 5rem 1.5rem; 
    background: linear-gradient(180deg, var(--surface) 0%, var(--background) 100%); 
    border-bottom: 1px solid var(--border); 
    margin-bottom: 3rem; 
}
.hero h1 { 
    font-size: 3.5rem; 
    margin-bottom: 1.5rem; 
    color: var(--text-main); 
    line-height: 1.1; 
    letter-spacing: -0.02em; 
}
.hero p { 
    font-size: 1.25rem; 
    max-width: 650px; 
    margin: 0 auto 2.5rem; 
    color: var(--text-muted); 
}
.hero-buttons { 
    display: flex; 
    justify-content: center; 
    gap: 1rem; 
    flex-wrap: wrap; 
}
.hero-buttons .btn { 
    font-size: 1.125rem; 
    padding: 1rem 2rem; 
}
.blog-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 2rem; 
}
.blog-card { 
    display: flex; 
    flex-direction: column; 
    background: var(--surface); 
    border: 1px solid var(--border); 
    border-radius: var(--radius-lg); 
    padding: 1.75rem; 
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
}
.blog-card:hover { 
    transform: translateY(-3px); 
    box-shadow: var(--shadow-md); 
    border-color: var(--primary); 
}
.blog-card h3 { 
    margin-bottom: 0.75rem; 
    font-size: 1.25rem; 
}
.blog-card a { 
    color: var(--text-main); 
    text-decoration: none; 
}
.blog-card a:hover { 
    color: var(--primary); 
}
.blog-card p { 
    flex-grow: 1; 
    margin-bottom: 1.5rem; 
    color: var(--text-muted); 
    font-size: 0.95rem; 
    line-height: 1.6; 
}
.blog-card .read-more { 
    color: var(--primary); 
    font-weight: 600; 
    font-size: 0.95rem; 
    align-self: flex-start; 
}
.feature-card { 
    text-align: center; 
    padding: 2rem; 
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.feature-card h3 { 
    margin-bottom: 1rem; 
    color: var(--text-main); 
}
.feature-card p { 
    color: var(--text-muted); 
    font-size: 0.95rem; 
}
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.125rem; }
    .hero { padding: 3rem 1rem; }
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span { margin: 0 0.5rem; }

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

/* SEO Content */
.prose {
    max-width: 800px;
    margin: 0 auto;
}
.prose h2 { margin-top: 3rem; margin-bottom: 1rem; }
.prose h3 { margin-top: 2rem; margin-bottom: 0.75rem; }
.prose ul, .prose ol { margin-left: 1.5rem; margin-bottom: 1.5rem; color: var(--text-muted); }
.prose li { margin-bottom: 0.5rem; }
.prose code {
    background: var(--border);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.875em;
    color: var(--text-main);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.footer-col ul li { margin-bottom: 0.75rem; }
.footer-col a { color: var(--text-muted); }
.footer-col a:hover { color: var(--primary); text-decoration: none; }

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==========================================================================
   Responsive (Mobile First considerations)
   ========================================================================== */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 4rem;
        left: 0;
        right: 0;
        background-color: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        box-shadow: var(--shadow-md);
    }
    
    .main-nav.active { display: block; }
    .main-nav .nav-list { flex-direction: column; gap: 1rem; }
    
    .grid-2, .grid-3, .footer-grid { grid-template-columns: 1fr; }
    
    .generator-controls { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; margin-bottom: 0.5rem; }
    .generator-actions .btn { width: 100%; }
    
    .uuid-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .uuid-item .btn-sm { align-self: flex-end; }
    .uuid-text { font-size: 0.875rem; word-break: break-all; }
}
