/* 基本設定 */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #121212;
    color: #E0E0E0;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

html {
    height: 100%;
}

/* ヘッダー */
header {
    background-color: #1F1F1F;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

header .logo {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

header .logo .main-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #E0E0E0;
}

header .logo .sub-title {
    font-size: 0.9em;
    font-weight: 400;
    color: #B0B0B0;
}

header nav {
    display: flex;
    gap: 15px;
}

header nav a {
    text-decoration: none;
    color: #E0E0E0;
    font-weight: 500;
    transition: color 0.3s;
}

header nav a:hover {
    color: #FFD700;
}

/* メインコンテナ */
main {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100% - 60px);
    overflow: hidden;
}

.chat-container {
    background-color: #1F1F1F;
    width: 100%;
    max-width: 600px;
    height: 90%;
    max-height: calc(100vh - 40px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #333333;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 100%;
    background-color: #1F1F1F;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 80%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user {
    background-color: #007BFF;
    color: #FFFFFF;
    align-self: flex-end;
}

.message.bot {
    background-color: #333333;
    color: #E0E0E0;
    align-self: flex-start;
}

/* 入力エリア */
.chat-input {
    display: flex;
    border-top: 1px solid #333333;
}

.chat-input input {
    flex-grow: 1;
    padding: 15px;
    border: none;
    outline: none;
    font-size: 1em;
    background-color: #1F1F1F;
    color: #E0E0E0;
}

.chat-input button {
    background-color: #007BFF;
    color: #FFFFFF;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.chat-input button:hover {
    background-color: #0056b3;
}

/* フッター */
footer {
    background-color: #1F1F1F;
    padding: 10px 20px;
    text-align: center;
    color: #E0E0E0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.5);
}

/* ボタンエリア */
.button-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-top: 1px solid #333333;
    background-color: #1F1F1F;
    gap: 10px;
}

.button-controls button,
.audio-label {
    background-color: #007BFF;
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}

.button-controls button:hover,
.audio-label:hover {
    background-color: #0056b3;
}

.recording-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.recording-controls button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    border-radius: 5px;
}

.recording-controls button:hover {
    background-color: #0056b3;
}

.recording-controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* ファイルアップロード用モーダル */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
}

.modal-content {
    background: #FFFFFF;
    color: #333333;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: popupFadeIn 0.3s ease-in-out;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.2em;
}

.modal-content input[type="file"] {
    display: block;
    margin: 0 auto 20px auto;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.modal-buttons button {
    background-color: #007BFF;
    color: #FFFFFF;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    flex: 1;
    font-size: 1em;
}

.modal-buttons button:hover {
    background-color: #0056b3;
}

/* ポップアップ */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.popup {
    position: relative;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 500px;
    width: 80%;
    text-align: center;
    z-index: 1001;
    animation: popupFadeIn 0.3s ease-in-out;
}

#popup-text {
    font-size: 16px;
    color: #333333;
    margin-bottom: 20px;
}

.close-popup {
    background-color: #007BFF;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.close-popup:hover {
    background-color: #0056b3;
}

/* アニメーション */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* レスポンシブ */
@media (max-width: 768px) {
    header nav {
        display: none;
    }

    header .menu-toggle {
        display: block;
        cursor: pointer;
    }

    .chat-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}
