/**
 * AI木曜会 スタイル
 * AIフレンズのカラースキーム（水色系）に合わせたデザイン
 */

/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* WordPress管理バーとの競合を避ける */
html {
    margin-top: 0 !important;
}

body.ai-thursday-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #111;
    color: #fff;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* WordPressのデフォルトスタイルをリセット */
body.ai-thursday-page #content,
body.ai-thursday-page #inner-content,
body.ai-thursday-page .wrap,
body.ai-thursday-page .container,
body.ai-thursday-page .entry-content,
body.ai-thursday-page #main {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Fincs風ダークモードデザイン */
:root {
    --header-height: 60px;
    --sidebar-width: 200px;
    --primary-color: #03A9F4;     /* メインカラー（水色） */
    --primary-dark: #0288D1; /* 濃いめのメインカラー */
    --secondary-color: #00BCD4;   /* セカンダリーカラー（ターコイズ） */
    --secondary-dark: #0097A7; /* 濃いめのセカンダリーカラー */
    --background-color: #000;     /* 背景色（黒） */
    --surface-color: #111;        /* カード背景色 */
    --surface-light: #1a1a1a;  /* 明るめの背景色 */
    --text-color: #fff;           /* メインテキスト */
    --text-secondary: #aaa; /* セカンダリーテキスト */
    --border-color: #333;         /* ボーダー色 */
    --tab-height: 40px;
}

/* アプリコンテナ */
.ai-thursday-container {
    display: grid;
    grid-template-areas:
        "header header"
        "content content"
        "footer footer";
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-height) 1fr auto;
    min-height: 100vh;
    background-color: var(--background-color);
    color: var(--text-color);
}

.ai-thursday-content {
    grid-area: content;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-areas: "sidebar main";
}

/* ヘッダー */
.ai-thursday-header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-tabs {
    flex: 1;
    display: flex;
    justify-content: center;
}

.tab-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tab-nav-item {
    margin: 0 5px;
}

.tab-nav-link {
    display: flex;
    align-items: center;
    padding: 0 15px;
    height: var(--tab-height);
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-nav-link:hover {
    color: var(--text-color);
    border-bottom-color: var(--primary-color);
}

.tab-nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-nav-link i {
    margin-right: 8px;
}

/* サイドバー */
.ai-thursday-sidebar {
    grid-area: sidebar;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 20px 10px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-list {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

.sidebar-list-item {
    margin: 2px 0;
}

.sidebar-list-link {
    display: block;
    padding: 8px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-list-link:hover {
    background-color: var(--surface-light);
    color: var(--text-color);
    border-left-color: var(--primary-color);
}

.sidebar-list-link.active {
    background-color: var(--surface-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

/* メインコンテンツエリア */
.ai-thursday-main {
    grid-area: main;
    padding: 20px;
    overflow-y: auto;
}

/* チャットサイドバー */
.chat-sidebar {
    background: var(--surface-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 2rem);
    position: sticky;
    top: var(--header-height);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chat-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ビデオグリッド */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* リソースグリッド */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 20px;
}

.resource-card {
    display: flex;
    background-color: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.resource-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    background-color: var(--primary-dark);
    color: var(--text-color);
    font-size: 24px;
}

.resource-info {
    flex: 1;
    padding: 15px;
}

.resource-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
}

.resource-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.resource-actions {
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.resource-download-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s ease;
}

.resource-download-btn:hover {
    background-color: var(--primary-dark);
}

/* コンテンツカード */
.content-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.content-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--surface-color);
}

.content-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.content-card-body {
    flex: 1;
    overflow-y: auto;
}

/* チャットメッセージ */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 8px;
    background-color: var(--surface-light);
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.message-author {
    font-weight: 600;
    color: var(--primary-color);
}

.message-time {
    color: var(--text-secondary);
}

.message-content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    word-break: break-word;
}

/* チャット入力 */
.chat-input-container {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background-color: var(--surface-color);
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-light);
    color: var(--text-color);
    font-size: 14px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.send-button:hover {
    background-color: var(--primary-dark);
}

/* ビデオカード */
.video-card {
    background-color: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.video-thumbnail {
    position: relative;
    padding-top: 56.25%; /* 16:9 アスペクト比 */
    background-color: #000;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-card:hover .play-button {
    opacity: 1;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

/* フッター */
.footer {
    grid-area: footer;
    padding: 20px;
    text-align: center;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 992px) {
    .ai-thursday-content {
        grid-template-columns: 1fr;
        grid-template-areas: "main";
    }
    
    .ai-thursday-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-tabs {
        overflow-x: auto;
    }
    
    .tab-nav {
        width: 100%;
        justify-content: flex-start;
    }
    
    .tab-nav-link {
        white-space: nowrap;
    }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #888;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-tabs {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #03A9F4; 
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* WordPressのヘッダーとフッターを非表示にする */
.page-template-page-ai-thursday #header,
.page-template-page-ai-thursday .header,
.page-template-page-ai-thursday #footer,
.page-template-page-ai-thursday .footer {
    display: none !important;
}

/* WordPressのコンテンツエリアを全幅にする */
.page-template-page-ai-thursday #content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* WordPressのメインコンテナを全幅にする */
.page-template-page-ai-thursday #container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#wpadminbar{
    display: none;
}
