/* Homepage Styles - Import common styles */
@import url('./common.css');

/* Theme: Red */
html[data-theme="red"] {
    --primary-color: #FF4D00;
    --primary-hover: #E64500;
    --secondary-color: #000000;
    --text-secondary: #000000;
    --success-color: #DB4033;
    --error-color: #DB4033;
    --warning-color: #DB4033;
    --theme-bg: transparent;
    --theme-accent: #DB4033;
    --theme-text: #000000;
}

/* Theme: Blue */
html[data-theme="blue"] {
    --primary-color: #FF4D00;
    --primary-hover: #E64500;
    --secondary-color: #000000;
    --text-secondary: #000000;
    --success-color: #413F8D;
    --error-color: #413F8D;
    --warning-color: #413F8D;
    --theme-bg: transparent;
    --theme-accent: #413F8D;
    --theme-text: #000000;
}

body {
    font-family: var(--font-family);
    background: transparent;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Overlaid gradient images with cloud-like animation */
body::before {
    content: '';
    position: fixed;
    top: auto;
    bottom: -20%;
    left: -15%;
    width: 130%;
    height: 130%;
    z-index: -3;
    background-image: url('/images/gradient-red.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
    animation: cloudFloat1 45s ease-in-out infinite;
}

/* Second gradient layer */
body::after {
    content: '';
    position: fixed;
    top: -30%;
    left: -15%;
    width: 130%;
    height: 130%;
    z-index: -2;
    background-image: url('/images/gradient-yellow.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    mix-blend-mode: multiply;
    will-change: transform;
    animation: cloudFloat2 60s ease-in-out infinite;
}

/* Third gradient layer using html element */
html::before {
    content: '';
    position: fixed;
    top: -40%;
    left: -15%;
    width: 130%;
    height: 130%;
    z-index: -1;
    background-image: url('/images/gradient-blue.png');
    background-size: cover;
    background-position: top left;
    background-repeat: no-repeat;
    mix-blend-mode: multiply;
    pointer-events: none;
    will-change: transform;
    animation: cloudFloat3 75s ease-in-out infinite;
}

/* Cloud-like floating animations for gradient layers */
@keyframes cloudFloat1 {
    0% {
        transform: translate(0%, 0%) scale(1);
    }
    25% {
        transform: translate(8%, 5%) scale(1.05);
    }
    50% {
        transform: translate(-6%, 10%) scale(0.95);
    }
    75% {
        transform: translate(10%, -8%) scale(1.03);
    }
    100% {
        transform: translate(0%, 0%) scale(1);
    }
}

@keyframes cloudFloat2 {
    0% {
        transform: translate(0%, 0%) scale(1) rotate(0deg);
    }
    20% {
        transform: translate(-7%, 8%) scale(1.06) rotate(2deg);
    }
    40% {
        transform: translate(5%, -5%) scale(0.94) rotate(-3deg);
    }
    60% {
        transform: translate(-10%, 3%) scale(1.04) rotate(1deg);
    }
    80% {
        transform: translate(7%, -10%) scale(0.96) rotate(-2deg);
    }
    100% {
        transform: translate(0%, 0%) scale(1) rotate(0deg);
    }
}

@keyframes cloudFloat3 {
    0% {
        transform: translate(0%, 0%) scale(1) rotate(0deg);
    }
    16.66% {
        transform: translate(6%, -8%) scale(1.02) rotate(-1deg);
    }
    33.33% {
        transform: translate(-8%, 6%) scale(0.97) rotate(2deg);
    }
    50% {
        transform: translate(10%, 9%) scale(1.07) rotate(-3deg);
    }
    66.66% {
        transform: translate(-5%, -6%) scale(0.96) rotate(1deg);
    }
    83.33% {
        transform: translate(8%, 10%) scale(1.04) rotate(-2deg);
    }
    100% {
        transform: translate(0%, 0%) scale(1) rotate(0deg);
    }
}


/* Container */
.container {
    flex: 1 0 auto;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 60px 20px;
    width: 100%;
    position: relative;
    transition: padding 0.3s ease;
}

/* Header */
.header {
    text-align: left;
    margin: 20px 0 50px;
    position: relative;
    padding: 30px 40px;
    background: transparent;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-text {
    flex: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container {
    background: #ffffff;
    padding: 30px;
    border-radius: 0 0 16px 16px;
    display: inline-block;
    position: relative;
    box-shadow:
        -4px 0 8px 0 rgba(0, 0, 0, 0.08),
        4px 0 8px 0 rgba(0, 0, 0, 0.08),
        0 6px 8px 0 rgba(0, 0, 0, 0.08),
        0 12px 24px -8px rgba(0, 0, 0, 0.35);
    clip-path: inset(-100px -100px -50px -100px);
}

.logo-container::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100px;
    background: #ffffff;
    border-radius: 0;
}

.search-type-selector {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.logo {
    font-size: 3.2rem;
    font-weight: 700;
    color: #2C2C2C;
    letter-spacing: -1px;
    margin-bottom: 8px;
    position: relative;
    display: block;
    font-family: var(--font-family);
}

.logo-image {
    height: 58.5px;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* Removed logo underline */

.subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 8px;
    letter-spacing: 0.5px;
    line-height: 1.6;
    text-align: center;
}

.subtitle-tagline {
    color: #413F8D;
    font-size: 0.75rem;
    font-weight: 500;
}

.theme-dropdown {
    position: absolute;
    bottom: calc(100% + 10px); /* Changed from top to bottom - dropdown appears above button */
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 12px;
    min-width: 220px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px); /* Changed direction - animates upward */
    transition: var(--transition);
    z-index: 10001;
}

.theme-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 6px;
}

.theme-option:last-child {
    margin-bottom: 0;
}

.theme-option:hover {
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
    border-color: color-mix(in srgb, var(--theme-accent) 20%, transparent);
}

.theme-option.active {
    background: color-mix(in srgb, var(--theme-accent) 15%, transparent);
    border-color: var(--theme-accent);
}

.theme-preview {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.red-preview {
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 50%, #DB4033 50%, #DB4033 100%);
}

.blue-preview {
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 50%, #413F8D 50%, #413F8D 100%);
}

.theme-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Search Type Selector - Hidden */
.search-type-selector {
    display: none;
}

.type-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border: 2px solid transparent;
    background: #ffffff;
    backdrop-filter: blur(8px);
    border-radius: 28px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #000000;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.type-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.type-btn.active {
    background: var(--primary-color);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.type-btn .icon {
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
}

/* Search Container */
.search-container {
    max-width: 900px;
    margin: 100px auto 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    width: 49rem;
    max-width: 100%;
    padding: var(--spacing-15, 0.75rem) var(--spacing-15, 0.75rem) var(--spacing-15, 0.75rem) var(--spacing-3, 1.5rem);
    justify-content: space-between;
    align-items: center;
    border-radius: var(--Radius-XL, 2rem);
    border: 1px solid #FFF;
    background: var(--surface-primary, #FFF);
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25) inset;
    transition: var(--transition);
    z-index: 1;
}


.search-box:hover {
    box-shadow: 0 12px 32px color-mix(in srgb, var(--theme-accent) 20%, transparent);
    border-color: color-mix(in srgb, var(--theme-accent) 30%, transparent);
    background: rgba(255, 255, 255, 0.85);
}

.search-box:focus-within {
    box-shadow: 0 16px 40px color-mix(in srgb, var(--theme-accent) 25%, transparent);
    border-color: var(--theme-accent);
    background: rgba(255, 255, 255, 0.9);
}

.search-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.search-submit-btn {
    display: flex;
    min-height: 2.625rem;
    padding: var(--spacing-15, 0.75rem) var(--spacing-2, 1rem);
    justify-content: center;
    align-items: center;
    gap: var(--spacing-1, 0.5rem);
    border-radius: var(--Radius-XL, 2rem);
    background: var(--button-primary-fill-default, #FF4D00);
    border: none;
    color: white;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.search-submit-btn:hover {
    background: var(--primary-hover);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 16px;
    font-family: var(--typography-font-family-title, "Bricolage Grotesque");
    font-size: var(--typography-size-md, 1.375rem);
    color: var(--text-body, #2D3649);
    background: transparent;
    font-weight: 500;
    resize: none;
    overflow: hidden;
    line-height: 1.4;
    min-height: 20px;
    max-height: 100px;
}

.search-input::placeholder {
    color: var(--text-dark, #768094);
    text-align: left;
    font-family: var(--typography-font-family-title, "Bricolage Grotesque");
    font-size: var(--typography-size-md, 1.375rem);
    font-style: normal;
    font-weight: 400;
    line-height: inherit;
}

.clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    transition: var(--transition);
}

.clear-btn:hover {
    color: var(--text-primary);
}

.clear-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--theme-accent) 20%, transparent);
}

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

.btn-primary:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
    background: var(--primary-hover);
}

/* Search Buttons Container */
.search-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Search button outside box - desktop */
.search-btn-external {
    margin-top: 16px;
    padding: 14px 48px;
    font-size: 1rem;
}


/* Apply page load animations */
.header {
    opacity: 0;
    animation: slideDown 0.6s ease 0.1s forwards;
}

.search-type-selector {
    opacity: 0;
    animation: fadeIn 0.6s ease 0.3s forwards;
}

.search-container {
    opacity: 0;
    animation: scaleIn 0.6s ease 0.4s forwards;
}

/* Hide gradients and apply static background when results are shown */
body:has(#resultsContainer:not([style*="display: none"])) {
    background: #E4E7ED !important;
}

body:has(#resultsContainer:not([style*="display: none"]))::before,
body:has(#resultsContainer:not([style*="display: none"]))::after {
    display: none !important;
}

html:has(#resultsContainer:not([style*="display: none"]))::before {
    display: none !important;
}

/* ===== BETA BANNER ===== */
.beta-banner {
    display: none;
    position: relative;
    max-width: 800px;
    margin: 20px auto;
    padding: 16px 24px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-accent) 8%, transparent), color-mix(in srgb, var(--theme-accent) 4%, transparent));
    border: 2px solid color-mix(in srgb, var(--theme-accent) 25%, transparent);
    border-radius: 12px;
    text-align: center;
    animation: fadeInDown 0.5s ease;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--theme-accent) 12%, transparent);
}

