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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f0ff 0%, #e8d5ff 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 850px;
    margin: 0 auto;
    transition: all 0.5s ease;
}

/* Home View Styles */
.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 60px;
    margin-bottom: 40px;
    position: relative;
    transition: all 0.5s ease;
}

.header-container.compact {
    margin-top: 0;
    margin-bottom: 20px;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.5s ease;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.5s ease;
}

.header-container.compact .logo-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: 10px;
}

.logo-text {
    font-size: 32px;
    font-weight: 600;
    color: #1f2937;
    transition: all 0.5s ease;
}

.header-container.compact .logo-text {
    font-size: 24px;
}

.back-button {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.back-button.active {
    opacity: 1;
    pointer-events: all;
}

.back-button:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.tagline {
    text-align: center;
    font-size: 28px;
    margin-bottom: 40px;
    color: #1f2937;
    opacity: 1;
    transition: all 0.5s ease;
    max-height: 100px;
    overflow: hidden;
}

.tagline.hidden {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
}

.tagline .purple {
    color: #a855f7;
    font-weight: 600;
}

.search-container {
    width: 100%;
    position: relative;
    margin-bottom: 30px;
}

.rotating-titles {
    position: absolute;
    top: -35px;
    left: 20px;
    font-size: 15px;
    color: #6b7280;
    height: 30px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.rotating-titles.active {
    opacity: 1;
}

.rotating-titles .title-item {
    position: absolute;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.rotating-titles .title-item.show {
    opacity: 1;
    transform: translateY(0);
}

.search-box {
    width: 100%;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 8px 8px 8px 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 8px 12px rgba(168, 85, 247, 0.1), 0 16px 32px rgba(168, 85, 247, 0.15);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #1f2937;
    background: transparent;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-btn {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 40px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

.search-btn-text {
    display: inline;
}

.search-btn-icon {
    display: none;
    font-size: 20px;
}

.questions-card {
    width: 100%;
    background: white;
    border-radius: 24px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-20px);
    transition: max-height 0.5s ease, opacity 0.4s ease, transform 0.4s ease, padding 0.5s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.questions-card.active {
    max-height: 600px;
    opacity: 1;
    transform: translateY(0);
    padding-top: 15px;
    padding-bottom: 15px;
}

.question-item {
    padding: 18px 20px;
    margin-bottom: 12px;
    background: #f9f5ff;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.question-item:hover {
    background: #f3e8ff;
    transform: translateX(4px);
}

.question-item:last-child {
    margin-bottom: 0;
}

.question-item.white {
    background: white;
    border: 1px solid #e5e7eb;
}

.question-item.white:hover {
    background: #f9fafb;
}

.question-text {
    color: #1f2937;
    font-size: 15px;
}

.question-arrow {
    color: #9ca3af;
    font-size: 18px;
}

/* Answer View Styles */
.answer-content {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.answer-content.active {
    display: block;
    opacity: 1;
}

.help-section {
    text-align: center;
    margin-bottom: 30px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;
}

.help-section.active {
    opacity: 1;
    max-height: 100px;
}

.help-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.help-text {
    font-size: 14px;
    color: #6b7280;
}

.help-link {
    color: #a855f7;
    text-decoration: none;
    font-weight: 600;
}

.ad-section {
	display: none;
    padding: 5px;
    margin-bottom: 20px;
}

.ad-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.ad-title {
    color: #2563eb;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.ad-description {
    color: #4b5563;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.ad-links {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 13px;
}

.ad-link {
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
}

.ad-btn {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.ad-btn:hover {
    background: #1d4ed8;
}

.conversation-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 20px;
}

.qa-block {
    border-radius: 12px;
    padding: 20px 0;
}

.user-question {
    background: rgba(168, 85, 247, 0.1);
    border-left: 4px solid #a855f7;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.question-label {
    font-size: 12px;
    font-weight: 600;
    color: #a855f7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.question-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.answer-section {
    padding-left: 20px;
}

.answer-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.answer-text {
    color: #374151;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.typewriter {
    overflow: hidden;
}

.feedback-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.feedback-buttons.hidden {
	display: none;
}

.feedback-btn {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    background: #f3f4f6;
}

.feedback-btn.active {
	opacity: 1;
    transform: scale(1.1);
    background: #f3f4f6;
}

.related-questions {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 100px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.related-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

/* Bottom Search Styles */
.bottom-search-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 850px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 100;
}

.bottom-search-container.active {
    opacity: 1;
    pointer-events: all;
}

.rotating-titles-bottom {
    position: absolute;
    bottom: 100%;
    margin-bottom: 45px;
    left: 20px;
    font-size: 15px;
    color: #6b7280;
    height: 30px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.rotating-titles-bottom.show {
    opacity: 1;
}

.rotating-titles-bottom .title-item {
    position: absolute;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.rotating-titles-bottom .title-item.show {
    opacity: 1;
    transform: translateY(0);
}

.bottom-search {
    background: white;
    border-radius: 50px;
    padding: 8px 8px 8px 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 11;
}

.bottom-search:focus-within {
    box-shadow: 0 8px 12px rgba(168, 85, 247, 0.1), 0 16px 32px rgba(168, 85, 247, 0.15);
}

.questions-card-bottom {
    width: 100%;
    background: white;
    border-radius: 24px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: absolute;
    bottom: 100%;
    margin-bottom: 10px;
    left: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: max-height 0.5s ease, opacity 0.4s ease, transform 0.4s ease, padding 0.5s ease;
    padding-top: 0;
    padding-bottom: 0;
    z-index: 10;
}

.questions-card-bottom.active {
    max-height: 600px;
    opacity: 1;
    transform: translateY(0);
    padding-top: 15px;
    padding-bottom: 15px;
}

@media (max-width: 900px) {
    .container {
        padding: 0 10px;
    }

    .bottom-search-container {
        width: calc(100% - 40px);
    }
}

@media (max-width: 768px) {
    .logo-text {
        font-size: 24px;
    }

    .header-container.compact .logo-text {
        font-size: 20px;
    }

    .tagline {
        font-size: 22px;
    }

    .search-btn {
        padding: 14px 20px;
        min-width: 50px;
    }

    .search-btn-text {
        display: none;
    }

    .search-btn-icon {
        display: inline;
    }

    .rotating-titles,
    .rotating-titles-bottom {
        font-size: 13px;
        left: 15px;
    }

    .question-text {
        font-size: 14px;
    }

    .ad-links {
        flex-wrap: wrap;
        gap: 10px;
    }

    .user-question {
        padding: 12px 16px;
    }

    .question-title {
        font-size: 16px;
    }

    .answer-text {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .header-container {
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .header-container.compact {
        margin-bottom: 15px;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .header-container.compact .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .logo-text {
        font-size: 20px;
    }

    .header-container.compact .logo-text {
        font-size: 18px;
    }

    .tagline {
        font-size: 18px;
        margin-bottom: 30px;
    }

    .back-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .search-box,
    .bottom-search {
        padding: 6px 6px 6px 16px;
    }

    .search-input {
        font-size: 14px;
    }

    .search-btn {
        padding: 12px 16px;
    }

    .help-title {
        font-size: 14px;
    }

    .help-text {
        font-size: 13px;
    }

    .ad-section {
        padding: 16px;
    }

    .ad-title {
        font-size: 16px;
    }

    .ad-description {
        font-size: 13px;
    }

    .question-item {
        padding: 14px 16px;
    }

    .related-questions {
        padding: 20px;
        margin-bottom: 100px;
    }
}

/* to fix ios mobile issues */
html, body {
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 850px;
    overflow-x: hidden;
}

*, *::before, *::after {
    min-width: 0;
}
