body {
    background-color: #ffffff;
    color: #333333;
}

.card {
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out;
}

.paper-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #ffffff;
    display: flex; /* from edited code, maintain flex layout */
    flex-direction: column; /* from edited code, maintain flex layout */

}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.3s ease forwards;
    margin-bottom: 0.5rem; /* from edited code */
    padding: 0.75rem; /* from edited code */
    border-radius: 0.4rem; /* from edited code */
    max-width: 75%; /* from edited code */
    word-wrap: break-word; /* from edited code */
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.you-message {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    align-self: flex-end; /* from edited code */
}

.ai-message {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    align-self: flex-start; /* from edited code */
}

.system-message {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.chat-message p {
    margin: 0.5rem 0 0 0;
}

.btn-primary {
    background-color: #1976d2;
    border-color: #1976d2;
}

.btn-primary:hover {
    background-color: #1565c0;
    border-color: #1565c0;
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.search-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.search-spinner.show {
    display: flex;
}

#summary-section {
    transition: all 0.3s ease-in-out; /* from edited code */
    overflow: hidden;
}

#summary-section.compact {
    max-height: 200px;
}

#summary-section:not(.compact) {
    max-height: none;
}

#loading-summary {
    padding: 2rem 0;
    transition: opacity 0.3s ease-out; /* from edited code */
}

#summary-content {
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out; /* from edited code */
}

#summary-content.visible {
    opacity: 1;
    transform: translateY(0);
}

#chat-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out; /* from edited code */
}

#chat-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.summary-text {
    white-space: pre-line;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

.typing-indicator {
    display: none;
    padding: 15px;
    background-color: #e3f2fd;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.3s ease forwards;
}

.typing-indicator.visible {
    display: flex;
    align-items: center;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #1976d2;
    border-radius: 50%;
    margin: 0 3px;
    display: inline-block;
    animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

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

#send-message {
    transition: all 0.3s ease;
}

#send-message.stopping {
    background-color: #dc3545;
    border-color: #dc3545;
}

#send-message .stop-icon {
    font-size: 1.2rem;
}

.summary-text {
    white-space: pre-line;
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.formatted-content {
    position: relative;
    padding: 1.5rem;
    background: #fcfcfc;
    border-radius: 8px;
}

.formatted-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 10%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#summary-section.compact .formatted-content::before {
    opacity: 1;
}

.formatted-content a {
    color: #1976d2;
    text-decoration: none;
    border-bottom: 1px dashed #1976d2;
    transition: border-bottom-color 0.2s ease;
}

.formatted-content a:hover {
    border-bottom-color: transparent;
}

.formatted-content p {
    margin-bottom: 1.2rem;
}

.formatted-content p:last-child {
    margin-bottom: 0;
}

/* 検索履歴リストの自分の検索用スタイル */
.search-history-item.my-search {
    background-color: #f0f9ff;
    border-left: 3px solid #3490dc;
}

.search-history-item.my-search .text-success {
    font-size: 0.75rem;
    background-color: #dcf8e6;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
}