/**
 * プロジェクト画面 - モーダル
 *
 * 初回ヒアリング用のモーダルスタイル
 */

/* モーダルオーバーレイ（背景） */
.project-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* モーダルが表示されている状態 */
.project-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* モーダルコンテンツ */
.project-modal-content {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

/* モーダルが表示されている時のコンテンツ */
.project-modal-overlay.active .project-modal-content {
    transform: scale(1);
}

/* モーダルヘッダー */
.project-modal-header {
    margin-bottom: 24px;
}

.project-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.project-modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* モーダルボディ */
.project-modal-body {
    margin-bottom: 24px;
}

.project-modal-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.project-modal-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-modal-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

.project-modal-textarea::placeholder {
    color: var(--text-tertiary);
}

/* モーダルフッター */
.project-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.project-modal-button {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.project-modal-button:hover {
    transform: translateY(-1px);
}

.project-modal-button:active {
    transform: translateY(0);
}

.project-modal-button-primary {
    background-color: var(--color-primary);
    color: var(--text-on-primary);
}

.project-modal-button-primary:hover {
    background-color: var(--color-primary-hover);
}

.project-modal-button-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.project-modal-button-secondary:hover {
    background-color: var(--hover-bg);
}

/* ヒントテキスト */
.project-modal-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-bottom: 0;
}

/* ストリーミング表示エリア */
.project-modal-streaming {
    padding: 24px;
}

.streaming-header {
    text-align: center;
    margin-bottom: 24px;
}

.streaming-spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.streaming-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.streaming-preview {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    max-height: 400px;
    overflow: hidden;
}

.streaming-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease-in;
}

.streaming-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
    white-space: pre-wrap;
    font-family: 'Monaco', 'Courier New', monospace;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

/* スクロールバーのスタイル */
.streaming-content::-webkit-scrollbar {
    width: 8px;
}

.streaming-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.streaming-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.streaming-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

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

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .project-modal-content {
        padding: 24px;
        width: 95%;
    }

    .project-modal-title {
        font-size: 20px;
    }

    .project-modal-textarea {
        min-height: 120px;
    }

    .streaming-preview {
        max-height: 300px;
    }

    .streaming-content {
        max-height: 200px;
    }
}
