/* --- Home Components --- */
.main-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 0.05em;
}

/* Chat Input Large */
.chat-input-wrapper-large {
    background: #F3F6F9;
    padding: 2rem 2.5rem;
    border-radius: 24px;
    width: 600px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    cursor: text;
    transition: box-shadow 0.2s;
}

.chat-input-wrapper-large:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chat-input-large {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: #718096;
    font-weight: 700;
    outline: none;
    text-align: center;
}

.chat-input-large::placeholder {
    color: #A0AEC0;
}

.chat-brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.longcat-logo {
    width: 24px;
    height: 24px;
}

.brand-name {
    color: #A0AEC0;
    font-size: 0.9rem;
}

.home-chat-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-history-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    color: #A0AEC0;
    border: 2px solid #E2E8F0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-history-btn:hover {
    background: #EDF2F7;
    color: var(--primary);
}

.chat-submit-btn-large {
    background: #2C3E50;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background 0.2s;
}

.chat-submit-btn-large:hover {
    transform: scale(1.1);
    background: #34495E;
}

/* Play Button */
.btn-play {
    background: #F3F6F9;
    border: 2px solid #CBD5E0;
    color: var(--primary);
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-play:hover {
    background: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-play i {
    font-size: 1.5rem;
}

/* --- Rule Cards --- */
.rules-search-container {
    display: none;
}

.view-more-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.view-more-btn {
    background: white;
    color: var(--primary);
    border: 2px solid #E2E8F0;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.view-more-btn:hover {
    background: #F7FAFC;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.rule-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: none;
    border: 1px solid #E2E8F0;
    transition: all 0.2s ease-out;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    height: 300px;
    overflow: hidden;
}

.rule-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    border-color: #CBD5E0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-icon-box {
    width: 48px;
    height: 48px;
    background: #F7FAFC;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 1px solid #EDF2F7;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1.4;
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-sub);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #F7FAFC;
}

.card-arrow-btn {
    width: 32px;
    height: 32px;
    background: #F7FAFC;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.rule-card:hover .card-arrow-btn {
    background: var(--primary);
    color: white;
}

.fine-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 900;
    color: #E53E3E;
    font-size: 1.1rem;
}



/* --- Chat Minimal Screen --- */
.chat-minimal-layout {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
}

.chat-minimal-header {
    padding: 2rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
}

.btn-text-back {
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    transition: opacity 0.2s;
}

.btn-text-back:hover {
    opacity: 0.7;
}

.chat-history-minimal {
    flex: 1;
    overflow-y: auto;
    padding: 100px 3rem 180px 3rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.chat-history-minimal::-webkit-scrollbar {
    display: none;
}

.message-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.message-row.user {
    align-items: flex-end;
}

.message-content-user {
    background: #F1F5F9;
    color: var(--primary);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    max-width: 80%;
    line-height: 1.6;
}

.message-row.ai {
    align-items: flex-start;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    margin-bottom: 0.5rem;
}

.ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.message-content-minimal {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--primary);
    font-weight: 500;
    width: 100%;
    background: transparent;
    padding: 0;
}

.rag-source-container {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.rag-reference-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #F7FAFC;
    border: 1px solid #EDF2F7;
    color: var(--text-sub);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: default;
    transition: background 0.2s;
}

.rag-reference-pill:hover {
    background: #EDF2F7;
    color: var(--primary);
}

.chat-input-container-minimal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem 0 3rem 0;
    background: linear-gradient(to top, white 80%, rgba(255, 255, 255, 0));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.input-pill {
    width: 100%;
    max-width: 700px;
    background: #F8FAFC;
    border-radius: 50px;
    padding: 0.8rem 1rem 0.8rem 2rem;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
    border: 1px solid transparent;
}

.input-pill:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    background: white;
    border-color: #E2E8F0;
}

.input-field-minimal {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    outline: none;
    color: var(--primary);
    font-weight: 500;
}

.input-field-minimal::placeholder {
    color: #CBD5E0;
    font-weight: 700;
}

.send-btn-minimal {
    width: 48px;
    height: 48px;
    background: #2C3E50;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.send-btn-minimal:hover {
    transform: scale(1.1);
    background: #1A202C;
}

.chat-footer-links {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: flex-end;
}

.text-link-small {
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.text-link-small:hover {
    opacity: 1;
    color: #E53E3E;
}

.generation-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #A0AEC0;
    margin-bottom: 0.5rem;
    height: 24px;
}

.generation-status img {
    width: 24px;
    height: 24px;
}

.text-loop-wrapper {
    position: relative;
    display: inline-block;
    height: 1.5em;
    /* Explicit height */
    line-height: 1.5em;
    overflow: hidden;
    min-width: 150px;
    font-family: var(--font-heading);
    /* Monospace like effect? Or just heading */
}

.text-loop-item {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    opacity: 0;
    /* Will be handled by GSAP */
}

/* Default state for non-JS fallback if needed, but GSAP handles it */
.text-loop-item.current {
    opacity: 1;
    position: relative;
}

/* Remove old blink animation CSS as generic text loop replaces it */

/* Reference Data Modal */
.ref-data-btn {
    margin-top: 1rem;
    background: #EDF2F7;
    border: 1px solid #CBD5E0;
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.ref-data-btn:hover {
    background: #E2E8F0;
    transform: translateY(-2px);
}

.reference-list-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reference-item {
    padding: 1rem;
    background: #F8FAFC;
    border: 1px solid #EDF2F7;
    border-radius: 12px;
}

.reference-title {
    font-weight: 900;
    font-size: 1.05rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reference-desc {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.reference-detail {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.5;
    background: white;
    padding: 0.8rem;
    border-radius: 8px;
}

/* Modal Content Components */
.modal-content-card {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 24px;
    padding: 0;
    position: relative;
    z-index: 1001;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: modal-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes modal-pop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-modal-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 10;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
}

.close-modal-btn:hover {
    background: #F7FAFC;
}

.modal-card-header {
    padding: 2.5rem 2rem 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    background: white;
    flex-shrink: 0;
    border-bottom: 1px solid #F7FAFC;
}

.modal-icon-box {
    width: 64px;
    height: 64px;
    background: #E3F2FD;
    color: #1976D2;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
}

#modal-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
}

.modal-card-body {
    padding: 1.5rem 2rem 3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E0 #F7FAFC;
}

.modal-card-body::-webkit-scrollbar {
    width: 8px;
}

.modal-card-body::-webkit-scrollbar-track {
    background: #F7FAFC;
}

.modal-card-body::-webkit-scrollbar-thumb {
    background-color: #CBD5E0;
    border-radius: 4px;
}

.modal-desc-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.6;
}

.modal-detail-text {
    font-size: 1rem;
    color: var(--text-sub);
    line-height: 1.8;
}

.modal-tags {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.fine-badge {
    background: #FFF5F5;
    color: #E53E3E;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-badge {
    background: #EDF2F7;
    color: var(--text-sub);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
}