:root {
    /* Premium Color Palette */
    --primary-hue: 260;
    /* Deep Violet */
    --primary-color: hsl(var(--primary-hue), 90%, 65%);
    --primary-dark: hsl(var(--primary-hue), 90%, 50%);
    --primary-light: hsl(var(--primary-hue), 100%, 96%);

    --secondary-hue: 330;
    /* Vibrant Pink */
    --accent-color: hsl(var(--secondary-hue), 85%, 60%);

    --text-primary: #1e293b;
    /* Slate 800 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-light: #f8fafc;

    --bg-body: #f3f4f6;
    /* Cool Gray */
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.85);

    --border-color: rgba(255, 255, 255, 0.6);
    --border-card: rgba(255, 255, 255, 0.4);

    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;

    /* Shadows - Soft & Premium */
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    /* Elevated feel */
    --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
    /* Primary glow */

    /* Spacing & Radius */
    --container-max-width: 1400px;
    /* Increased for fuller width */
    --header-height: 80px;
    --radius-sm: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background: var(--bg-body);
    /* Dynamic Mesh Gradient Background */
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background:
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(244, 63, 94, 0.15), transparent 25%);
    background-color: #f8fafc;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navbar - Refined & Complex */
.navbar {
    height: var(--header-height);
    background: white;
    /* Clean white for professional tool look */
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    margin-right: 2rem;
}

.logo img {
    height: 32px;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #333;
    letter-spacing: -0.05em;
}

.brand-text span {
    color: var(--danger);
}

/* Nav Menu (Center) */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin-left: auto;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    padding: 1.5rem 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.nav-link:hover {
    color: var(--danger);
}

.nav-link ion-icon {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Dropdowns */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    border-top: 3px solid var(--danger);
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: var(--danger);
    padding-left: 1.75rem;
}

/* Nav Actions (Right) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-login {
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
}

.btn-login:hover {
    color: var(--danger);
}

.btn-signup {
    background: var(--danger);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-signup:hover {
    background: #e11d48;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

/* Footer - Complex Grid */
footer {
    background: #1e293b;
    /* Dark Footer like reference */
    color: #cbd5e1;
    padding: 4rem 0 2rem;
    font-size: 0.95rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: #cbd5e1;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.app-badges {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.app-badge img {
    height: 40px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
}

.app-badge img:hover {
    border-color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
}

.social-icons a {
    color: white;
    font-size: 1.5rem;
    opacity: 0.7;
    transition: all 0.2s;
}

.social-icons a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    gap: 0.6rem;
    font-size: 1rem;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, hsl(260, 90%, 55%) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
    background: white;
    cursor: pointer;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    z-index: 0;
    opacity: 0.5;
}

.card>* {
    position: relative;
    z-index: 1;
}

/* Clean Modern Card Hover */
.card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-5px);
    border-color: transparent;
}

/* Card Icon - Square Box Style */
.card-icon {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    color: white;
    /* Icon text color */
    margin-bottom: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    /* Default fallback color */
    background: #f43f5e;
}

/* Specific Category Colors */
/* Merge, Split, Delete - Red */
.card:nth-child(1) .card-icon,
.card:nth-child(2) .card-icon {
    background: #e11d48;
}

/* Compress - Green */
.card:nth-child(3) .card-icon {
    background: #10b981;
}

/* Converts - Blue/Indigo */
.card:nth-child(4) .card-icon,
.card:nth-child(5) .card-icon {
    background: #3b82f6;
}

/* Edits/Security - Purple/Orange */
.card:nth-child(6) .card-icon,
.card:nth-child(7) .card-icon,
.card:nth-child(8) .card-icon {
    background: #8b5cf6;
}

.card:hover .card-icon {
    transform: scale(1.1);
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.card p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
    flex: 1;
}

.card:hover h3 {
    color: #1e293b;
    /* Keep dark on hover for clean look */
}

.card:hover p {
    color: #64748b;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
        --container-max-width: 100%;
    }

    .container {
        padding: 0 1.25rem;
    }

    /* Navbar */
    .navbar {
        padding: 0.5rem 0;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: none;
        gap: 0;
        z-index: 999;
    }

    .nav-menu.active {
        transform: translateX(0);
        box-shadow: inset 0 10px 20px -10px rgba(0, 0, 0, 0.05);
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
        margin: 0;
    }

    .nav-link {
        padding: 1.25rem 0;
        font-size: 1.1rem;
        justify-content: space-between;
        width: 100%;
    }

    /* Mobile Dropdowns */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background: #f8fafc;
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
    }

    .nav-item.active .dropdown-menu {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    .dropdown-item {
        padding: 1rem;
        padding-left: 1.5rem;
        font-size: 1rem;
    }

    /* Hamburger Menu */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        cursor: pointer;
        z-index: 1001;
        margin-left: auto;
    }

    .hamburger span {
        display: block;
        height: 2px;
        width: 100%;
        background: var(--text-primary);
        border-radius: 2px;
        transition: all 0.3s;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Hero Section */
    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1.1rem;
    }

    /* Tools Grid */
    .tools-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        padding-bottom: 4rem;
    }

    .card {
        padding: 1.5rem;
    }

    /* Filters - Scrollable */
    .filter-container {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
        margin: 0 -1.25rem 2rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
    }

    .filter-container::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .filter-btn {
        flex-shrink: 0;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .logo,
    .footer-bottom {
        justify-content: center;
    }

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

    .social-icons {
        margin: 1.5rem 0;
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

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