/* --- Reset & Global Styles --- */
:root {
    --primary-color: #8A2BE2;
    /* Blue Violet */
    --secondary-color: #FF007F;
    /* Rose */
    --tertiary-color: #00F2FE;
    /* Cyan */
    --bg-color: #F5F7FA;
    --card-bg-color: rgba(255, 255, 255, 0.85);
    --text-color: #1A1A1A;
    --text-color-dark: #626C7A;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.06);
    --success-color: #28a745;
    --error-color: #e14a56;

    /* Theme adaptive variables */
    --header-bg-color: rgba(255, 255, 255, 0.7);
    --mobile-nav-bg: rgba(255, 255, 255, 0.98);
    --nav-link-mobile-bg: rgba(0, 0, 0, 0.03);
    --input-bg-color: rgba(0, 0, 0, 0.03);
    --footer-bg-color: rgba(0, 0, 0, 0.02);

    --ad-bg-color: rgba(0, 0, 0, 0.02);
    --ad-border-color: rgba(0, 0, 0, 0.08);
    --ad-text-color: rgba(0, 0, 0, 0.3);

    --menu-toggle-bg: rgba(0, 0, 0, 0.04);
    --menu-toggle-border: rgba(0, 0, 0, 0.08);
    --menu-toggle-hover-bg: rgba(0, 0, 0, 0.08);

    --btn-download-muted-bg: #e2e8f0;
    --btn-download-muted-text: #4a5568;
}

[data-theme="dark"] {
    --bg-color: #0D0D0D;
    --card-bg-color: rgba(30, 30, 30, 0.6);
    --text-color: #F5F5F5;
    --text-color-dark: #A0A0A0;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.5);

    --header-bg-color: rgba(18, 18, 18, 0.5);
    --mobile-nav-bg: rgba(13, 14, 18, 0.95);
    --nav-link-mobile-bg: rgba(255, 255, 255, 0.02);
    --input-bg-color: rgba(0, 0, 0, 0.3);
    --footer-bg-color: rgba(18, 18, 18, 0.4);

    --ad-bg-color: rgba(255, 255, 255, 0.02);
    --ad-border-color: rgba(255, 255, 255, 0.15);
    --ad-text-color: rgba(255, 255, 255, 0.2);

    --menu-toggle-bg: rgba(255, 255, 255, 0.05);
    --menu-toggle-border: rgba(255, 255, 255, 0.1);
    --menu-toggle-hover-bg: rgba(255, 255, 255, 0.1);

    --btn-download-muted-bg: #555;
    --btn-download-muted-text: #fff;
}

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

html, body {
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
}

/* --- Aurora Background Effect --- */
.aurora-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.aurora-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
}

[data-theme="dark"] .aurora-shape {
    filter: blur(120px);
    opacity: 0.4;
}

.shape1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    left: -100px;
    animation: move1 20s infinite alternate;
}

.shape2 {
    width: 500px;
    height: 500px;
    background: var(--secondary-color);
    bottom: -150px;
    right: -150px;
    animation: move2 25s infinite alternate;
}

.shape3 {
    width: 300px;
    height: 300px;
    background: var(--tertiary-color);
    bottom: 50%;
    right: 50%;
    transform: translate(50%, 50%);
    animation: move3 18s infinite alternate;
}

@keyframes move1 {
    from {
        transform: translate(0, 0) rotate(0deg);
    }

    to {
        transform: translate(200px, 100px) rotate(90deg);
    }
}

@keyframes move2 {
    from {
        transform: translate(0, 0) rotate(0deg);
    }

    to {
        transform: translate(-200px, -100px) rotate(180deg);
    }
}

@keyframes move3 {
    from {
        transform: translate(0, 0) rotate(0deg);
    }

    to {
        transform: translate(100px, -200px) rotate(-90deg);
    }
}

/* --- Header --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    background: var(--header-bg-color);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background: var(--menu-toggle-bg);
    border: 1px solid var(--menu-toggle-border);
    color: var(--text-color);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    background: var(--menu-toggle-hover-bg);
    color: var(--primary-color);
    transform: rotate(15deg) scale(1.05);
}

[data-theme="dark"] .theme-toggle:hover {
    color: var(--tertiary-color);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.logo-link {
    color: var(--text-color);
    text-decoration: none;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* --- Menu Toggle Button (hidden by default) --- */
.menu-toggle {
    display: none;
    background: var(--menu-toggle-bg);
    border: 1px solid var(--menu-toggle-border);
    color: var(--text-color);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: var(--menu-toggle-hover-bg);
    color: var(--primary-color);
    transform: scale(1.05);
}

