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

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

:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --secondary-blue: #60a5fa;
    --bg-gradient: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: rgba(255, 255, 255, 0.9);
    --hover-bg: rgba(37, 99, 235, 0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Initial Landing State */
.landing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.landing-container.hidden {
    opacity: 0;
    transform: translateY(-100px);
    pointer-events: none;
    display: none;
}

.landing-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.landing-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.landing-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
}

.landing-search-box {
    display: flex;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.1);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.landing-search-box:focus-within {
    border-color: var(--primary-blue);
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.2);
}

.landing-search-input {
    flex: 1;
    padding: 1.25rem 1.5rem;
    border: none;
    font-size: 1.125rem;
    font-weight: bold;
    background: transparent;
    color: var(--text-primary);
    outline: none;
}

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

.landing-search-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.landing-search-btn:hover {
    background: var(--primary-blue-dark);
}

.landing-options {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}


/* Compact Header State */
.compact-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    z-index: 100;
    opacity: 0;
    transform: translateY(-100%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
}

.compact-header.visible {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 2rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    flex-shrink: 0;
}

.compact-search-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.compact-search-box {
    display: flex;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 300px;
}

.compact-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    font-size: 0.875rem;
    font-weight: bold;
    background: transparent;
    color: var(--text-primary);
    outline: none;
}

.compact-search-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.compact-search-btn:hover {
    background: var(--primary-blue-dark);
}

/* Mobile Bottom Search */
.mobile-bottom-search {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 0.5rem;
    z-index: 100;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
}

.mobile-bottom-search .landing-options {
    margin-top: 0.5rem !important;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.mobile-bottom-search.visible {
    opacity: 1;
    transform: translateY(0);
}

.mobile-search-box {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-search-input {
    flex: 1;
    padding: 0.875rem;
    border: none;
    font-size: 1rem;
    font-weight: bold;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    min-width: 0; /* Allow shrinking */
}

.mobile-search-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.875rem 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0; /* Prevent button from shrinking */
    min-width: 50px; /* Ensure button is always visible */
}

/* Results Area */
.results-area {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem 1.5rem 2rem;
    margin-top: 0;
    display: none;
}

.results-area.visible {
    opacity: 1;
    transform: translateY(0);
    margin-top: 5rem; /* Default, will be overridden by JS */
    display: block;
}

.results-container {
    max-width: 1400px;
    margin: 0 auto;
}

.results-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem 0.75rem 0 0;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.results-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hover-button {
    background: #10b981;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hover-button:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Mobile/narrow mode: show button on new line */
@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .results-info > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    .hover-button {
        width: 100%;
        text-align: center;
        display: block !important;
    }
}

.results-controls {
    display: flex;
    align-items: center;
}

.highlight-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.highlight-toggle input[type="checkbox"] {
    accent-color: var(--primary-blue);
}

.highlight-toggle:hover {
    color: var(--text-primary);
}

.results-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    padding: 1.5rem;
    min-height: 400px;
}

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.domain-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.domain-favicon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 2px;
}

.domain-text {
    flex: 1;
    min-width: 0;
}

.domain-item:hover {
    border-color: var(--primary-blue);
    background: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.domain-item .highlight {
    background-color: #ffeb3b;
    border-radius: 0.25rem;
    font-weight: 700;
}

/* Options */
.radio-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.radio-option:hover {
    color: var(--text-primary);
}

.radio-option input[type="radio"] {
    accent-color: var(--primary-blue);
}

/* Load More */
.load-more {
    text-align: center;
    padding: 1rem;
}

.load-more-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.load-more-btn:hover:not(:disabled) {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Desktop Responsive - ensure compact header works above 768px */
@media (min-width: 769px) {
    .compact-header.visible {
        display: block !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    .mobile-bottom-search {
        display: none !important;
        opacity: 0 !important;
        transform: translateY(100%) !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .landing-title {
        font-size: 2.5rem;
    }

    .landing-subtitle {
        font-size: 1.125rem;
    }

    .compact-header {
        display: none !important;
        opacity: 0 !important;
        transform: translateY(-100%) !important;
    }

    .mobile-bottom-search {
        display: block !important;
    }

    /* Ensure mobile search is visible when results are showing */
    .mobile-bottom-search.visible {
        display: block !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    .results-area.visible {
        margin-top: 1rem;
        padding-bottom: 10rem !important; /* Reduced for desktop narrow mode */
    }

    .results-content {
        padding-bottom: 1rem !important;
    }

    .domain-grid {
        grid-template-columns: 1fr;
        padding-bottom: 0.5rem;
    }

    .load-more {
        padding-bottom: 1rem !important; /* Reduced base padding */
    }

    .compact-search-box {
        min-width: 250px;
    }

    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Extra padding for actual mobile devices detected by JavaScript */
body.actual-mobile-device .results-area.visible {
    padding-bottom: 12rem !important;  /* Reduced from 20rem */
}

body.actual-mobile-device .load-more {
    padding-top: 0.5rem !important;     /* Reduced space above button */
    padding-bottom: 4rem !important;    /* Reduced from 10rem */
}

body.actual-mobile-device .results-content {
    padding-bottom: 0.5rem !important;  /* Just a little for visual spacing */
}

body.actual-mobile-device #loadMoreContainer {
    margin-bottom: 0 !important;  /* Removed extra margin */
}

@media (max-width: 480px) {
    .landing-container {
        padding: 1rem;
    }

    .landing-search-box {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .landing-search-input {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }

    .landing-search-btn {
        padding: 1rem 1.25rem;
        min-width: 60px;
        flex-shrink: 0;
    }

    .compact-search-container {
        flex-direction: column;
        width: 100%;
    }

    .compact-search-box {
        min-width: 100%;
    }
}

/* Navbar - Shared across all pages */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
}

.navbar-links {
    display: flex;
    gap: 2rem;
}

.navbar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-links a:hover {
    color: var(--primary-blue);
}

.navbar-right {
    display: flex;
    gap: 1rem;
}

.btn-secondary, .btn-primary {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-secondary {
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: white;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    border: 1px solid var(--primary-blue);
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
}

/* Footer - Shared across all pages */
.site-footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 1.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: white;
    font-size: 1.25rem;
    transition: color 0.2s;
}

.footer-social a:hover {
    color: var(--primary-blue);
}

.footer-column h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-column ul {
    list-style: none;
}

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

.footer-column a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: white;
}

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

.footer-tagline {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Hamburger menu button */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1000;
}

.hamburger span {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transition: right 0.3s ease;
    padding: 4rem 1.5rem 2rem;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mobile-menu-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.2s;
}

.mobile-menu-links a:hover {
    color: var(--primary-blue);
}

.mobile-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .navbar-links,
    .navbar-right {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}