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

body {
font-family: 'Meiryo', 'メイリオ', 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', sans-serif;
    background: linear-gradient(135deg, #cecece 0%, #bababa 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Language Selector */
.language-selector {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.language-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 600px;
}

.language-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #333;
}

.language-container p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.language-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.language-btn {
    padding: 20px;
    font-size: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.language-btn:hover {
    background: linear-gradient(135deg, #cecece 0%, #939393 100%);
    color: white;
    border-color: #604879;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Chat Container */
.container {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #cecece 0%, #939393 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

.btn-change-language {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: rgba(126, 126, 126, 0.421);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-change-language:hover {
    background: rgba(39, 39, 39, 0.799);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.message.user {
    flex-direction: row-reverse;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    padding: 0 10px;
}

.controls {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.voice-status-container {
    display: flex;
    align-items: center;
    position: relative;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s;
}

#messageInput:focus {
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    color: white;
    background: rgba(86, 86, 86, 0.686);
    border: 1px solid rgba(255, 255, 255, 0.5);

}

.btn-primary:hover {
    background: rgba(39, 39, 39, 0.799);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.voice-controls {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-voice {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-record {
    background: #ff4757;
    color: white;
}

.btn-record.recording {
    animation: pulse 1.5s infinite;
    background: #ee5a6f;
}

.btn-record.continuous {
    animation: pulse 1.5s infinite;
    background: #ff4757;
}

.btn-stop {
    background: #ffa502;
    color: white;
}

.btn-play {
    background: #2ed573;
    color: white;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.btn-voice:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.btn-voice:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.status {
    position: absolute;
    right: 0;
    text-align: right;
    font-size: 13px;
    min-height: 20px;
    min-width: 150px;
}

.status-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-container.error {
    color: #ff4757;
}

.status-container.success {
    color: #23894e;
}

.status-container.recording {
    color: #ff4757;
    font-weight: 600;
}

.status-container.loading {
    color: #666;
}

.status-text {
    display: inline-block;
}


/* スピナー */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
