/* JSONフォーマッター・バリデーター専用スタイル */

:root {
    --container-max: 1200px;
    --radius-lg: 12px;
    --primary-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-white: #ffffff;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-primary: 0 4px 20px rgba(102, 126, 234, 0.3);
}

body {
    background: var(--bg-white);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: var(--primary-grad);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-primary);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.tool-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    border: 1px solid #e2e8f0;
}

/* セクション共通スタイル */
.input-section,
.settings-section,
.action-section,
.output-section,
.analysis-section,
.error-section,
.tools-section,
.samples-section,
.info-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.input-section {
    background: #f8f9fa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-options,
.output-options {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.file-label:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.file-label input[type="file"] {
    display: none;
}

.clear-btn,
.paste-btn,
.copy-btn,
.download-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.clear-btn {
    background: #e53e3e;
    color: white;
}

.clear-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
}

.paste-btn {
    background: #718096;
    color: white;
}

.paste-btn:hover {
    background: #4a5568;
    transform: translateY(-1px);
}

.copy-btn {
    background: #4299e1;
    color: white;
}

.copy-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.download-btn {
    background: #ed8936;
    color: white;
}

.download-btn:hover {
    background: #dd6b20;
    transform: translateY(-1px);
}

#jsonInput {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 300px;
    transition: all 0.2s ease;
    outline: none;
}

#jsonInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-status {
    padding: 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-valid {
    color: #38a169;
}

.status-invalid {
    color: #e53e3e;
}

/* 設定セクション */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: center;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.95rem;
}

.setting-group select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

.setting-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.setting-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.setting-group span {
    font-weight: 500;
    color: #2d3748;
}

/* アクションセクション */
.action-section {
    text-align: center;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.format-btn,
.minify-btn,
.validate-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
}

.format-btn {
    background: var(--primary-grad);
    color: white;
    box-shadow: var(--shadow-primary);
}

.format-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.minify-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.minify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4);
}

.validate-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(237, 137, 54, 0.3);
}

.validate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(237, 137, 54, 0.4);
}

.action-section .copy-btn,
.action-section .download-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    min-width: 140px;
    justify-content: center;
}

/* 出力セクション */
#jsonOutput {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    background: #f8fafc;
    color: #2d3748;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* 分析セクション */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-card);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
    color: #667eea;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    text-align: left;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #718096;
    font-weight: 500;
}

.structure-info {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
}

.structure-info h4 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.structure-details {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: #4a5568;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* エラーセクション */
.error-section {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border: 2px solid #fc8181;
}

.error-section h3 {
    color: #c53030;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-details {
    color: #c53030;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* ツールセクション */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
}

.tool-item h4 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tool-content input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
}

.tool-content input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tool-content button {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tool-content button:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.path-result,
.type-analysis,
.schema-result {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: #4a5568;
    background: var(--bg-white);
    padding: 1rem;
    border-radius: var(--radius-lg);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    line-height: 1.5;
}

/* サンプルセクション */
.samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.sample-btn {
    background: var(--bg-white);
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    color: inherit;
}

.sample-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.sample-btn i {
    font-size: 1.5rem;
    color: #667eea;
    flex-shrink: 0;
}

.sample-btn span {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.25rem;
}

.sample-btn small {
    color: #718096;
    font-size: 0.9rem;
    display: block;
}

/* 情報セクション */
.info-content {
    color: #4a5568;
    line-height: 1.7;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
}

.feature-icon {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.feature-item h4 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.feature-item p {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.usage-examples {
    margin-bottom: 2rem;
}

.usage-examples h4 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.usage-examples ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.usage-examples li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
    line-height: 1.6;
}

.usage-examples li:last-child {
    border-bottom: none;
}

.usage-examples strong {
    color: #2d3748;
    font-weight: 600;
}

.json-guide {
    margin-bottom: 2rem;
}

.json-guide h4 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.guide-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
}

.guide-item h5 {
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.guide-item code {
    background: var(--bg-white);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: #667eea;
    display: block;
    margin: 0.5rem 0;
    border: 1px solid #e2e8f0;
}

.guide-item small {
    color: #718096;
    font-size: 0.8rem;
    display: block;
}

.privacy-note {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4f4dd 100%);
    border: 2px solid #48bb78;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.privacy-icon {
    font-size: 2rem;
    color: #2f855a;
    flex-shrink: 0;
}

.privacy-text strong {
    color: #2f855a;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.privacy-text p {
    color: #2f855a;
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* メッセージスタイル */
.success-message {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    border: 1px solid #68d391;
    border-radius: var(--radius-lg);
    padding: 1rem;
    color: #2f855a;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border: 1px solid #fc8181;
    border-radius: var(--radius-lg);
    padding: 1rem;
    color: #c53030;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header {
        margin-bottom: 2rem;
        padding: 1.5rem 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .input-section,
    .settings-section,
    .action-section,
    .output-section,
    .analysis-section,
    .error-section,
    .tools-section,
    .samples-section,
    .info-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .input-options,
    .output-options {
        width: 100%;
        justify-content: flex-start;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-section {
        flex-direction: column;
        align-items: center;
    }
    
    .format-btn,
    .minify-btn,
    .validate-btn,
    .action-section .copy-btn,
    .action-section .download-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .samples-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-grid {
        grid-template-columns: 1fr;
    }
    
    .privacy-note {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    header {
        margin-bottom: 1.5rem;
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .tool-card {
        padding: 1rem;
    }
    
    .input-section,
    .settings-section,
    .action-section,
    .output-section,
    .analysis-section,
    .error-section,
    .tools-section,
    .samples-section,
    .info-section {
        padding: 1rem;
    }
    
    #jsonInput,
    #jsonOutput {
        min-height: 200px;
    }
    
    .input-options,
    .output-options {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .file-label,
    .clear-btn,
    .paste-btn,
    .copy-btn,
    .download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .stat-content {
        text-align: center;
    }
    
    .sample-btn {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .feature-item {
        padding: 1rem;
    }
    
    .feature-icon {
        font-size: 2rem;
    }
    
    .tool-content {
        gap: 0.5rem;
    }
    
    .path-result,
    .type-analysis,
    .schema-result {
        max-height: 150px;
        font-size: 0.7rem;
        padding: 0.75rem;
    }
}