[data-theme="dark"] .menu-toggle:hover {
    color: var(--tertiary-color);
}

.menu-toggle:active {
    transform: scale(0.95);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    background-color: var(--card-bg-color);
    color: var(--tertiary-color);
}

.faq-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.faq-link:hover {
    background-color: var(--card-bg-color);
}

/* --- Main Container & Content --- */
.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 150px);
    min-height: calc(100dvh - 150px);
    padding: 4rem 2rem;
}

.content-wrapper {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
    box-sizing: border-box;
}

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

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

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-color-dark);
    margin-bottom: 2rem;
}

/* --- Category Buttons --- */
.category-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.category-tab-link {
    text-decoration: none;
    display: inline-block;
}

.category-buttons button {
    background: transparent;
    color: var(--text-color-dark);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-buttons button:hover {
    background-color: var(--card-bg-color);
    color: var(--text-color);
}

.category-buttons button.active {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

/* --- Form & Input --- */
#downloadForm {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color-dark);
}

#url-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 3rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(138, 43, 226, 0.3);
}

#paste-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-color-dark);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

#paste-btn:hover {
    color: var(--text-color);
}

/* --- Download Button --- */
.download-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.7rem;
    position: relative;
    overflow: hidden;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(138, 43, 226, 0.5);
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.download-btn:disabled {
    cursor: not-allowed;
    background: var(--btn-download-muted-bg);
    color: var(--btn-download-muted-text);
    box-shadow: none;
    transform: none;
}

/* Loading Spinner on Button */
.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    /* Hidden by default */
    animation: spin 1s linear infinite;
}

.download-btn.loading .btn-text {
    display: none;
}

.download-btn.loading .btn-loader {
    display: block;
}

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


/* --- Result Container --- */
.result-container {
    margin-top: 2rem;
    min-height: 80px;
    animation: resultFadeIn 0.5s ease;
}

@keyframes resultFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.result-container p {
    font-weight: 500;
    margin-bottom: 1rem;
}

.btn-download {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    background-color: var(--success-color);
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background-color: #218838;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.preview-wrapper {
    margin: 1.5rem auto;
    max-width: 100%;
    width: 320px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px var(--shadow-color);
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-media {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-color-dark);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    background: var(--footer-bg-color);
    margin-top: 4rem;
    width: 100%;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.footer-links a {
    color: var(--text-color-dark);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

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

.footer-disclaimer {
    font-size: 0.8rem;
    color: var(--text-color-dark);
    opacity: 0.7;
    margin-top: 0.5rem;
    margin-bottom: 0.8rem;
}

/* --- Wide Wrapper & Info Page Styles --- */
.content-wrapper.wide {
    max-width: 850px;
    text-align: left;
}

.info-title {
    text-align: left;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

.info-subtitle {
    text-align: left;
    margin-bottom: 2rem;
}

.info-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.info-content h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.info-content p {
    margin-bottom: 1.2rem;
    color: var(--text-color-dark);
    font-size: 0.95rem;
    line-height: 1.7;
}

.info-content ul, .info-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-color-dark);
}

.info-content li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* --- AdSense Ad Container --- */
.adsense-ad-container {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--ad-bg-color);
    border: 1px dashed var(--ad-border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
    position: relative;
    overflow: hidden;
}


/* --- Responsive Design --- */
@media (max-width: 640px) {
    .main-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .content-wrapper {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .category-buttons button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    /* Info Page Specifics */
    .info-title {
        font-size: 1.6rem !important;
        margin-bottom: 1rem !important;
    }

    .info-subtitle {
        font-size: 0.85rem !important;
        margin-bottom: 1.5rem !important;
    }

    .info-content h2 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
    }

    .info-content h3 {
        font-size: 1.05rem;
    }

    .info-content p, .info-content li {
        font-size: 0.88rem;
    }

    .adsense-ad-container {
        margin: 1.5rem 0;
        padding: 0.5rem;
        min-height: 75px;
    }

    .footer-links {
        gap: 0.8rem;
        font-size: 0.8rem;
    }

    .menu-toggle {
        display: flex;
    }

    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 5%;
    }

    .logo {
        font-size: 1.15rem;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--mobile-nav-bg);
        -webkit-backdrop-filter: blur(25px);
        backdrop-filter: blur(25px);
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem 5%;
        gap: 12px;
        z-index: 99;
        box-shadow: 0 15px 30px var(--shadow-color);
        transform-origin: top center;
        animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
        border-radius: 8px;
        background: var(--nav-link-mobile-bg);
        border: 1px solid var(--border-color);
        justify-content: flex-start;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: scaleY(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scaleY(1) translateY(0);
    }
}

