:root {
    --bg-color: #0b0c10;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #8c92a6;
    --accent-glow: rgba(114, 137, 218, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Background Animated Orbs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #5b21b6 0%, #0b0c10 70%);
    top: -20%;
    left: -10%;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #0ea5e9 0%, #0b0c10 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: rgba(11, 12, 16, 0.5);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo .dot {
    color: #0ea5e9;
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

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

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.3);
    color: white;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    margin-top: 40px;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(to right, #38bdf8, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.hero-btn {
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
}

/* Tools Grid */
.tools-grid-container {
    padding: 4rem 4rem 8rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tools-grid-container h2 {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
}

.category-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 2.5rem 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
}

.category-heading:first-of-type {
    margin-top: 0;
}

/* Search Bar */
.tools-search-wrap {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2.5rem;
}
.tools-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}
.tools-search {
    width: 100%;
    padding: 0.85rem 3rem 0.85rem 2.8rem;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(8px);
}
.tools-search::placeholder {
    color: var(--text-secondary);
}
.tools-search:focus {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}
.tools-search-count {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Favorite Star */
.fav-star {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 5;
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.2s;
    line-height: 1;
    padding: 0.2rem;
}
.fav-star:hover {
    opacity: 0.7;
    transform: scale(1.2);
}
.fav-star.active {
    opacity: 1;
    animation: favPop 0.3s ease;
}
@keyframes favPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* No results */
.tools-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    display: none;
}

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

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

/* Mouse hover gradient effect */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1;
}

.tool-card:hover::before {
    opacity: 1;
}

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

.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
}

.icon-wrapper svg {
    color: white;
}

.bg-gradient-purple { background: linear-gradient(135deg, #818cf8, #c084fc); }
.bg-gradient-blue { background: linear-gradient(135deg, #0ea5e9, #3b82f6); }
.bg-gradient-pink { background: linear-gradient(135deg, #f472b6, #fb7185); }
.bg-gradient-green { background: linear-gradient(135deg, #34d399, #10b981); }
.bg-gradient-orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.bg-gradient-cyan { background: linear-gradient(135deg, #22d3ee, #06b6d4); }
.bg-gradient-yellow { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.bg-gradient-red { background: linear-gradient(135deg, #f87171, #ef4444); }
.bg-gradient-teal { background: linear-gradient(135deg, #2dd4bf, #14b8a6); }
.bg-gradient-rainbow { background: linear-gradient(135deg, #f472b6, #fb923c, #fbbf24); }
.bg-gradient-indigo { background: linear-gradient(135deg, #818cf8, #6366f1); }

.tool-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

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

.badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 3;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--card-border);
}

/* Mobile Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    z-index: 101;
}
.hamburger span {
    width: 25px;
    height: 2px;
    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(5px, -5px);
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(11, 12, 16, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transition: right 0.3s ease;
        border-left: 1px solid var(--card-border);
        z-index: 100;
    }
    
    nav.open {
        right: 0;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 0.5rem 0;
    }
    
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.1rem; }
    .navbar { padding: 1.5rem 2rem; }
    .tools-grid { grid-template-columns: 1fr; }
    .tools-grid-container { padding: 2rem 1.5rem 4rem; }
    .tools-grid-container h2 { font-size: 2rem; }
    .tool-page-main { padding: 80px 1rem 2rem; }
    .tool-workspace { padding: 1.5rem; }
}

/* Language Switcher */
.lang-switcher {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
}
.lang-switcher:hover {
    background: rgba(255, 255, 255, 0.1);
}
.lang-switcher option {
    background: var(--bg-color);
    color: var(--text-primary);
}

/* Ad Container */
.ad-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}
.ad-container:empty {
    display: none;
}

/* --- Tool Pages Specific Styles --- */
.tool-page-main {
    padding: 100px 2rem 4rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.tool-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.tool-workspace {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 3rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
}

.dropzone:hover, .dropzone.dragover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.dropzone svg {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    width: 64px;
    height: 64px;
    pointer-events: none;
}

.drop-text, .drop-subtext {
    pointer-events: none;
}

.drop-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.drop-subtext {
    color: var(--text-secondary);
}

.tool-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.preview-container {
    margin-top: 2rem;
    display: none;
    flex-direction: column;
    align-items: center;
}

.preview-container img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.loader {
    display: none;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #6366f1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-text {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 1rem;
}
