* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    color: #1a1a2e;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.header.with-search {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
}

.header-search {
    max-width: 400px;
    margin-left: 2rem;
    position: relative;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.header-search.show {
    opacity: 1;
    transform: translateY(0);
}

.header-search .search-bar {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #2d3748;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.header-search .search-bar:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    background: white;
}

.header-search .search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1rem;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
}

.logo {
    width: 200px;
    height: 40px;
    object-fit: contain;
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #667eea;
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
    position: relative;
    padding: 2rem 0;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    letter-spacing: -2px;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto 2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    line-height: 1.6;
}

/* Enhanced Search Bar */
.search-container.enhanced-search {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}

.enhanced-search .search-bar {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #2d3748;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.enhanced-search .search-bar:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 8px 35px rgba(102, 126, 234, 0.3);
    background: white;
}

.enhanced-search .search-bar::placeholder {
    color: #a0aec0;
    font-weight: 500;
}

.enhanced-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.2rem;
    z-index: 2;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

/* Search Bar */
.search-container {
    max-width: 500px;
    margin: 0 auto 3rem;
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #2d3748;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.search-bar:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 8px 35px rgba(102, 126, 234, 0.3);
    background: white;
}

.search-bar::placeholder {
    color: #a0aec0;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.2rem;
}

/* Category Sections */
.category-section {
    margin-bottom: 4rem;
}

.category-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 0 3px 15px rgba(0,0,0,0.4);
    letter-spacing: -1px;
}

.category-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin: 0.5rem auto 2rem auto;
    max-width: 600px;
    font-weight: 400;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: block;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Lazy Loading for Cards */
.card,
a.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card:nth-child(odd) {
    animation-delay: 0.1s;
}

.card:nth-child(even) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    background: white;
    border-color: rgba(102, 126, 234, 0.3);
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.card:hover .card-title {
    color: #667eea;
}

.card:hover .card-units {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    transition: all 0.3s ease;
}

.card-description {
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.card-units {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

/* Icon Colors */
.icon-measurement { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.icon-calculator { background: linear-gradient(135deg, #48bb78 0%, #38a169 100%); }
.icon-converter { background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%); }
.icon-math { background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%); }
.icon-automotive { background: linear-gradient(135deg, #38b2ac 0%, #319795 100%); }
.icon-financial { background: linear-gradient(135deg, #ecc94b 0%, #d69e2e 100%); }
.icon-generator { background: linear-gradient(135deg, #f093fb 0%, #f68084 100%); }
.icon-tool { background: linear-gradient(135deg, #4fd1c7 0%, #06b6d4 100%); }
.icon-validator { background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%); }

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .enhanced-search .search-bar {
        font-size: 1rem;
        padding: 0.8rem 1rem 0.8rem 2.5rem;
    }
    
    .enhanced-search .search-icon {
        font-size: 1.1rem;
        left: 0.8rem;
    }
    
    .category-title {
        font-size: 1.6rem;
    }
    
    .category-description {
        padding: 0 1rem;
        font-size: 0.9rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 4rem;
    padding: 2rem 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #3b82bd;
}

.footer-copyright {
    color: #718096;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .container {
        padding: 1rem;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    .logo {
        width: 150px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .search-bar {
        font-size: 1rem;
        padding: 0.8rem 1rem 0.8rem 2.5rem;
    }

    .card {
        padding: 1rem;
    }

    .card-header {
        gap: 0.75rem;
    }

    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .logo {
        width: 120px;
        height: 36px;
    }
}

/* Footer Font Fix - Ensure all pages use Plus Jakarta Sans in footer */
.footer, .footer *, .footer h3, .footer p, .footer li, .footer a {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Category Page Styles - Only for category pages */
.category-page .page-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    margin: 2rem 0;
    padding: 3rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.category-page .page-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-page .page-description {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.category-page .breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #888;
}

.category-page .breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-page .breadcrumb a:hover {
    color: #764ba2;
}

.category-page .breadcrumb-separator {
    color: #ccc;
}

.category-page .breadcrumb-current {
    color: #333;
    font-weight: 500;
}

.category-page .tools-section {
    margin: 2rem 0;
}

.category-page .seo-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    margin: 3rem 0;
    padding: 3rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.category-page .content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.category-page .seo-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #333;
}

.category-page .seo-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: #444;
}

.category-page .seo-content p {
    margin-bottom: 1.5rem;
    color: #666;
    line-height: 1.8;
}

.category-page .seo-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.category-page .seo-content li {
    margin-bottom: 0.5rem;
    color: #666;
    line-height: 1.6;
}

/* Responsive Design for Category Pages */
@media (max-width: 768px) {
    .category-page .page-header {
        margin: 1rem 0;
        padding: 2rem 1rem;
    }
    
    .category-page .page-title {
        font-size: 2rem;
    }
    
    .category-page .page-description {
        font-size: 1rem;
    }
    
    .category-page .seo-content {
        margin: 2rem 0;
        padding: 2rem 1rem;
    }
    
    .category-page .breadcrumb {
        flex-wrap: wrap;
    }
}