@media (max-width: 400px) {
    .main-title {
        font-size: 1.6rem;
    }

    .content-wrapper {
        padding: 1.2rem 1rem;
    }

    .category-buttons {
        gap: 6px;
    }

    .category-buttons button {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .nav-menu {
        padding: 1.2rem 5%;
        gap: 10px;
    }

    .nav-link {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    .logo {
        font-size: 1.05rem;
    }
}

/* --- Landing Page / Tools Directory Styles --- */
.hero-section {
    text-align: center;
    padding: 3.5rem 1.5rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--tertiary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.25;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-color-dark);
    margin-bottom: 2.5rem;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 550px;
    margin: 0 auto 2.5rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    color: var(--text-color-dark);
    font-size: 1.1rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--card-bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 4px 25px rgba(138, 43, 226, 0.2);
}

.search-clear-btn {
    position: absolute;
    right: 1.2rem;
    background: none;
    border: none;
    color: var(--text-color-dark);
    cursor: pointer;
    font-size: 1rem;
    display: none;
}

/* Category Filter Tabs */
.tabs-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 3rem;
}

.tab-btn {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color-dark);
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.tab-btn:hover {
    color: var(--text-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

/* Tools Section Layout */
.tools-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
}

.tools-group-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1.2rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

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

/* Tool Card */
.tool-card {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 10px var(--shadow-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-color);
    border-color: rgba(138, 43, 226, 0.3);
}

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

.tool-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.tool-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}

/* Gradients for tool icons by category */
.cat-downloader .tool-icon-wrapper {
    background: linear-gradient(135deg, #FF007F, #8A2BE2);
}
.cat-video .tool-icon-wrapper {
    background: linear-gradient(135deg, #8A2BE2, #00F2FE);
}
.cat-audio .tool-icon-wrapper {
    background: linear-gradient(135deg, #00F2FE, #4facfe);
}
.cat-pdf .tool-icon-wrapper {
    background: linear-gradient(135deg, #FF0844, #FFB199);
}
.cat-converter .tool-icon-wrapper {
    background: linear-gradient(135deg, #F12711, #F5AF19);
}

.tool-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}

.tool-badge.active {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.tool-badge.soon {
    background: rgba(138, 43, 226, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(138, 43, 226, 0.15);
}

[data-theme="dark"] .tool-badge.soon {
    background: rgba(0, 242, 254, 0.1);
    color: var(--tertiary-color);
    border: 1px solid rgba(0, 242, 254, 0.15);
}

.tool-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.tool-desc {
    font-size: 0.85rem;
    color: var(--text-color-dark);
    line-height: 1.4;
    flex-grow: 1;
}

/* Animations for filter */
.fade-in {
    animation: fadeIn 0.3s forwards ease-in-out;
}

.fade-out {
    animation: fadeOut 0.2s forwards ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: var(--text-color-dark);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--text-color);
}

.modal-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.modal-text {
    font-size: 0.95rem;
    color: var(--text-color-dark);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.modal-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    padding: 0.7rem 2rem;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
}

/* Responsiveness adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    .hero-section {
        padding: 2rem 1rem 1rem;
    }
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* --- Search Suggestions Dropdown & Preview --- */
.search-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 32px);
    max-width: 780px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 15px 40px var(--shadow-color);
    z-index: 1000;
    display: none;
    overflow: hidden;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

[data-theme="dark"] .search-suggestions-dropdown {
    background: rgba(20, 20, 20, 0.95);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.suggestions-wrapper {
    display: flex;
    flex-direction: row;
    height: 420px;
}

@media (max-width: 680px) {
    .suggestions-wrapper {
        flex-direction: column;
        height: auto;
        max-height: 480px;
    }
    
    .suggestions-list {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
        max-height: 200px;
    }

    .suggestion-preview {
        height: 240px;
    }
}

/* Left Pane: Suggestions List */
.suggestions-list {
    flex: 1;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suggestions-list::-webkit-scrollbar {
    width: 6px;
}
.suggestions-list::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
}

.suggestion-item:hover, .suggestion-item.active {
    background: rgba(138, 43, 226, 0.08);
    border-color: rgba(138, 43, 226, 0.15);
}

[data-theme="dark"] .suggestion-item:hover, 
[data-theme="dark"] .suggestion-item.active {
    background: rgba(138, 43, 226, 0.15);
    border-color: rgba(138, 43, 226, 0.25);
}

.suggestion-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(255, 0, 127, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.suggestion-item.active .suggestion-item-icon {
    transform: scale(1.1);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
}

.suggestion-item-info {
    flex: 1;
    min-width: 0;
}

.suggestion-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-item-category {
    font-size: 0.75rem;
    color: var(--text-color-dark);
    text-transform: capitalize;
}

.suggestion-item-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 500;
}
.suggestion-item-badge.active {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}
.suggestion-item-badge.soon {
    background: rgba(255, 193, 7, 0.1);
    color: #d39e00;
}
[data-theme="dark"] .suggestion-item-badge.soon {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

/* Right Pane: Suggestions Preview */
.suggestion-preview {
    flex: 1.2;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    min-width: 0;
}

[data-theme="dark"] .suggestion-preview {
    background: rgba(255, 255, 255, 0.02);
}

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex-grow: 1;
    justify-content: flex-start;
}

.preview-category-tag {
    align-self: flex-start;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--secondary-color);
}

.preview-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.preview-desc {
    font-size: 0.9rem;
    color: var(--text-color-dark);
    line-height: 1.4;
}

/* Mockup / Visual Previews */
.preview-visual-box {
    height: 140px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 1px dashed var(--border-color);
    margin: 0.5rem 0;
}

[data-theme="dark"] .preview-visual-box {
    background: rgba(255, 255, 255, 0.04);
}

.preview-action-btn {
    align-self: stretch;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.2);
}

.preview-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.35);
}

.preview-action-btn.soon-btn {
    background: var(--btn-download-muted-bg);
    color: var(--btn-download-muted-text);
    box-shadow: none;
}

.preview-action-btn.soon-btn:hover {
    transform: none;
    box-shadow: none;
}

/* Specific Interactive Visual Mockups */

/* Screen Recorder Mockup */
.mockup-screen {
    width: 90%;
    height: 90%;
    background: #1a1a24;
    border-radius: 8px;
    border: 2px solid #3a3a4a;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.mockup-screen-bar {
    height: 16px;
    background: #2a2a3a;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 4px;
}
.mockup-screen-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #555;
}
.mockup-screen-dot.red { background: #ff5f56; }
.mockup-screen-dot.yellow { background: #ffbd2e; }
.mockup-screen-dot.green { background: #27c93f; }

.mockup-screen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #fff;
}

.mockup-screen-rec {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 95, 86, 0.2);
    border: 1px solid #ff5f56;
    color: #ff5f56;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: pulse 1.5s infinite alternate;
}

.mockup-screen-rec::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff5f56;
}

