@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
}

.sidebar-item {
    transition: all 0.3s ease;
}

.sidebar-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid #6366f1;
}

.sidebar-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    border-left: 4px solid #6366f1;
}

.step-indicator {
    transition: all 0.3s ease;
}

.step-indicator.active {
    background: #6366f1;
    color: white;
}

.step-indicator.completed {
    background: #10b981;
    color: white;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* チャット形式のトランスクリプション */
.transcription-item {
    animation: slideIn 0.3s ease-out;
    margin-bottom: 1rem;
}

.transcription-item.group1 {
    display: flex;
    justify-content: flex-start;
}

.transcription-item.group2 {
    display: flex;
    justify-content: flex-end;
}

.transcription-bubble {
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    position: relative;
}

.transcription-item.group1 .transcription-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-left-radius: 0.25rem;
}

.transcription-item.group2 .transcription-bubble {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.transcription-speaker {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.transcription-text {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.transcription-translation {
    font-size: 1rem;
    line-height: 1.6;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.95;
}

.transcription-time {
    font-size: 0.75rem;
    opacity: 0.7;
    position: absolute;
    top: 0.75rem;
    right: 1rem;
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* トランスクリプションコンテナのスクロール設定 */
.transcription-container {
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    min-height: 500px;
    scroll-behavior: smooth;
    padding: 1.5rem;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .transcription-container {
        max-height: calc(100vh - 380px);
        min-height: 400px;
        padding: 1rem;
    }
    
    .transcription-bubble {
        max-width: 85%;
        padding: 0.875rem 1rem;
    }
    
    .transcription-text {
        font-size: 1rem;
    }
    
    .transcription-translation {
        font-size: 0.9375rem;
    }
}

@media (max-width: 1023px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 40;
        transition: transform 0.3s ease-in-out;
    }
    
    #sidebar.-translate-x-full {
        transform: translateX(-100%);
    }
}

/* スクロールバーのスタイリング */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* トランスクリプションコンテナ専用のスクロールバー */
.transcription-container::-webkit-scrollbar {
    width: 6px;
}

.transcription-container::-webkit-scrollbar-track {
    background: transparent;
}

.transcription-container::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 3px;
}

.transcription-container::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.5);
}

/* モーダルのスタイル */
.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* トランジション */
.transition-all {
    transition: all 0.3s ease;
}

/* フォーカススタイル */
input:focus, select:focus, textarea:focus {
    outline: none;
    ring: 2;
    ring-color: #6366f1;
}

/* ボタンホバーエフェクト */
button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}

/* ローディングアニメーション */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* パルスアニメーション */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* スクロール位置インジケーター */
.scroll-indicator {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.9), transparent);
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
}

.scroll-indicator.hidden {
    display: none;
}

/* 空の状態表示 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* トグルスイッチのスタイル */
.peer:checked ~ div {
    background-color: #4F46E5;
}

.peer:checked ~ div:after {
    transform: translateX(100%);
    border-color: white;
}

/* モーダルオーバーレイのアニメーション */
.modal-overlay {
    animation: fadeIn 0.2s ease-out;
}

/* ユーザー設定カードホバーエフェクト */
.user-settings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 既存のスタイルに追加 */

/* テーブルのレスポンシブ対応 */
@media (max-width: 768px) {
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.5rem !important;
    }
}

/* テーブル行のホバーエフェクト */
tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: rgba(249, 250, 251, 1);
}

/* グループヘッダーのグラデーション */
.bg-indigo-600 {
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
}

.bg-purple-600 {
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
}

/* トグルスイッチのアニメーション強化 */
.peer:checked ~ div {
    background-color: #4F46E5;
}

.peer:checked ~ div:after {
    transform: translateX(100%);
    border-color: white;
}

