* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    font-size: 15px;
}

.nav-menu a:hover {
    color: #667eea;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* AdSense Ad Container */
.ad-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide ad container if no ads loaded */
.ad-container:has(.adsbygoogle[data-ad-status="unfilled"]) {
    display: none;
}

.ad-container.top-banner {
    margin-bottom: 30px;
}

.ad-container.mid-content {
    margin: 40px 0;
}

/* Category Section */
.category-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.category-title {
    font-size: 26px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    font-size: 32px;
}

.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.keyword-box {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 2px solid transparent;
}

.keyword-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.keyword-box.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #764ba2;
    transform: translateY(-5px);
}

.keyword-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.keyword-text {
    font-size: 15px;
    font-weight: 600;
}

/* Results Container */
.results-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    display: none;
    margin-top: 30px;
}

.results-container.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.results-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.clear-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* CSE Styling */
.gsc-control-cse {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.gsc-search-box {
    display: none !important;
}

.gsc-results-wrapper-overlay,
.gsc-results-wrapper-visible {
    box-shadow: none !important;
    border: none !important;
}

.gsc-result {
    background: #f9fafb !important;
    border-left: 4px solid #667eea !important;
    padding: 20px !important;
    margin-bottom: 15px !important;
    border-radius: 10px !important;
}

.gsc-result:hover {
    background: #f3f4f6 !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1) !important;
}

.gs-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #1e40af !important;
}

.gs-snippet {
    color: #4b5563 !important;
    line-height: 1.6 !important;
}

.gs-visibleUrl {
    color: #059669 !important;
    font-size: 14px !important;
}

/* Hide non-sponsored results */
.gsc-webResult.gsc-result {
    display: none;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    margin-top: 50px;
    padding: 40px 30px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-about {
    margin-bottom: 25px;
}

.footer-title {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    text-align: center;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.footer-text {
    color: #4b5563;
    line-height: 1.8;
    font-size: 15px;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
    color: #6b7280;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        gap: 15px;
    }

    .keywords-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .category-title {
        font-size: 22px;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .ad-container {
        padding: 15px;
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .keywords-grid {
        grid-template-columns: 1fr;
    }
}