.mockup-screen-timer {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 1px;
    margin-bottom: 6px;
    color: #00F2FE;
    text-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
}

.mockup-screen-radar {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(138, 43, 226, 0.4);
    border-radius: 50%;
    animation: radar-expand 2s infinite linear;
}

.mockup-screen-icon {
    font-size: 1.8rem;
    color: #fff;
    z-index: 2;
    animation: float 3s infinite ease-in-out;
}

/* Instagram/Downloader Mockup */
.mockup-phone {
    width: 80px;
    height: 120px;
    background: #111;
    border: 2px solid #333;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.mockup-phone-notch {
    width: 30px;
    height: 6px;
    background: #333;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    align-self: center;
}

.mockup-phone-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 8px;
    position: relative;
}

.mockup-phone-brand {
    font-size: 1.6rem;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.mockup-phone-dl {
    width: 24px;
    height: 24px;
    background: #00F2FE;
    color: #111;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    animation: bounce-dl 1s infinite alternate;
}

/* Video Editor Mockup */
.mockup-timeline {
    width: 90%;
    height: 80%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mockup-timeline-track {
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .mockup-timeline-track {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.mockup-timeline-block {
    position: absolute;
    top: 2px;
    height: 18px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0.8;
}

.mockup-timeline-block.b1 { left: 10px; width: 60px; }
.mockup-timeline-block.b2 { left: 80px; width: 100px; background: linear-gradient(90deg, var(--secondary-color), var(--tertiary-color)); }
.mockup-timeline-block.b3 { left: 190px; width: 40px; }

.mockup-timeline-audio {
    height: 20px;
    background: rgba(0, 242, 254, 0.05);
    border: 1px solid rgba(0, 242, 254, 0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    gap: 2px;
}

.mockup-timeline-bar {
    width: 3px;
    border-radius: 2px;
    background: #00F2FE;
    animation: audio-bar 0.8s infinite alternate ease-in-out;
}

.mockup-timeline-bar:nth-child(even) {
    animation-delay: 0.15s;
}
.mockup-timeline-bar:nth-child(3n) {
    animation-delay: 0.3s;
}

.mockup-timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ff007f;
    z-index: 10;
    box-shadow: 0 0 6px #ff007f;
    animation: playhead-move 4s infinite linear;
}

/* PDF Convert Mockup */
.mockup-pdf-box {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mockup-doc {
    width: 44px;
    height: 56px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.mockup-doc.pdf {
    color: #e14a56;
}
.mockup-doc.pdf::after {
    content: 'PDF';
    position: absolute;
    bottom: 4px;
    font-size: 0.55rem;
    font-weight: 800;
    color: #e14a56;
}

.mockup-doc.word {
    color: #007bff;
    animation: doc-flip 3s infinite ease-in-out;
}
.mockup-doc.word::after {
    content: 'DOC';
    position: absolute;
    bottom: 4px;
    font-size: 0.55rem;
    font-weight: 800;
    color: #007bff;
}

.mockup-arrow {
    font-size: 1.2rem;
    color: var(--primary-color);
    animation: arrow-slide 1.5s infinite ease-in-out;
}

/* Generic Fallback Orbit Mockup */
.mockup-orbit {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mockup-orbit-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px dashed var(--primary-color);
    border-radius: 50%;
    animation: rotate 10s infinite linear;
}

.mockup-orbit-center {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

.mockup-orbit-planet {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--tertiary-color);
    border-radius: 50%;
    top: 50%;
    left: -5px;
    margin-top: -5px;
}

/* Keyframes */
@keyframes pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

@keyframes radar-expand {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes bounce-dl {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

@keyframes audio-bar {
    0% { height: 4px; }
    100% { height: 16px; }
}

@keyframes playhead-move {
    0% { left: 0%; }
    100% { left: 100%; }
}

@keyframes arrow-slide {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}

@keyframes doc-flip {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(5deg); }
}

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

/* Empty State / Not Found State */
.suggestions-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-color-dark);
    gap: 10px;
    width: 100%;
}

.suggestions-empty i {
    font-size: 2.5rem;
    color: var(--border-color);
}

.suggestions-empty p {
    font-weight: 500;
    font-size: 0.95rem;
}

/* --- Android and iOS Safari Mobile Specific Fixes --- */
a, button, [role="button"], input, select, textarea, .tool-card, .tab-btn, .theme-toggle, .menu-toggle, .suggestion-item {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS browser auto-zoom when inputs/textareas are focused, and ensure good visibility */
/* Prevent iOS browser auto-zoom when inputs/textareas are focused, and ensure good visibility */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="number"],
    input[type="search"],
    input[type="email"],
    input[type="password"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Prevent flex containers and main wrapper from stretching the viewport */
    main {
        max-width: 100% !important;
        overflow-x: hidden !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .hero-section,
    .tools-section,
    .tools-group,
    .container,
    .content-wrapper,
    .search-container {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Horizontal scroll for Category Filter Tabs on mobile devices */
    .tabs-container, .category-buttons {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0.5rem 1rem !important;
        margin-bottom: 1.5rem !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important; /* Firefox */
        gap: 8px !important;
        box-sizing: border-box !important;
    }
    
    .tabs-container::-webkit-scrollbar, 
    .category-buttons::-webkit-scrollbar {
        display: none !important; /* Safari, Chrome, Opera */
    }
    
    .tab-btn, .category-tab-link, .category-buttons button {
        flex-shrink: 0 !important;
    }

    /* Keep search suggestions aligned within the mobile search box width */
    .search-suggestions-dropdown {
        width: 100% !important;
        left: 0 !important;
        transform: none !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Adjust main padding for safety boundaries on notched mobile screens */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Edge-to-edge scroll for tools on mobile */
    .tools-section {
        padding: 0 !important;
    }

    .tools-group {
        margin-bottom: 2rem !important;
        width: 100% !important;
        overflow: hidden;
    }

    .tools-group-title {
        font-size: 1.2rem !important;
        margin: 1.5rem 1.5rem 0.6rem !important;
        padding-bottom: 0.3rem !important;
        border-bottom-width: 1px !important;
    }

    .tools-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0.5rem 1.5rem 1.5rem !important;
        margin-bottom: 0.5rem !important;
        gap: 16px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important; /* Firefox */
        scroll-snap-type: x mandatory;
        box-sizing: border-box !important;
    }
    
    .tools-grid::-webkit-scrollbar {
        display: none !important; /* Chrome, Safari, Opera */
    }

    .tool-card {
        flex: 0 0 250px !important; /* Fixed width so cards scroll side-by-side */
        scroll-snap-align: start !important;
        margin: 0 !important;
    }
}


