/* SandboxCafe サンドボックス（APIテスト・WEBアプリ生成）機能スタイル */

/* API選択・テスト機能 */
.api-selector {
    margin-bottom: 1.5rem;
}

.api-selector label {
    display: block;
    color: #8B4513;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.api-selector select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #E5D5C8;
    border-radius: 8px;
    background: white;
    color: #8B4513;
    font-size: 1rem;
}

.api-selector select:focus {
    outline: none;
    border-color: #CD853F;
    box-shadow: 0 0 0 3px rgba(205, 133, 63, 0.1);
}

.parameter-input {
    margin-bottom: 1.5rem;
}

.parameter-input label {
    display: block;
    color: #8B4513;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.parameter-input textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.8rem;
    border: 2px solid #E5D5C8;
    border-radius: 8px;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #FEFDFB;
    color: #8B4513;
}

.parameter-input textarea:focus {
    outline: none;
    border-color: #CD853F;
    box-shadow: 0 0 0 3px rgba(205, 133, 63, 0.1);
}

.execute-btn {
    background: linear-gradient(135deg, #CD853F 0%, #D2B48C 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(205, 133, 63, 0.3);
}

.execute-btn:hover {
    background: linear-gradient(135deg, #B8860B 0%, #CD853F 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(205, 133, 63, 0.4);
}

.result-display {
    background: #FEFDFB;
    border: 2px solid #E5D5C8;
    border-radius: 10px;
    padding: 1.5rem;
    min-height: 200px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    color: #8B4513;
    margin-bottom: 1rem;
}

.result-header {
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.result-content {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #ddd;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* WEBアプリ生成機能 */
.webapp-creation-section h3 {
    color: #8B4513;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.webapp-creation-section p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.webapp-form {
    margin-bottom: 1.5rem;
}

.webapp-form .form-group {
    margin-bottom: 1.5rem;
}

.webapp-form label {
    display: block;
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 0.5rem;
}

.webapp-form .form-input,
.webapp-form .form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E5D5C8;
    border-radius: 8px;
    font-size: 1rem;
}

.form-input, .form-textarea {
    padding: 0.8rem;
    border: 2px solid #E5D5C8;
    border-radius: 8px;
    background: white;
    color: #8B4513;
    font-size: 0.9rem;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #CD853F;
    box-shadow: 0 0 0 3px rgba(205, 133, 63, 0.1);
}

.required {
    color: #dc2626;
}

/* APIキー通知 */
.api-key-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 2px solid #FFB74D;
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.notice-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notice-content strong {
    color: #E65100;
    display: block;
    margin-bottom: 0.5rem;
}

.notice-content p {
    color: #BF360C;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* WEBアプリ統計・管理 */
.webapp-stats {
    background: #F5E6D3;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #CD853F;
}

.stats-item {
    font-weight: bold;
    color: #8B4513;
}

.webapps-list {
    background: #FAFAFA;
    border-radius: 8px;
    padding: 1rem;
    min-height: 120px;
}

.no-webapps {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
}

.webapp-item {
    background: white;
    border: 2px solid #E5D5C8;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.webapp-item:last-child {
    margin-bottom: 0;
}

.webapp-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.webapp-item-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #8B4513;
}

.webapp-item-status {
    background: #4CAF50;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.webapp-item-description {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.webapp-endpoint {
    background: #F3F4F6;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    color: #374151;
    margin: 0.5rem 0;
    word-break: break-all;
}

.webapp-item-info {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.8rem;
}

.webapp-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* URL管理セクション */
.url-management-section {
    background: #FEFDFB;
    border: 2px solid #E5D5C8;
    border-radius: 10px;
    padding: 1.5rem;
}

.url-management-section h3 {
    color: #8B4513;
    margin-bottom: 1rem;
}

.url-stats {
    background: linear-gradient(135deg, #F5E6D3 0%, #FAF0E6 100%);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 1rem;
    text-align: center;
}

.urls-list {
    max-height: 300px;
    overflow-y: auto;
}

.no-urls {
    text-align: center;
    color: #9CA3AF;
    padding: 2rem;
    font-style: italic;
}

.url-item {
    background: white;
    border: 1px solid #E5D5C8;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
}

.url-item:hover {
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.1);
    border-color: #CD853F;
}

.url-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.url-item-title {
    font-weight: bold;
    color: #8B4513;
    margin: 0;
    font-size: 1rem;
}

.url-item-status {
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    background: #d1fae5;
    color: #065f46;
}

.url-item-description {
    color: #6B7280;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.url-item-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    font-size: 0.8rem;
    color: #9CA3AF;
}

.url-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ボタンスタイル */
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy {
    background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
    color: white;
}

.btn-copy:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    transform: translateY(-1px);
}

.btn-test {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.btn-test:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

.btn-delete {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    transform: translateY(-1px);
}

/* ワークフロー進行状況バー */
.workflow-progress {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #F8F4E9 0%, #FEFDFB 100%);
    border-radius: 12px;
    border: 1px solid #E5D5C8;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #E5D5C8;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    min-width: 80px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E5D5C8;
    color: #8B4513;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.8rem;
    color: #8B4513;
    text-align: center;
    font-weight: 500;
}

.step.active .step-number {
    background: linear-gradient(135deg, #CD853F 0%, #8B4513 100%);
    color: white;
    animation: pulse 2s infinite;
}

.step.completed .step-number {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.step.completed .step-number::before {
    content: '✓';
    font-weight: bold;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(205, 133, 63, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(205, 133, 63, 0); }
    100% { box-shadow: 0 0 0 0 rgba(205, 133, 63, 0); }
}

/* ワークフローステップ */
.workflow-step {
    margin-bottom: 2rem;
    border-radius: 12px;
    border: 2px solid #E5D5C8;
    background: white;
    transition: all 0.3s ease;
}

.workflow-step.active {
    border-color: #CD853F;
    box-shadow: 0 4px 12px rgba(205, 133, 63, 0.15);
}

.workflow-step.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #F8F4E9 0%, #FEFDFB 100%);
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #E5D5C8;
}

.workflow-step.active .step-header {
    background: linear-gradient(135deg, #FFF8DC 0%, #F8F4E9 100%);
}

.step-header h3 {
    margin: 0;
    color: #8B4513;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-icon {
    font-size: 1.2rem;
}

.step-status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    background: #E5D5C8;
    color: #8B4513;
}

.step-status.completed {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.step-status.ready {
    background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
    color: white;
}

.step-status.processing {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    animation: blink 1.5s infinite;
}

.step-status.error {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.step-content {
    padding: 1.5rem;
}

.step-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* バリデーションメッセージ */
.validation-message {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.validation-message.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.validation-message.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

.validation-message.info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #3B82F6;
}

/* API情報パネル */
.api-info-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: #F8F9FA;
    border-radius: 8px;
    border: 1px solid #E5D5C8;
}

.api-info-panel h4 {
    margin: 0 0 1rem 0;
    color: #059669;
    font-size: 1rem;
}

.api-info-panel p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #4B5563;
}

/* APIキーステータス */
.api-key-status {
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.status-icon {
    font-size: 1.2rem;
}

.status-text {
    font-weight: 500;
    color: #374151;
}

.status-details {
    font-size: 0.8rem;
    color: #6B7280;
}

/* 読み取り専用入力フィールド */
.readonly-input {
    background: #F9FAFB !important;
    color: #6B7280 !important;
    cursor: not-allowed;
}

.input-help {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6B7280;
    font-style: italic;
}

/* WebApp作成セクション */
.webapp-creation {
    padding: 1rem;
    background: #F8F4E9;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.url-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #E5D5C8;
}

.counter-help {
    font-size: 0.8rem;
    color: #6B7280;
}

.webapp-management h4 {
    margin: 0 0 1rem 0;
    color: #8B4513;
    font-size: 1rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .progress-steps {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .progress-steps::before {
        display: none;
    }

    .step {
        min-width: auto;
        flex: 1;
        min-width: 60px;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .step-actions {
        flex-direction: column;
    }
}