/* ============================================================
   Claude コード分類ツール スタイル v1.1
   Prefix: ccp-
============================================================ */

/* コンテナ */
#ccp-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ccp-inner {
    background: #ffffff;
    padding: 2rem;
    border-radius: 16px;
}

/* ヘッダー */
.ccp-header {
    text-align: center;
    margin-bottom: 2rem;
}

#ccp-container h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.ccp-description {
    font-size: 0.9375rem;
    color: #64748b;
    margin: 0;
}

/* ステップ */
.ccp-step {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.ccp-step:hover {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
}

.ccp-step-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.ccp-step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================================
   モードセレクタ
============================================================ */
.ccp-mode-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.ccp-mode-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.ccp-mode-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ccp-mode-btn {
    padding: 0.5rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ccp-mode-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f0f4ff;
}

.ccp-mode-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.35);
}

/* 入力テキストエリア */
#ccp-input {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    background: #f8fafc;
    resize: vertical;
    box-sizing: border-box;
    transition: all 0.3s ease;
    line-height: 1.5;
    color: #334155;
    margin-bottom: 1rem;
}

#ccp-input:focus {
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    outline: none;
}

#ccp-input::placeholder {
    color: #94a3b8;
}

/* 入力エリア下のボタン＋ヒント */
.ccp-input-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.ccp-tip {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    flex: 1;
    min-width: 200px;
}

/* 抽出ボタン */
#ccp-parse-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    white-space: nowrap;
}

#ccp-parse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
}

/* 抽出数インフォ */
.ccp-files-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 1.25rem;
}

.ccp-files-info::before {
    content: "📊";
}

/* ============================================================
   ファイルカード
============================================================ */
#ccp-file-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ccp-file-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ccp-file-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.12);
}

/* カードヘッダー */
.ccp-file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
    gap: 1rem;
    flex-wrap: wrap;
}

.ccp-file-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.ccp-file-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ccp-file-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    word-break: break-all;
}

/* 個別ダウンロードボタン */
.ccp-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.ccp-dl-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(102, 126, 234, 0.45);
}

/* メタ情報（行数/文字数） */
.ccp-file-meta {
    padding: 0.4rem 1.25rem;
    font-size: 0.8125rem;
    color: #94a3b8;
    background: #fafafa;
    border-bottom: 1px solid #e2e8f0;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

/* コードエリア */
.ccp-code-wrap {
    padding: 0;
}

.ccp-code-area {
    width: 100%;
    min-height: 260px;
    max-height: 600px;
    padding: 1rem 1.25rem;
    border: none;
    outline: none;
    font-size: 0.8125rem;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    background: #0f172a;
    color: #e2e8f0;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.65;
    display: block;
    transition: background 0.2s ease;
}

.ccp-code-area:focus {
    background: #0d1526;
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(102, 126, 234, 0.5);
}

.ccp-code-area::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.ccp-code-area::-webkit-scrollbar-track  { background: #1e293b; }
.ccp-code-area::-webkit-scrollbar-thumb  { background: #475569; border-radius: 4px; }

/* ============================================================
   STEP 3: ダウンロードボタンエリア
============================================================ */
.ccp-download-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

#ccp-zip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

#ccp-zip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

#ccp-zip-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#ccp-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.25);
}

#ccp-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.35);
}

/* ============================================================
   ローディング
============================================================ */
#ccp-loading {
    text-align: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    color: #92400e;
    font-weight: 600;
    margin-top: 1rem;
    animation: ccp-pulse 1.5s ease-in-out infinite;
}

#ccp-loading::before { content: "⏳ "; }

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

/* ============================================================
   通知トースト
============================================================ */
.ccp-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 420px;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   レスポンシブ
============================================================ */
@media (max-width: 768px) {
    #ccp-container {
        margin: 1rem;
        padding: 1.25rem;
    }

    .ccp-inner {
        padding: 1.25rem;
    }

    #ccp-container h3 {
        font-size: 1.375rem;
    }

    .ccp-mode-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    .ccp-file-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ccp-dl-btn {
        width: 100%;
        justify-content: center;
    }

    .ccp-download-buttons {
        flex-direction: column;
    }

    #ccp-zip-btn,
    #ccp-reset-btn {
        width: 100%;
        justify-content: center;
    }

    .ccp-input-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    #ccp-parse-btn {
        width: 100%;
        justify-content: center;
    }

    .ccp-code-area {
        min-height: 200px;
    }
}
