:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --accent: #0ea5e9;
    --bg-dark: #0f172a;
    --bg-darker: #0a0f1d;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-secondary: rgba(30, 41, 59, 0.5);
    --bg-tertiary: rgba(30, 41, 59, 0.85);
    --border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

/* Animated Background */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    top: -200px;
    left: -200px;
    animation: float 20s infinite ease-in-out;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #ec4899, #f472b6);
    bottom: -150px;
    right: -150px;
    animation: float 25s infinite ease-in-out reverse;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    top: 40%;
    left: 60%;
    animation: float 18s infinite ease-in-out;
}

.blob-4 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #10b981, #34d399);
    bottom: 20%;
    left: 20%;
    animation: float 22s infinite ease-in-out;
    opacity: 0.3;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -50px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s;
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s;
}

.logo:hover {
    transform: scale(1.05);
}

.logo span {
    background: linear-gradient(90deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.github-link {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.github-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

.container-narrow {
    max-width: 900px;
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.8s ease-out;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-title .gradient-text {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-search {
    width: 100%;
    max-width: 600px;
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.hero-search input {
    width: 100%;
    padding: 1.25rem 1.5rem 1.25rem 3.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    color: var(--text-main);
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.hero-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 10px 40px rgba(99, 102, 241, 0.2);
}

.hero-search input::placeholder {
    color: var(--text-muted);
}

.hero-search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: var(--text-muted);
}

.hero-search-clear {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.hero-search-clear.visible {
    opacity: 1;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.scroll-indicator:hover {
    opacity: 1;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Category Grid */
.categories-section {
    padding: 4rem 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(30, 41, 59, 0.4));
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: transform 0.4s;
}

.category-card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.3);
}

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

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.category-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.category-title-wrapper {
    flex: 1;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.category-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    display: inline-block;
}

.tool-list {
    list-style: none;
}

.tool-list li {
    margin-bottom: 0.25rem;
}

.tool-list a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tool-list a:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
    transform: translateX(4px);
}

.tool-list a::before {
    content: "→";
    opacity: 0;
    transition: all 0.2s;
    color: var(--primary);
}

.tool-list a:hover::before {
    opacity: 1;
    transform: translateX(4px);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Featured Section */
.featured-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.05), transparent);
}

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

.featured-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s;
}

.featured-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-4px);
}

.featured-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.featured-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.featured-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Form Elements */
.input-field, .textarea-field, select {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.input-field:focus, .textarea-field:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.textarea-field {
    min-height: 200px;
    resize: vertical;
}

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    border-radius: 0.75rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -3px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: white;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Tool Page Layout */
.tool-container {
    display: grid;
    gap: 2rem;
}

.tool-input, .tool-output {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
}

.tool-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: block;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Slider */
.slider-container {
    margin: 1.5rem 0;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

/* Result Display */
.result-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    min-height: 100px;
    word-break: break-all;
}

/* Image Preview */
.image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
}

/* Canvas Container */
.canvas-container {
    background: #000;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.canvas-container canvas {
    max-width: 100%;
    max-height: 400px;
}

/* Stats/Info */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-box {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Footer */
.footer {
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.3));
    border-top: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-brand span {
    background: linear-gradient(90deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.footer-links h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

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

/* Utility Classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.flex { display: flex; }
.gap-2 { gap: 1rem; }
.hidden { display: none; }

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .hero-stat-value {
        font-size: 1.75rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: all;
    animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 2.7s forwards;
    max-width: 360px;
    word-break: break-word;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.toast-success { background: rgba(16, 185, 129, 0.92); color: white; }
.toast-error   { background: rgba(239, 68, 68, 0.92); color: white; }
.toast-warning { background: rgba(245, 158, 11, 0.92); color: white; }
.toast-info    { background: rgba(30, 41, 59, 0.97); color: #f8fafc; border-color: rgba(99,102,241,0.3); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(110%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(110%); }
}
