/* ========================================
   NanoTools Design System
   Modern, elegant design with dark mode support
   ======================================== */

/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
    /* Light Mode Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;

    --border-light: #f3f4f6;
    --border-medium: #e5e7eb;
    --border-strong: #d1d5db;

    --accent-primary: #f43f5e;
    --accent-hover: #e11d48;
    --accent-light: #ffe4e6;

    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --error-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --info-light: #dbeafe;

    --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);
    --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.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-elevated: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;

    --border-light: #334155;
    --border-medium: #475569;
    --border-strong: #64748b;

    --accent-primary: #f43f5e;
    --accent-hover: #fb7185;
    --accent-light: #4c1d24;

    --success: #10b981;
    --success-light: #064e3b;
    --error: #ef4444;
    --error-light: #7f1d1d;
    --warning: #f59e0b;
    --warning-light: #78350f;
    --info: #3b82f6;
    --info-light: #1e3a8a;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-base), color var(--transition-base);
    min-height: 100vh;
}

/* ========================================
   Typography
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--accent-hover);
}

/* ========================================
   Layout Components
   ======================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }
}

/* ========================================
   Header & Navigation
   ======================================== */
.site-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.site-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.site-title a {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-tagline {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 400;
}

/* Dark Mode Toggle */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-lg);
}

.theme-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--text-primary);
    transition: transform var(--transition-base);
}

/* ========================================
   Card Components
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-elevated {
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Tool Cards Grid
   ======================================== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 640px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

.tool-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-light);
    box-shadow: var(--shadow-xl);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* ========================================
   Tool Page Layout
   ======================================== */
.tool-page {
    max-width: 1400px;
    margin: 0 auto;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--accent-light), transparent);
    border-radius: var(--radius-2xl);
}

.tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-primary) 50%);
    border-radius: var(--radius-xl);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.tool-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-description {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

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

@media (max-width: 968px) {
    .tool-content {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Form Components
   ======================================== */
.tool-form {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

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

.form-section:last-child {
    margin-bottom: 0;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--accent-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Input Fields */
input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

textarea {
    font-family: 'Monaco', 'Menlo', 'Consolas', 'SF Mono', monospace;
    resize: vertical;
    min-height: 200px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-light);
}

input[type="file"] {
    display: block;
    width: 100%;
    padding: 1rem;
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

input[type="file"]:hover {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

/* File Input Styling */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.file-input-wrapper:hover {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Checkboxes and Radio Buttons */
input[type="checkbox"],
input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.checkbox-label:hover,
.radio-label:hover {
    background: var(--bg-secondary);
}

/* Select Dropdown */
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5rem;
    padding-right: 2.5rem;
    appearance: none;
}

/* ========================================
   Button Components
   ======================================== */
.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--accent-primary);
}

.btn-ghost:hover {
    background: var(--accent-light);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
}

.btn-full {
    width: 100%;
}

/* ========================================
   Output & Result Components
   ======================================== */
.output-section {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    min-height: 400px;
    box-shadow: var(--shadow-md);
}

.empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Success Output */
.success-output {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.success-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.btn-copy {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.btn-copy:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.formatted-output,
.formatted-json {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Consolas', 'SF Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    border: 1px solid var(--border-light);
}

.formatted-output code,
.formatted-json code {
    color: var(--text-primary);
}

/* Error Output */
.error-output {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--error-light), transparent);
    border: 2px solid var(--error);
    border-radius: var(--radius-xl);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.error-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.error-content h4 {
    color: var(--error);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.error-message {
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', 'Consolas', 'SF Mono', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-sm);
}

/* ========================================
   Info Boxes & Alerts
   ======================================== */
.info-box {
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-medium);
    margin: 2rem 0;
}

.info-box-success {
    background: linear-gradient(135deg, var(--success-light), transparent);
    border-color: var(--success);
}

.info-box-error {
    background: linear-gradient(135deg, var(--error-light), transparent);
    border-color: var(--error);
}

.info-box-warning {
    background: linear-gradient(135deg, var(--warning-light), transparent);
    border-color: var(--warning);
}

.info-box-info {
    background: linear-gradient(135deg, var(--info-light), transparent);
    border-color: var(--info);
}

.info-box-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.info-box-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.info-box-title {
    font-weight: 700;
    font-size: 1.125rem;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    text-align: center;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
    border-top: 2px solid var(--border-light);
    color: var(--text-secondary);
}

.site-footer p {
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ========================================
   Loading States
   ======================================== */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-medium);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.hidden {
    display: none;
}

/* ========================================
   Responsive Utilities
   ======================================== */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .tool-header h2 {
        font-size: 2rem;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {

    .theme-toggle,
    .btn,
    .site-footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}

/* Section titles within tools */
.section-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
    color: var(--text-primary);
}

/* Output preview boxes */
.output-preview {
    margin-top: 1.5rem;
    min-height: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.output-result {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.output-result pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Monaco', 'Menlo', 'Consolas', 'SF Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Only new landing page specific styles */

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 50%, #fef3c7 100%);
    border-radius: 2rem;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 20px,
            rgba(244, 63, 94, 0.03) 20px,
            rgba(244, 63, 94, 0.03) 40px);
    animation: slide 30s linear infinite;
    pointer-events: none;
}

@keyframes slide {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-emoji {
    font-size: 5rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f43f5e, #ec4899, #f43f5e);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 500;
}

.hero-badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border-light);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .badge {
    background: rgba(30, 41, 59, 0.9);
}

.badge-icon {
    font-size: 1.25rem;
}

/* Category Sections */
.category-section {
    margin-bottom: 4rem;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--accent-primary);
}

.category-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-light), rgba(244, 63, 94, 0.1));
    border-radius: 1rem;
    transform: rotate(-5deg);
}

.category-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.category-description {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* Enhanced Tool Cards */
.tools-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card-enhanced {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tool-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), #ec4899);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.tool-card-enhanced:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(244, 63, 94, 0.15);
    border-color: var(--accent-primary);
}

.tool-card-enhanced:hover::before {
    transform: scaleX(1);
}

.tool-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.tool-card-enhanced:hover .tool-card-icon {
    transform: scale(1.2) rotate(5deg);
}

.tool-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tool-card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.tool-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tool-tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    transition: gap 0.3s ease;
}