.peer:focus ~ div {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* ステータスバッジ */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* グループボタンのホバーエフェクト */
button[onclick^="applyGroupSettings"] {
    transition: all 0.2s ease;
}

button[onclick^="applyGroupSettings"]:hover {
    transform: translateY(-1px);
}

button[onclick^="applyGroupSettings"]:active {
    transform: translateY(0);
}

/* モーダルのスクロールバースタイル */
.overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* グループヘッダーのボタンレイアウト */
.bg-indigo-600 button,
.bg-purple-600 button {
    font-weight: 500;
    letter-spacing: 0.025em;
}

.bg-indigo-600 button:hover,
.bg-purple-600 button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bg-indigo-600 button:active,
.bg-purple-600 button:active {
    transform: translateY(0);
}

/* ボタンアイコンの間隔 */
button i.fas {
    margin-right: 0.25rem;
}

/* レスポンシブ対応: モバイルでボタンを縦並び */
@media (max-width: 640px) {
    .bg-indigo-600 > div,
    .bg-purple-600 > div {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bg-indigo-600 button,
    .bg-purple-600 button {
        width: 100%;
        justify-content: center;
    }
}

/* グループヘッダーのグラデーション強化 */
.bg-indigo-600 {
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.bg-purple-600 {
    background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

/* 一括設定セクションのスタイル */
.bg-gradient-to-r {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ボタングループのホバーエフェクト */
button[onclick^="applyGroupSettings"],
button[onclick^="applyAllUsersSettings"] {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

button[onclick^="applyGroupSettings"]::before,
button[onclick^="applyAllUsersSettings"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button[onclick^="applyGroupSettings"]:active::before,
button[onclick^="applyAllUsersSettings"]:active::before {
    width: 300px;
    height: 300px;
}

/* テーブルヘッダーのスタイル改善 */
thead th {
    background: linear-gradient(to bottom, #F9FAFB 0%, #F3F4F6 100%);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 状態バッジのアニメーション */
.status-badge {
    animation: fadeIn 0.3s ease-in;
}

/* ツールチップスタイル（オプション） */
[title] {
    position: relative;
    cursor: help;
}

/* モバイル最適化 */
@media (max-width: 768px) {
    .modal-overlay > div {
        max-height: 95vh;
        margin: 2.5vh 0;
    }
    
    /* ボタンテキストを短縮表示 */
    button span {
        display: none;
    }
    
    button i {
        margin-right: 0 !important;
    }
}

/* 更新ボタンのアニメーション */
button[onclick*="loadSessionUsers"] i {
    transition: transform 0.3s ease;
}

button[onclick*="loadSessionUsers"]:hover i {
    transform: rotate(180deg);
}

.help-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: auto;
    animation: fadeIn 0.2s ease-out;
}

/* 既存のスタイルに追加 */

/* ヘルプボタンとツールチップ */
.help-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #6366f1;
    color: white;
    font-size: 11px;
    cursor: help;
    margin-left: 6px;
    transition: all 0.2s ease;
}

.help-button:hover {
    background-color: #4f46e5;
    transform: scale(1.1);
}

.tooltip {
    position: absolute;
    z-index: 1000;
    padding: 8px 12px;
    background-color: #1f2937;
    color: white;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 280px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tooltip.show {
    opacity: 1;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 12px;
    width: 8px;
    height: 8px;
    background-color: #1f2937;
    transform: rotate(45deg);
}

/* 設定トグルボタン */
.setting-toggle-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.setting-toggle-btn.enabled {
    background-color: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.setting-toggle-btn.disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    border-color: #d1d5db;
}

.setting-toggle-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.setting-toggle-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.setting-toggle-btn i {
    font-size: 14px;
}

/* 設定グループ */
.settings-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* インポートモーダル */
.import-session-card {
    transition: all 0.2s ease;
    cursor: pointer;
}

.import-session-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.import-session-card.selected {
    border-color: #4f46e5;
    background-color: #eef2ff;
}

/* ステップインジケーター更新 */
.step-indicator {
    transition: all 0.3s ease;
    min-width: 40px;
    min-height: 40px;
}

.step-indicator.active {
    background: #6366f1;
    color: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.step-indicator.completed {
    background: #10b981;
    color: white;
}

#group1AudioButton.bg-green-600,
#group2AudioButton.bg-green-600 {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}