:root {
    --accent: #00ffae;
    --bg-main: linear-gradient(135deg, #101014 0%, #181824 100%);
    --header-bg: linear-gradient(90deg, #181824 60%, #3a3a42 100%);
    --card-bg: rgba(40, 40, 60, 0.95);
    --search-bg: linear-gradient(90deg, #181824 60%, #101014 100%);
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --button-bg: var(--accent);
    --button-text: #101014;
    --button-hover-bg: #101014;
    --button-hover-text: var(--accent);
}

body {
    font-family: 'Inter', 'Roboto', 'Montserrat', Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-main);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

body.theme-dark {
    --bg-main: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    --header-bg: linear-gradient(90deg, #161b22 60%, #0d1117 100%);
    --card-bg: rgba(30, 35, 45, 0.95);
    --search-bg: linear-gradient(90deg, #161b22 60%, #0d1117 100%);
    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --button-bg: #ffffff;
    --button-text: #0d1117;
    --button-hover-bg: #f0f0f0;
    --button-hover-text: #0d1117;
}
/* body.theme-dark {
    --bg-main: linear-gradient(135deg, #101014 0%, #181824 100%);
    --header-bg: linear-gradient(90deg, #181824 60%, #101014 100%);
    --card-bg: rgba(40, 40, 60, 0.95);
    --search-bg: linear-gradient(90deg, #181824 60%, #101014 100%);
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --button-bg: var(--accent);
    --button-text: #101014;
    --button-hover-bg: #101014;
    --button-hover-text: var(--accent);
} */

body.theme-white {
    --bg-main: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    --header-bg: linear-gradient(90deg, #f3f4f6 60%, #ffffff 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --search-bg: linear-gradient(90deg, #f3f4f6 60%, #ffffff 100%);
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --button-bg: #ffffff;
    --button-text: #1f2937;
    --button-hover-bg: #f3f4f6;
    --button-hover-text: #1f2937;
}

/* body.theme-white {
    --bg-main: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    --header-bg: linear-gradient(90deg, #f8f9fa 60%, #ffffff 100%);
    --card-bg: rgba(209, 209, 209, 0.781);
    --search-bg: linear-gradient(90deg, #2196f3 60%, #ffffff 100%);
    --text-primary: #222222;
    --text-secondary: #444444;
    --text-muted: #666666;
    --button-bg: #222;
    --button-text: #fff;
    --button-hover-bg: #00ffae;
    --button-hover-text: #222;
} */

body.theme-blue {
    --bg-main: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    --header-bg: linear-gradient(90deg, #1e3a8a 60%, #0f172a 100%);
    --card-bg: rgba(30, 58, 138, 0.95);
    --search-bg: linear-gradient(90deg, #1e3a8a 60%, #0f172a 100%);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --button-bg: #ffffff;
    --button-text: #0f172a;
    --button-hover-bg: #f8fafc;
    --button-hover-text: #0f172a;
}


/* body.theme-blue {
    --bg-main: linear-gradient(135deg, #0a1929 0%, #1a365d 100%);
    --header-bg: linear-gradient(90deg, #1a365d 60%, #0a1929 100%);
    --card-bg: rgba(26, 54, 93, 0.95);
    --search-bg: linear-gradient(90deg, #1a365d 60%, #0a1929 100%);
    --text-primary: #e8f4fd;
    --text-secondary: #b3d9f2;
    --text-muted: #8ac4e6;
    --button-bg: #2196f3;
    --button-text: #fff;
    --button-hover-bg: #1565c0;
    --button-hover-text: #fff;
} */

.hero {
    background: var(--header-bg);
    color: var(--text-primary);
    padding: 2.5rem 0 2rem 0;
    text-align: center;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0,255,174,0.08);
    box-shadow: 0 2px 24px 0 rgba(0,255,174,0.08);
    position: relative;
}

/* Eye-catching banner styling */
.hero-banner {
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    z-index: 10;
    max-width: 400px;
}

.banner-content {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 50%, #ffd93d 100%);
    color: #1a1a1a;
    padding: 0.6rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: bannerPulse 2s ease-in-out infinite;
    backdrop-filter: blur(10px);
}

.banner-icon {
    font-size: 1.1rem;
    animation: bannerBounce 1.5s ease-in-out infinite;
}

.banner-text {
    line-height: 1.3;
}

.banner-text strong {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes bannerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    }
}

@keyframes bannerBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

/* Theme-specific banner colors */
body.theme-dark .banner-content {
    background: linear-gradient(135deg, #00ffae 0%, #00d4ff 50%, #ff6b6b 100%);
    color: #0d1117;
    box-shadow: 0 4px 15px rgba(0, 255, 174, 0.3);
}

body.theme-dark .banner-text strong {
    color: #ffffff;
}

body.theme-white .banner-content {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #ec4899 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

body.theme-blue .banner-content {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    padding-top: 4rem;
}

.hero-logo {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 0 8px var(--accent));
    flex-shrink: 0;
    border-radius: 10%;
}

.hero-text {
    text-align: center;
    flex: 1;
}

.settings-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.settings-btn:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.compare-link {
    position: absolute;
    top: 1rem;
    right: 4.5rem;
    background: var(--button-bg);
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.compare-link:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    /* Backdrop filter with fallback for Safari */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.settings-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 2rem;
    min-width: 400px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 30px 0 var(--accent);
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(0,255,174,0.1);
}

.settings-content::-webkit-scrollbar {
    width: 8px;
}

.settings-content::-webkit-scrollbar-track {
    background: rgba(0,255,174,0.1);
    border-radius: 4px;
}

.settings-content::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
    background: #00cc8a;
}

@media (max-width: 768px) {
    .settings-content {
        min-width: unset;
        width: 95vw;
        max-width: 95vw;
        padding: 1.5rem;
        margin: 1rem;
        top: 10%;
        transform: translate(-50%, 0);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .settings-header h3 {
        font-size: 1.3rem;
    }
    
    .setting-group h4 {
        font-size: 1rem;
    }
    
    .theme-controls {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .theme-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .size-controls-modal {
        padding: 0.4rem 0.8rem;
    }
    
    .size-btn {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
    
    .size-indicator {
        font-size: 0.8rem;
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .settings-content {
        padding: 1rem;
        margin: 0.5rem;
        width: 98vw;
        max-width: 98vw;
    }
    
    .settings-header {
        margin-bottom: 1rem;
        padding-bottom: 0.8rem;
    }
    
    .setting-group {
        margin-bottom: 1rem;
    }
    
    .close-btn {
        font-size: 1.3rem;
        padding: 0.3rem;
    }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,255,174,0.2);
}

.settings-header h3 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.5rem;
    text-shadow: 0 0 8px var(--accent);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(0,255,174,0.1);
    transform: scale(1.1);
}

.setting-group {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,255,174,0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.setting-group.collapsed {
    border-color: rgba(0,255,174,0.05);
}

.setting-group-header {
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(0,255,174,0.1);
}

.setting-group-header:hover {
    background: rgba(0,255,174,0.05);
}

.setting-group-header h4 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.1rem;
    text-shadow: 0 0 6px var(--accent);
}

.setting-group-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0.2rem;
    border-radius: 4px;
}

.setting-group-toggle:hover {
    background: rgba(0,255,174,0.1);
    transform: scale(1.1);
}

.setting-group-toggle.rotated {
    transform: rotate(180deg);
}

.setting-group-content {
    padding: 1.5rem;
    background: var(--card-bg);
    transition: all 0.3s ease;
    max-height: 300px;
    overflow: hidden;
}

.setting-group.collapsed .setting-group-content {
    max-height: 0;
    padding: 0 1.5rem;
}

.setting-group h4 {
    color: var(--text-primary);
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
    text-shadow: 0 0 6px var(--accent);
}

.size-controls-modal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid rgba(0,255,174,0.2);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    justify-content: center;
}

.theme-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.theme-btn {
    background: var(--card-bg);
    border: 1px solid rgba(0,255,174,0.2);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.theme-btn:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.theme-btn.active {
    background: var(--button-bg);
    color: var(--button-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Sort controls styling */
.sort-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.sort-btn {
    background: var(--card-bg);
    border: 1px solid rgba(0,255,174,0.2);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
}

.sort-btn:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.sort-btn.active {
    background: var(--button-bg);
    color: var(--button-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile responsive for sort controls */
@media (max-width: 768px) {
    .sort-controls {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .sort-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Apply button styling */
.settings-apply-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 8px;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.settings-apply-btn:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-apply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Feedback animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Floating recommendation button */
.floating-recommendation {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    animation: floatBounce 3s ease-in-out infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.floating-recommendation-btn {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--accent);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,255,174,0.3);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
}

.floating-recommendation-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(0,255,174,0.4);
    background: var(--accent);
    color: var(--button-text);
    border-color: var(--accent);
}

.floating-recommendation-btn .tool-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.floating-recommendation-btn .sparkle {
    font-size: 1.4rem;
    animation: sparkle 2s ease-in-out infinite;
    position: absolute;
    top: 5px;
    right: 5px;
}

.floating-recommendation-text {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    max-width: 120px;
    color: var(--text-primary);
    background: var(--card-bg);
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--accent);
    box-shadow: 0 2px 10px rgba(0,255,174,0.2);
    backdrop-filter: blur(10px);
    animation: floatBounce 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

@keyframes floatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .floating-recommendation {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-recommendation-btn {
        width: 85px;
        height: 85px;
        gap: 0.35rem;
    }
    
    .floating-recommendation-btn .tool-icon {
        width: 28px;
        height: 28px;
    }
    
    .floating-recommendation-btn .sparkle {
        font-size: 1.3rem;
    }
    
    .floating-recommendation-text {
        font-size: 0.7rem;
        max-width: 100px;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .floating-recommendation-btn {
        width: 75px;
        height: 75px;
        gap: 0.3rem;
    }
    
    .floating-recommendation-btn .tool-icon {
        width: 24px;
        height: 24px;
    }
    
    .floating-recommendation-btn .sparkle {
        font-size: 1.1rem;
    }
    
    .floating-recommendation-text {
        font-size: 0.65rem;
        max-width: 90px;
        padding: 0.3rem 0.5rem;
    }
}

/* Background Themes */
body.theme-dark {
    background: linear-gradient(135deg, #101014 0%, #181824 100%);
}

body.theme-white {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

body.theme-blue {
    background: linear-gradient(135deg, #0a1929 0%, #1a365d 100%);
}

.search-section {
    background: var(--search-bg);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0,255,174,0.08);
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid rgba(0,255,174,0.2);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    flex: 1;
    max-width: 400px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    padding: 0.5rem 0;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.search-btn:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.size-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid rgba(0,255,174,0.2);
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.size-controls:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.size-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.size-btn:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.size-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.size-indicator {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    text-shadow: 0 0 4px var(--accent);
}

.category-shortcuts {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    /* Scrollbar styling with fallbacks for better browser compatibility */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(40, 40, 60, 0.3);
    /* Fallback for browsers that don't support scrollbar-width */
    scrollbar-gutter: stable;
    padding: 0.5rem 0;
    max-width: 600px;
    scroll-behavior: smooth;
}

.category-shortcuts::-webkit-scrollbar {
    height: 4px;
}

.category-shortcuts::-webkit-scrollbar-track {
    background: rgba(40, 40, 60, 0.3);
    border-radius: 2px;
}

.category-shortcuts::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

.category-shortcuts::-webkit-scrollbar-thumb:hover {
    background: #00cc8a;
}

.category-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid rgba(0,255,174,0.2);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    padding: 0.3rem;
    box-sizing: border-box;
    flex-shrink: 0;
    min-width: 60px;
}

.category-shortcut:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.category-shortcut-icon {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    filter: drop-shadow(0 0 4px var(--accent));
    color: var(--text-primary);
}

.category-shortcut-text {
    font-size: 0.6rem;
    line-height: 1;
    text-shadow: 0 0 4px var(--accent);
    color: var(--text-primary);
}

.highlight-category {
    animation: highlightPulse 2s ease-in-out;
    position: relative;
    z-index: 10;
}

@keyframes highlightPulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 var(--accent);
    }
    25% { 
        transform: scale(1.02); 
        box-shadow: 0 0 20px 0 var(--accent);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 30px 0 var(--accent);
    }
    75% { 
        transform: scale(1.02); 
        box-shadow: 0 0 20px 0 var(--accent);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 var(--accent);
    }
}

@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-bar {
        max-width: 100%;
    }
    
    .size-controls {
        align-self: center;
        order: 2;
    }
    
    .category-shortcuts {
        justify-content: flex-start;
        gap: 0.6rem;
        max-width: calc(5 * 50px + 4 * 0.6rem + 1rem); /* Show 5 shortcuts at once */
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 0.5rem 0.5rem;
        order: 3;
    }
    
    .category-shortcut {
        width: 50px;
        height: 50px;
        font-size: 0.6rem;
        scroll-snap-align: start;
        min-width: 50px;
    }
    
    .category-shortcut-icon {
        font-size: 1rem;
    }
    
    .category-shortcut-text {
        font-size: 0.5rem;
    }
    
    .settings-btn {
        top: 0.5rem;
        right: 0.5rem;
        width: 36px;
        height: 36px;
        font-size: 1rem;
        background: var(--button-bg);
        color: var(--button-text);
    }
    
    .compare-link {
        top: 0.5rem;
        right: 3.5rem;
        width: 36px;
        height: 36px;
        font-size: 1rem;
        background: var(--button-bg);
        color: var(--text-primary);
    }
}

@media (min-width: 769px) {
    .category-shortcuts {
        max-width: calc(10 * 60px + 9 * 0.8rem + 2rem); /* Show 10 shortcuts at once */
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 0.5rem 1rem;
    }
    
    .category-shortcut {
        scroll-snap-align: start;
    }
}

.hero h1 {
    font-family: 'Inter', 'Roboto', 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.7em 0;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    letter-spacing: 0.01em;
    line-height: 1.1;
    max-width: 90vw;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 0 12px var(--accent), 0 2px 24px #000;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-primary);
    margin: 0 auto;
    max-width: 600px;
    line-height: 1.4;
    font-weight: 500;
    text-shadow: 0 0 6px #101014;
}

@media (max-width: 600px) {
    .hero {
        padding: 1.2rem 0 1rem 0;
    }
    .hero-content {
        flex-direction: row;
        gap: 0.7rem;
        text-align: left;
        align-items: center;
    }
    .hero-text {
        text-align: left;
    }
    .hero-logo {
        max-width: 60px;
    }
    .hero h1 {
        font-size: clamp(1.2rem, 6vw, 1.7rem);
        padding: 0 8px;
    }
    .hero-subtitle {
        font-size: clamp(0.95rem, 3vw, 1.1rem);
        padding: 0 8px;
    }
}

h1, h2, h3 {
    font-family: 'Inter', 'Roboto', 'Montserrat', Arial, sans-serif;
    color: var(--text-primary);
}

a, .highlight {
    color: var(--accent);
}

.button, .cta {
    background: var(--button-bg);
    color: var(--button-text);
    font-weight: bold;
    border-radius: 6px;
    padding: 0.7rem 1.4rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.button:hover, .cta:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

header {
    background: var(--header-bg);
    color: var(--text-primary);
    padding: 1.5rem 0;
    text-align: center;
}

.about-section {
    background: var(--search-bg);
    color: var(--text-primary);
    padding: 2.5rem 0 2rem 0;
    text-align: center;
    margin-top: 48px;
    border-top: 1px solid rgba(0,255,174,0.08);
    box-shadow: 0 -2px 24px 0 rgba(0,255,174,0.08);
}

.about-section h2 {
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-family: 'Inter', 'Roboto', 'Montserrat', Arial, sans-serif;
    text-shadow: 0 0 10px var(--accent);
}

.about-section p {
    max-width: 800px;
    margin: 0 auto;
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.6;
    color: var(--text-primary);
}

.categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 32px auto 0 auto;
    max-width: 1200px;
    padding: 0 16px;
}

@media (min-width: 600px) {
    .categories {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        padding: 0 24px;
    }
}

@media (min-width: 900px) {
    .categories {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 40px;
        padding: 0 32px;
    }
}

.category {
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 3cm;
    height: 3cm;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 0 4px rgba(0,255,174,0.08);
    border: 1px solid rgba(0,255,174,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
    transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s, z-index 0.18s;
    cursor: pointer;
    text-align: center;
    position: relative;
    z-index: 1;
}

@media (max-width: 900px) {
    .category, .tool-card-popup {
        max-width: 100vw;
        height: 120px;
        padding: 12px;
    }
}

@media (max-width: 600px) {
    .category, .tool-card-popup {
        max-width: 100vw;
        height: 100px;
        padding: 8px;
    }
}

.category:hover, .category:focus, .category:active {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
    transform: scale(1.03) translateY(-2px);
    z-index: 3;
}

.category-title {
    font-family: 'Inter', 'Roboto', 'Montserrat', Arial, sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: 0.01em;
    text-align: center;
    text-shadow: 0 0 8px var(--accent);
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
    height: 64px;
    width: 64px;
    background: rgba(0,255,174,0.1);
    border-radius: 12px;
    color: var(--accent);
    box-shadow: 0 1px 4px rgba(0,255,174,0.2);
    filter: drop-shadow(0 0 2px var(--accent));
}

.category-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* Default: 2 lines for small cards */
    line-clamp: 2;
    max-height: 2.8em;     /* 2 lines * line-height */
    min-height: unset;
    padding: 0;
}

@media (min-width: 200px) {
    .category-description {
    -webkit-line-clamp: 2;
    line-clamp: 2;
        max-height: 2.8em;
    }
}
@media (min-width: 340px) {
    .category-description {
        -webkit-line-clamp: 3;
        line-clamp: 3;
        max-height: 4.2em;
    }
}
@media (min-width: 480px) {
    .category-description {
        -webkit-line-clamp: 4;
        line-clamp: 4;
        max-height: 5.6em;
    }
}
@media (min-width: 600px) {
    .category-description {
        -webkit-line-clamp: 5;
        line-clamp: 5;
        max-height: 7em;
    }
}

/* Category tool count styling */
.category-tool-count {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    margin: 0;
    padding: 0.2rem 0.5rem;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 12px;
    display: inline-block;
    border: 1px solid rgba(37, 99, 235, 0.2);
    text-align: center;
    min-width: 60px;
}

/* Theme-specific tool count colors */
body.theme-dark .category-tool-count {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

body.theme-white .category-tool-count {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.2);
    color: #2563eb;
}

body.theme-blue .category-tool-count {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

@media (max-width: 768px) {
    .category-tool-count {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .category-tool-count {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
        min-width: 45px;
    }
}

.popup-compare-btn {
    background: white;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.popup-compare-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Theme-specific compare button colors */
body.theme-dark .popup-compare-btn {
    background: white;
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

body.theme-dark .popup-compare-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

body.theme-white .popup-compare-btn {
    background: white;
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

body.theme-white .popup-compare-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

body.theme-blue .popup-compare-btn {
    background: white;
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

body.theme-blue .popup-compare-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

/* Tool card popup (expanded on hover) */
.tool-card-popup {
    display: none;
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 0 24px 0 var(--accent), 0 4px 16px rgba(0,255,174,0.12);
    border: 1px solid var(--accent);
    z-index: 10;
    font-size: 1rem;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    padding: 16px;
    transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s, z-index 0.18s;
}

@media (max-width: 900px) {
    .category, .tool-card-popup {
        max-width: 100vw;
        height: 240px;
        padding: 12px;
    }
}

@media (max-width: 600px) {
    .category, .tool-card-popup {
        max-width: 100vw;
        height: 180px;
        padding: 8px;
    }
} 

.tool-logo {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    object-fit: contain;
}

.info-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.info-btn:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.info-popup {
    position: absolute;
    top: 40px;
    right: 10px;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 0.98rem;
    box-shadow: 0 2px 12px rgba(0,255,174,0.2);
    min-width: 180px;
    max-width: 260px;
    z-index: 10;
    display: none;
    pointer-events: auto;
} 

.popup-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    row-gap: 1.7rem;
    column-gap: 0.5rem;
    width: 100%;
    height: 70%;
    margin-bottom: 0.7rem;
    margin-top: 0.1rem;
    align-items: center;
    justify-items: center;
    box-sizing: border-box;
}

.popup-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.popup-tools-grid > .popup-tool {
    grid-column: span 1;
    grid-row: span 1;
}

.popup-tools-grid:after {
    content: '';
    display: block;
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .popup-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
    .tool-logo-large {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 600px) {
    .popup-tools-grid {
        grid-template-columns: repeat(1, 1fr);
        grid-template-rows: repeat(6, 1fr);
    }
    .tool-logo-large {
        width: 20px;
        height: 20px;
    }
} 

.tool-logo-large {
    width: 32px;
    height: 32px;
    margin-bottom: 0.4rem;
    margin-top: 0.1rem;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    object-fit: contain;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-logo-large:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,255,174,0.3);
}

.popup-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s ease;
}

.popup-tool:hover {
    transform: translateY(-2px);
}

.tool-name {
    font-size: 0.50rem;
    color: var(--text-primary);
    margin-top: 0.1rem;
    word-break: break-word;
    text-decoration: none;
    text-shadow: 0 0 6px var(--accent);
}

.popup-tool a {
    text-decoration: none;
    color: inherit;
}



.tool-info-btn {
    position: static;
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tool-info-btn:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tool-info-popup {
    position: absolute;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%);
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 0.98rem;
    box-shadow: 0 2px 12px rgba(0,255,174,0.2);
    min-width: 180px;
    max-width: 260px;
    z-index: 10;
    display: none;
    pointer-events: auto;
    text-align: center;
} 

/* Remove AdSense placeholder styles */
.adsense-banner-placeholder,
.adsense-sidebar-placeholder,
.adsense-inline-placeholder {
  display: none !important;
}

/* Add spacing to main content for Auto Ads */
.main-content {
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: 1rem;
  box-sizing: border-box;
}

/* --- General Responsive Grid for Categories --- */
.categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem 1.5rem;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* --- Popup Tools Grid --- */
.popup-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  justify-items: center;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

.popup-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%; /* Ensures full width in grid cell */
  max-width: 220px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 1rem 0.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,255,174,0.1);
  transition: box-shadow 0.2s;
  border: 1px solid rgba(0,255,174,0.1);
}

.popup-tool .tool-logo-large {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  display: block;
}

.popup-tool .tool-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
  text-shadow: 0 0 6px var(--accent);
}

.popup-tool .tool-desc {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* --- Category and Tool Card Unified Sizing --- */
.category,
.tool-card-popup,
.popup-tool {
  max-width: 340px; /* Restore previous size for desktop */
  width: 100%;
  margin: 0 auto 0.1rem auto;
  box-sizing: border-box;
  border-radius: 14px;
  background: var(--card-bg);
  padding: 1.2rem 1rem;
  min-height: unset;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Popup Tools Grid: 3 per row, max 3 rows --- */
.popup-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  justify-items: center;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  max-height: calc(3 * 180px + 2 * 1.2rem); /* 3 rows, adjust 180px as needed */
  overflow-y: auto;
}

/* --- Tool Card Sizing: Shorter Height --- */
.popup-tool {
  min-width: 0;
  min-height: 0;
  height: 85px;         /* Shorter card height for 3 rows */
  max-height: 170px;
  padding: 0.7rem 0.4rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,255,174,0.1);
  transition: box-shadow 0.2s;
  font-size: 0.97rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Vertically center content */
  border: 1px solid rgba(0,255,174,0.1);
}

.popup-tool .tool-logo-large {
  width: 40px;
  height: 40px;
  margin-bottom: 0.3rem;
}

.popup-tool .tool-title {
  font-size: 1rem;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
  text-shadow: 0 0 6px var(--accent);
}

.popup-tool .tool-desc {
  font-size: 0.88rem;
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  color: var(--text-secondary);
}

/* --- Mobile: Adjust height for 1 column --- */
@media (max-width: 600px) {
  .popup-tool {
    height: 80px;
    max-height: 120px;
    padding: 0.5rem 0.1rem;
  }
  .popup-tool .tool-logo-large {
    width: 28px;
    height: 28px;
    margin-bottom: 0.2rem;
  }
}

/* Note: Layout is designed to allow Google Auto Ads to inject responsive ad units without overlap or layout breakage. Avoids CLS by providing natural spacing. */ 

/* --- Popup Tool Card (Popup) --- */
.tool-card-popup {
  max-width: 340px;
  width: 100%;
  margin: 0 auto 1.5rem auto;
  box-sizing: border-box;
  border-radius: 14px;
  background: var(--card-bg);
  padding: 0.7rem 0.4rem;
  min-height: unset;
  height: 240px; /* 100% height, not 50% */
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--accent);
  box-shadow: 0 0 24px 0 var(--accent), 0 2px 24px 0 rgba(0,255,174,0.12);
}

/* --- Popup Tools Grid inside Popup --- */
.tool-card-popup .popup-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  /* Show only 3 rows, enable scroll if more */
  max-height: calc(3 * 64px + 2 * 0.7rem); /* 64px is the new .popup-tool height */
  height: 100%;
  overflow-y: auto;
}

/* --- Popup Tool Card (Individual Tool) --- */
.tool-card-popup .popup-tool {
  min-width: 0;
  min-height: 0;
  height: 64px;         /* Taller card height for 100% popup */
  max-height: 64px;
  padding: 0.3rem 0.15rem;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,255,174,0.1);
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,255,174,0.1);
}

.tool-card-popup .popup-tool .tool-logo-large {
  width: 28px;
  height: 28px;
  margin-bottom: 0.12rem;
}

.tool-card-popup .popup-tool .tool-title {
  font-size: 1rem;
  margin-bottom: 0.07rem;
  color: var(--text-primary);
  text-shadow: 0 0 6px var(--accent);
}

.tool-card-popup .popup-tool .tool-desc {
  display: none; /* Hide description for compactness */
}

/* --- Responsive: Mobile (≤600px) --- */
@media (max-width: 600px) {
  .tool-card-popup {
    max-width: 100vw;
    width: 100%;
    margin: 0 auto 0.5rem auto;
    padding: 0.4rem 0.1rem;
    height: 180px; /* 100% height for mobile popup */
  }
  .tool-card-popup .popup-tools-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem;
    max-height: calc(3 * 48px + 2 * 0.5rem);
    height: 100%;
  }
  .tool-card-popup .popup-tool {
    height: 60px;
    max-height: 60px;
    padding: 0.05rem 0.05rem;
  }
  .tool-card-popup .popup-tool .tool-logo-large {
    position: center;
    width: 20px;
    height: 20px;
    margin-bottom: 0.05rem;
  }
  .tool-card-popup .popup-tool .tool-title {
    font-size: 0.95rem;
  }
} 

/* AdSense Optimization Styles */
.ad-zone {
    width: 100%;
    min-height: 90px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.ad-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(0,255,174,0.05) 50%, transparent 70%);
    animation: adZonePulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes adZonePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.ad-zone-top {
    margin-top: 0;
    margin-bottom: 30px;
}

.ad-zone-bottom {
    margin: 40px 0 20px 0;
}

.ad-zone-footer {
    margin: 20px 0 0 0;
}



@media (max-width: 768px) {
    .ad-zone {
        margin: 15px 0;
        min-height: 60px;
    }
    
    .ad-zone-top {
        margin-bottom: 20px;
    }
    

    
    .ad-zone-bottom {
        margin: 20px 0 15px 0;
    }
    
    .ad-zone-footer {
        margin: 15px 0 0 0;
    }
}

/* Main layout optimization for ads */
.main-layout {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* Enhanced content spacing for better ad placement */
.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem 1.5rem;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 20px 0;
}

/* Optimize category grid for ad insertion */
.category {
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 3cm;
    height: 3cm;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 0 4px rgba(0,255,174,0.08);
    border: 1px solid rgba(0,255,174,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
    transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s, z-index 0.18s;
    cursor: pointer;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Add spacing between category rows for potential ad insertion */
.categories::after {
    content: '';
    display: block;
    width: 100%;
    height: 20px;
    flex-basis: 100%;
}

/* Mobile optimization for ads */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }
    
    .categories {
        gap: 1rem;
        padding: 10px 0;
    }
    
    .ad-zone {
        margin: 10px 0;
        min-height: 50px;
    }
    
    /* Hide desktop tool cards on mobile */
    .tool-card-popup {
        display: none !important;
    }
}

/* Mobile tool modal styles */
.mobile-tool-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.mobile-tool-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 20px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 30px 0 var(--accent);
}

.mobile-modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.mobile-modal-close-btn:hover {
    background: rgba(0,255,174,0.1);
}

/* Desktop tool cards should be hidden on mobile */
@media (max-width: 768px) {
    .tool-card-popup {
        display: none !important;
    }
}

/* Mobile modal tool cards - consistent sizing and theme support */
.mobile-tool-modal .popup-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    margin: 0;
    padding: 0;
}

.mobile-tool-modal .popup-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 80px; /* Fixed height for consistency */
    min-height: 80px;
    max-height: 80px;
    padding: 0.5rem;
    background: var(--card-bg);
    border: 1px solid rgba(0,255,174,0.1);
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.mobile-tool-modal .popup-tool:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0,255,174,0.2);
    transform: translateY(-2px);
}

.mobile-tool-modal .popup-tool .tool-logo-large {
    width: 32px;
    height: 32px;
    margin-bottom: 0.3rem;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    object-fit: contain;
    transition: transform 0.2s ease;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.mobile-tool-modal .popup-tool .tool-logo-large:hover {
    transform: scale(1.1);
}



.mobile-tool-modal .popup-tool .tool-name {
    font-size: 0.75rem;
    color: var(--text-primary);
    margin: 0;
    word-break: break-word;
    text-decoration: none;
    text-shadow: 0 0 4px var(--accent);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mobile-tool-modal .popup-tool a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Mobile modal compare button */
.mobile-tool-modal .popup-compare-btn {
    background: white;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.mobile-tool-modal .popup-compare-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Mobile modal responsive adjustments */
@media (max-width: 480px) {
    .mobile-tool-modal .popup-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .mobile-tool-modal .popup-tool {
        height: 70px;
        min-height: 70px;
        max-height: 70px;
        padding: 0.4rem;
    }
    
    .mobile-tool-modal .popup-tool .tool-logo-large {
        width: 28px;
        height: 28px;
        margin-bottom: 0.2rem;
    }
    
    .mobile-tool-modal .popup-tool .tool-name {
        font-size: 0.7rem;
    }
}

@media (max-width: 360px) {
    .mobile-tool-modal .popup-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .mobile-tool-modal .popup-tool {
        height: 65px;
        min-height: 65px;
        max-height: 65px;
        padding: 0.3rem;
    }
    
    .mobile-tool-modal .popup-tool .tool-logo-large {
        width: 24px;
        height: 24px;
        margin-bottom: 0.15rem;
    }
    
    .mobile-tool-modal .popup-tool .tool-name {
        font-size: 0.65rem;
    }
}

/* Ensure ads don't interfere with user interactions */
.ad-zone {
    pointer-events: none;
}

.ad-zone > * {
    pointer-events: auto;
}

/* Loading state for ad zones */
.ad-zone.loading {
    background: linear-gradient(90deg, var(--card-bg) 25%, rgba(0,255,174,0.1) 50%, var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Ensure proper spacing around ads */
.search-section + .ad-zone {
    margin-top: 0;
}

.ad-zone + .main-layout {
    margin-top: 0;
}

.main-layout + .ad-zone {
    margin-top: 0;
}

.ad-zone + .about-section {
    margin-top: 0;
} 

/* AI Recommendation Section Styles */
.recommendation-section {
    background: var(--search-bg);
    padding: 2rem 0;
    border-bottom: 1px solid rgba(0,255,174,0.08);
}

.recommendation-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.recommendation-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.recommendation-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 0 8px var(--accent);
}

.recommendation-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
}

.recommendation-input-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.recommendation-input {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid rgba(0,255,174,0.2);
    border-radius: 25px;
    padding: 0.8rem 1.2rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.recommendation-input:focus {
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.recommendation-input::placeholder {
    color: var(--text-secondary);
}

.recommendation-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.recommendation-btn:hover {
    background: var(--button-hover-bg);
    color: var(--button-hover-text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.recommendation-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.recommendation-result {
    background: var(--card-bg);
    border: 1px solid rgba(0,255,174,0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 16px rgba(0,255,174,0.1);
}

.ai-response {
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0,255,174,0.05);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.recommended-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.recommended-category {
    background: var(--card-bg);
    border: 1px solid rgba(0,255,174,0.2);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommended-category:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0,255,174,0.2);
    transform: translateY(-2px);
}

.recommended-category-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 4px var(--accent));
}

/* Loading state */
.recommendation-btn.loading {
    position: relative;
    color: transparent;
}

.recommendation-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--button-text);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    .recommendation-input-container {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .recommendation-input {
        width: 100%;
    }
    
    .recommendation-btn {
        width: 100%;
        padding: 1rem;
    }
    
    .recommendation-result {
        padding: 1rem;
    }
    
    .ai-response {
        font-size: 1rem;
        padding: 0.8rem;
    }
    
    .recommended-categories {
        gap: 0.6rem;
    }
    
    .recommended-category {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Banner responsive styles */
    .hero-banner {
        position: absolute;
        top: 0.5rem;
        left: 1rem;
        max-width: calc(100% - 120px);
        margin: 0;
        order: unset;
    }
    
    .banner-content {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 18px;
        text-align: left;
        justify-content: flex-start;
        max-width: 100%;
    }
    
    .banner-icon {
        font-size: 1rem;
    }
    
    .banner-text {
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .hero-banner {
        max-width: calc(100% - 100px);
        top: 0.3rem;
        left: 0.5rem;
    }
    
    .banner-content {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
        border-radius: 15px;
    }
    
    .banner-icon {
        font-size: 0.8rem;
    }
    
    .banner-text strong {
        font-size: 0.7rem;
    }
}

