@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;600;700&display=swap');

:root {
    --primary: #4361ee;
    --primary-dark: #1a237e;
    --primary-light: #eef2ff;
    --secondary: #3f37c9;
    --accent: #4cc9f0;
    --success: #38b000;
    --error: #ef233c;
    --text-main: #2b2d42;
    --text-muted: #8d99ae;
    --bg-main: #f8faff;
    --bg-card: #ffffff;
    --bg-light: #ffffff;
    --border-color: #e2e8f0;
    
    /* Effects */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(67, 97, 238, 0.08);
    --shadow-lg: 0 10px 25px rgba(67, 97, 238, 0.12);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    /* Layout */
    --max-width: 1200px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--primary-dark);
}

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

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

.header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    padding: 0.3rem 0;
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

.logo-img {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.logo span span {
    color: var(--primary-dark);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

@media (max-width: 991px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-color);
    }

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

    .nav-toggle {
        display: block;
    }

    .header-search-container {
        margin: 0 1rem;
    }
}

/* --- Search System --- */
.header-search-container {
    flex: 1;
    max-width: 450px;
    margin: 0 1.5rem;
    position: relative;
}

#nova-search-wrapper {
    position: relative;
    width: 100%;
}

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

#nova-search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.8rem;
    border-radius: 50px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.03);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    color: var(--text-main);
}

#nova-search-input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
    outline: none;
}

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

#nova-search-clear {
    position: absolute;
    right: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    transition: color 0.2s;
}

#nova-search-clear:hover {
    color: var(--error);
}

#nova-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    max-height: 450px;
    overflow-y: auto;
    display: none;
    animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0,0,0,0.05);
}

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

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(0,0,0,0.02);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover, .search-active {
    background: var(--bg-light);
}

.search-result-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.search-result-item:hover .search-result-icon {
    background: var(--primary);
    color: white;
}

.search-result-info {
    flex: 1;
    overflow: hidden;
}

.search-result-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.search-result-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-highlight {
    color: var(--primary);
    font-weight: 700;
    background: rgba(67, 97, 238, 0.05);
    padding: 0 1px;
}

.category-filters {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.filter-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(41, 121, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(41, 121, 255, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

/* --- Hero Section --- */
.hero {
    padding: 6rem 0 4rem;
    text-align: center;
    background: radial-gradient(circle at top right, #e3f2fd, transparent 40%),
                radial-gradient(circle at bottom left, #f3e5f5, transparent 40%);
}

.free-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: white;
    color: var(--primary);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.free-badge i {
    color: #ffd700; /* Gold for the certificate icon */
    font-size: 1rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

/* --- Tool Cards --- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    padding-bottom: 4rem;
}

.tool-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.tool-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 2rem;
    transition: all 0.3s ease;
}

.tool-card:hover .tool-icon {
    background: var(--primary);
    color: white;
    transform: rotate(10deg);
}

.tool-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

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

/* --- Upload Zone --- */
.upload-area {
    background: var(--bg-card);
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 2rem 0;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* --- Footer --- */
.footer {
    background: var(--primary-dark);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

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

.footer h4 {
    color: white;
    margin-bottom: 1.5rem;
}

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

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

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 3rem; }

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

@media (max-width: 768px) {
    .responsive-grid {
        gap: 2rem;
    }
}

@media (max-width: 1024px) {
    .tool-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nav-links { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero h1 { font-size: 2.5rem; }
}

@media (max-width: 480px) {
    .tool-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .tool-card {
        padding: 1.25rem 0.25rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 120px;
    }
    .tool-card i {
        font-size: 1.2rem !important;
        width: 35px !important;
        height: 35px !important;
        margin-bottom: 0.5rem;
    }
    .tool-card h4 {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    .tool-card p {
        display: none !important;
    }
    #featured-grid .tool-card:nth-child(n+10) {
        display: none !important;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    .logo {
        justify-content: center;
    }
}

.dev-link {
    background: linear-gradient(135deg, #ffbe0b, #fb5607);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.dev-link:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}


/* --- Ad System --- */
.ad-slot {
    background: #f8f9fa;
    border: 2px dashed #e9ecef;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    margin: 2.5rem auto;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-height: 90px;
    width: 100%;
    max-width: var(--max-width);
    position: relative;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.ad-slot::after {
    content: 'AD SPACE';
}

.ad-slot::before {
    content: 'Advertisement';
    position: absolute;
    top: -1.25rem;
    left: 0;
    font-size: 0.65rem;
    color: #ced4da;
    font-weight: 500;
}

.ad-slot[data-ad-type="banner"] {
    min-height: 90px;
}

.ad-slot[data-ad-type="rectangle"] {
    width: 336px;
    height: 280px;
    max-width: 100%;
}

.ad-slot[data-ad-type="large-rectangle"] {
    min-height: 280px;
}

.ad-slot[data-ad-type="in-tool"] {
    margin: 1.5rem auto;
    background: #ffffff;
    border-color: #f1f3f5;
}

.ad-slot[data-ad-type="sticky-mobile"] {
    display: none;
}

@media (max-width: 480px) {
    .ad-slot[data-ad-type="sticky-mobile"] {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        min-height: 60px;
        z-index: 10000;
        margin: 0;
        background: white;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.08);
        border: none;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
    }
    
    .ad-slot[data-ad-type="sticky-mobile"]::before {
        top: 2px;
        left: 5px;
    }
}
