/* ================================================================================ */
/* 【AI Interaction Interface スタイルシート Ver. Final】                        */
/* ================================================================================ */

/* --- 基本設定 --- */
body {
    background-color: #08080C; 
    color: #ffffff;
    font-family: 'Outfit', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

#app-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* --- AIコア & 背景演出 --- */
#visual-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transition: filter 0.8s ease-out, opacity 0.6s ease-out;
}
#visual-container.blurred { filter: blur(20px); }

#canvas-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    mix-blend-mode: screen;
}

#vignette-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, rgba(36, 36, 44, 0) 40%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 2;
    pointer-events: none;
    transition: background 1.5s ease-in-out;
}

/* --- AIからの応答表示 --- */
#response-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1003;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    padding: 50px;
    box-sizing: border-box;
    cursor: pointer;
}

#response-overlay.active {
    opacity: 1;
    visibility: visible;
}

#response-container {
    max-height: 70vh;
    overflow-y: auto;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#response-text {
    font-size: 36px;
    font-weight: 300;
    line-height: 1.6;
    max-width: 900px;
    text-align: center;
    background: linear-gradient(90deg, rgba(180, 100, 255, 1), rgba(80, 200, 255, 1));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: fadeInText 1.0s ease-out forwards;
    white-space: pre-wrap;
    word-wrap: break-word;
}

@keyframes fadeInText {
    from { opacity: 0; transform: translateY(30px) scale(0.95); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0px) scale(1); filter: blur(0px); }
}

/* --- チャット入力インターフェース --- */
#chat-interface {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    z-index: 1002;
    width: 90%;
    max-width: 800px;
    transition: opacity 0.5s, transform 0.5s;
}

#chat-interface.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(50px);
    pointer-events: none;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: rgba(15, 15, 20, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 5px 10px;
    flex-grow: 1;
    margin-right: 15px;
    backdrop-filter: blur(20px);
}

#chat-input {
    background: transparent; border: none; color: white;
    font-size: 16px; padding: 12px 15px; flex-grow: 1; outline: none;
}

#chat-input::placeholder { color: rgba(255, 255, 255, 0.5); }

.utility-button {
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
    padding: 8px;
}
.utility-button:hover { opacity: 1; }
.utility-button svg { transition: filter 0.3s; }
.utility-button.recording svg { filter: drop-shadow(0 0 5px red); }

#send-button {
    background-color: transparent; border: 1px solid rgba(50, 120, 255, 0.4); color: white;
    padding: 14px 25px; font-size: 16px; font-weight: bold; border-radius: 12px;
    cursor: pointer; transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 20px rgba(50, 120, 255, 0.3);
}

#send-button:hover {
    background-color: rgba(50, 120, 255, 0.2);
    box-shadow: 0 0 30px rgba(50, 120, 255, 0.7);
}

/* --- ケアモード & 演出関連 --- */
#background-gradient-overlay {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    pointer-events: none;
    background: linear-gradient(45deg, #00F260, #0575E6, #43e97b, #00F260);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

#background-gradient-overlay.care-mode {
    opacity: 1;
}

body.care-mode-active #vignette-overlay {
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.15) 40%, rgba(0, 0, 0, 0.65) 100%);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#camera-feed {
    position: fixed;
    display: none;
}

#camera-feed.mini-window {
    display: block;
    top: 20px; right: 20px;
    width: 200px; height: 150px;
    border-radius: 15px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 1000;
    object-fit: cover;
    transform: none;
    transition: all 0.5s ease-in-out;
}

#capture-button.care-mode-active {
    display: flex;
}

#transition-overlay {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: #08080C;
    z-index: 9990;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

#transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#analysis-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1010;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(8, 8, 12, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

#analysis-overlay.active {
    opacity: 1;
    visibility: visible;
}

#analysis-text {
    color: white;
    font-size: 20px;
    text-align: center;
}

#video-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 1010;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(8, 8, 12, 0.7);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
}

#video-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#video-container {
    position: relative;
    width: 70%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#youtube-player {
    border-radius: 12px;
    overflow: hidden;
}

#video-close-button {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}
#video-close-button:hover { opacity: 1; }

#ai-commentary {
    margin-top: 20px;
    font-size: 18px;
    max-width: 70%;
    text-align: center;
    line-height: 1.5;
}