.tool-card-enhanced:hover .tool-card-link {
    gap: 1rem;
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, var(--accent-primary), #ec4899);
    border-radius: 2rem;
    padding: 3rem 2rem;
    margin: 4rem 0;
    color: white;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Footer CTA */
.footer-cta {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 2px dashed var(--border-medium);
    border-radius: 2rem;
    margin-top: 4rem;
}

.footer-cta-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-cta-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-primary), #ec4899);
    color: white;
    text-decoration: none;
    border-radius: 3rem;
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: 0 10px 30px rgba(244, 63, 94, 0.3);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(244, 63, 94, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .tools-category-grid {
        grid-template-columns: 1fr;
    }

    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
}

/* UUID Generator specific styles */
.uuid-content {
    max-width: 900px;
    margin: 0 auto;
}

.uuid-controls {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

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

.control-group:last-child {
    margin-bottom: 0;
}

.uuid-count-input {
    width: 100px;
    padding: 0.75rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.uuid-output {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.uuid-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
}

.uuid-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.uuid-item:hover {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

.uuid-item code {
    flex: 1;
    font-family: 'Monaco', 'Menlo', 'Consolas', 'SF Mono', monospace;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.btn-copy-single {
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.btn-copy-single:hover {
    opacity: 1;
}

.uuid-info {
    margin-top: 2rem;
}

/* QR Code Generator Styles */
.qr-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.qr-type-option {
    cursor: pointer;
}

.qr-type-option input[type="radio"] {
    display: none;
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    text-align: center;
}

.qr-type-option input[type="radio"]:checked+.type-card {
    border-color: var(--accent-primary);
    background: var(--accent-light);
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1);
}

.type-icon {
    font-size: 2rem;
}

.type-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Input groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Color pickers */
.color-picker-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.color-picker label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
}

.color-input {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.color-value {
    font-family: 'Monaco', 'Menlo', 'Consolas', 'SF Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* QR Code Result */
.qr-result {
    animation: slideIn 0.3s ease-out;
}

.qr-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
}

.qr-preview img {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    /* Keep QR codes sharp */
}

.qr-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Examples section */
.qr-examples {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-2xl);
}

.qr-examples h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.example-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.example-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.example-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.example-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.example-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}