.beta-banner.show {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.beta-banner.fade-out {
    animation: fadeOutUp 0.8s ease forwards;
}

.beta-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: var(--theme-accent);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 6px;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--theme-accent) 35%, transparent);
}

.beta-text {
    font-size: 0.95rem;
    color: var(--theme-accent);
    font-weight: 600;
}

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

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
        margin: 20px auto;
        padding: 16px 24px;
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
        margin: 0 auto;
        padding: 0 24px;
    }
}


/* Mobile Search Button - Hidden on Desktop */
.search-buttons-mobile {
    display: none;
    width: 100%;
    justify-content: center;
    margin-top: 16px;
}

.search-submit-btn-mobile {
    display: flex;
    min-height: 2.625rem;
    padding: 12px 32px;
    justify-content: center;
    align-items: center;
    border-radius: 2rem;
    background: var(--button-primary-fill-default, #FF4D00);
    border: none;
    color: white;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--theme-accent) 20%, transparent);
}

.search-submit-btn-mobile:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--theme-accent) 30%, transparent);
    transform: translateY(-2px);
}

/* Mobile responsive */

@media (max-width: 640px) {
    .beta-banner {
        margin: 12px;
        padding: 12px 16px;
    }

    .beta-badge {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .beta-text {
        font-size: 0.85rem;
    }

    /* Hide search icon on mobile for more space */
    .search-icon {
        display: none;
    }

    /* Hide search button on mobile - use Enter key instead */
    .search-submit-btn {
        display: none;
    }

    /* Show mobile search button */
    .search-buttons-mobile {
        display: flex;
    }

    .search-container {
        margin: 40px auto 0;
    }

    .search-box {
        padding: 0;
    }

    /* Fix mobile textarea vertical alignment */
    .search-input {
        padding: 12px 16px;
        line-height: 1.4;
        font-family: var(--typography-font-family-title, "Bricolage Grotesque");
        font-size: var(--typography-size-md, 1.375rem);
        color: var(--text-body, #2D3649);
    }

    .search-input::placeholder {
        line-height: inherit;
    }

    /* Make footer always visible on mobile */
    body {
        min-height: 100dvh;
        padding-bottom: 80px;
    }

    .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }

    /* Reduce header spacing to fit content better */
    .header {
        margin: 10px 0 30px;
        padding: 20px;
    }

    .search-container {
        margin-top: 50px;
    }

    .container {
        padding: 20px 20px 10px;
    }
}


/* ===== FOOTER ===== */
/* Footer styles moved to common.css */

