/* SandboxCafe チャット機能スタイル */

/* チャット収納・展開機能 */
.chat-toggle-btn {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-left: auto;
    min-width: 40px;
}

.chat-toggle-btn:hover {
    background: linear-gradient(135deg, #654321 0%, #8B4513 100%);
    transform: scale(1.05);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.chat-section.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.chat-section.collapsed .chat-tabs,
.chat-section.collapsed .chat-messages,
.chat-section.collapsed .chat-input-area,
.chat-section.collapsed .disabled-notice {
    display: none;
}

.chat-section.collapsed .section-header h2 {
    display: none;
}

.main-content {
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 4fr 6fr;
    gap: 2rem;
}

/* 収納時: 1:9の比率 */
.main-content.chat-collapsed {
    grid-template-columns: 1fr 9fr;
}

/* 収納時の設定 */
.chat-section.collapsed {
    min-width: 0;
}

.chat-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #F5E6D3;
}

.chat-tab {
    background: none;
    border: none;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    color: #8B4513;
    font-weight: bold;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.chat-tab:hover {
    background: #F5E6D3;
    border-radius: 8px 8px 0 0;
}

.chat-tab.active {
    border-bottom-color: #CD853F;
    color: #A0522D;
}

.chat-messages {
    background: #FEFDFB;
    border: 2px solid #E5D5C8;
    border-radius: 10px;
    height: 300px;
    overflow-y: auto;
    padding: 1rem;
    margin-bottom: 1rem;
    scroll-behavior: smooth;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.8rem;
    border-radius: 10px;
    background: white;
    border-left: 4px solid #DEB887;
    box-shadow: 0 2px 5px rgba(139, 69, 19, 0.1);
}

.chat-message .sender {
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 0.3rem;
}

.chat-message .time {
    font-size: 0.8rem;
    color: #A0522D;
    opacity: 0.7;
}

.chat-message .content {
    color: #5D4037;
    line-height: 1.5;
}

.chat-input-area {
    display: flex;
    gap: 0.8rem;
}

.chat-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #E5D5C8;
    border-radius: 10px;
    background: white;
    color: #8B4513;
}

.chat-input:focus {
    outline: none;
    border-color: #CD853F;
    box-shadow: 0 0 0 3px rgba(205, 133, 63, 0.1);
}

.chat-send-btn {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.chat-send-btn:hover {
    background: linear-gradient(135deg, #654321 0%, #8B4513 100%);
    transform: translateY(-1px);
}

.welcome-message {
    text-align: center;
    background: linear-gradient(135deg, #F5E6D3 0%, #FAF0E6 100%);
    border: 2px solid #DEB887;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: #8B4513;
}

.welcome-message h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: #A0522D;
}

.welcome-message p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}