* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Sans', 'Yu Gothic', sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #ffdde1 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* ヘッダーのスタイル */
.top-header {
    background-color: #1f2937;
    color: white;
    padding: 8px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.top-header a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    font-size: 18px;
}

.top-header img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* メインコンテンツエリア */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 56px 20px 20px; /* ヘッダーの高さ分のパディング + 左右の余白 */
}

.chat-container {
    width: 100%;
    max-width: 900px; /* PC表示での最大幅 */
    height: calc(100vh - 96px); /* ビューポートの高さ - ヘッダー - 余白 */
    max-height: 800px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* スマホ表示用のレスポンシブ設定 */
@media (max-width: 768px) {
    .main-content {
        padding: 56px 10px 10px;
    }
    
    .chat-container {
        max-width: 500px;
        height: calc(100vh - 76px);
    }
}

.chat-header {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    padding: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chat-header .subtitle {
    font-size: 12px;
    font-weight: normal;
    display: block;
    margin-top: 8px;
    opacity: 0.95;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-messages.no-scroll {
    scroll-behavior: auto;
}

.message {
    margin: 15px 0;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background: #e3f2fd;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    max-width: 80%;
    margin-left: auto;
    border: 2px solid #2196f3;
    position: relative;
}

.bot-message {
    background: linear-gradient(45deg, #ff9a9e, #fecfef);
    color: #333;
    padding: 15px 20px;
    border-radius: 18px 18px 18px 4px;
    max-width: 80%;
    margin-right: auto;
    border: 2px solid #ff69b4;
    position: relative;
    font-weight: 500;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 105, 180, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 105, 180, 0.6), 0 0 30px rgba(255, 105, 180, 0.3); }
}

.message-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
}

.message-label .department {
    font-size: 10px;
    color: #999;
    font-weight: normal;
    display: inline-block;
    margin-top: 2px;
}

.like-button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 15px;
    transition: all 0.3s ease;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.like-button:hover {
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.1);
}

.like-button.liked {
    color: #ff6b6b;
    animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.like-count {
    font-weight: bold;
    color: #666;
    margin-left: 3px;
}

.like-count.mega-likes {
    color: #ff6b6b;
    font-size: 20px;
    font-weight: 900;
    animation: glow 2s infinite;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.8);
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 5px rgba(255, 107, 107, 0.3); }
    50% { text-shadow: 0 0 15px rgba(255, 107, 107, 0.8), 0 0 25px rgba(255, 107, 107, 0.4); }
}

.like-explosion {
    position: absolute;
    pointer-events: none;
    font-size: 20px;
    animation: explode 1s ease-out forwards;
}

@keyframes explode {
    0% {
        opacity: 1;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.5) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(360deg);
    }
}

.chat-input-container {
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-top: 1px solid #eee;
}

.chat-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.3);
}

.send-button {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.input-wrapper {
    position: relative;
}
