/* ハッシュ生成ツール専用スタイル */

: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-color: 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,
.output-section,
.comparison-section,
.algorithms-detail-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;
}

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

.section-header h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin: 0;
    font-weight: 600;
}

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

/* ボタン統一スタイル */
.file-label,
.clear-btn,
.paste-btn,
.generate-btn,
.select-all-btn,
.clear-all-btn,
.copy-all-btn,
.download-btn,
.compare-btn,
.sample-btn {
    background: var(--primary-grad);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.75rem 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    text-decoration: none;
    min-width: 120px;
}

.file-label:hover,
.clear-btn:hover,
.paste-btn:hover,
.generate-btn:hover,
.select-all-btn:hover,
.clear-all-btn:hover,
.copy-all-btn:hover,
.download-btn:hover,
.compare-btn:hover,
.sample-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.file-label {
    position: relative;
    cursor: pointer;
}

.file-label input {
    display: none;
}

/* アクションボタンの色バリエーション */
.clear-btn,
.clear-all-btn {
    background: linear-gradient(45deg, #e53e3e, #c53030);
}

.paste-btn {
    background: linear-gradient(45deg, #6c757d, #5a6268);
}

.copy-all-btn {
    background: linear-gradient(45deg, #ed8936, #dd6b20);
}

/* テキストエリア */
#inputText {
    width: 100%;
    min-height: 200px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: #f8fafc;
    transition: border-color 0.3s ease;
}

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

/* ファイル情報 */
.file-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1976d2;
    font-size: 0.9rem;
}

/* アルゴリズム選択 */
.algorithm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.algorithm-item {
    position: relative;
}

.algorithm-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.algorithm-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.algorithm-item input[type="checkbox"]:checked + .algorithm-card {
    border-color: #667eea;
    background: #f0f8ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

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

.algorithm-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #2d3748;
    font-weight: 600;
}

.algorithm-info small {
    color: #718096;
    font-size: 0.9rem;
}

.security-level {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.security-level.low {
    background: #fed7d7;
    color: #c53030;
}

.security-level.medium {
    background: #feebc8;
    color: #dd6b20;
}

.security-level.high {
    background: #c6f6d5;
    color: #25855a;
}

.security-level.highest {
    background: #bee3f8;
    color: #2c5282;
}

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

/* ハッシュ結果 */
.hash-results {
    display: grid;
    gap: 1rem;
}

.hash-result {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}

.hash-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hash-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #4a5568;
    word-break: break-all;
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.copy-hash-btn {
    background: linear-gradient(45deg, #4299e1, #3182ce);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.copy-hash-btn:hover {
    background: linear-gradient(45deg, #3182ce, #2c5282);
    transform: translateY(-1px);
}

/* 比較セクション */
.comparison-input {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.comparison-input label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    display: block;
}

.comparison-input input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.comparison-result {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    min-height: 40px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

/* アルゴリズム詳細 */
.algorithms-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.algorithm-detail-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.algorithm-detail-card:hover {
    transform: translateY(-2px);
}

.algorithm-detail-card.recommended {
    border-color: #48bb78;
    background: linear-gradient(135deg, #c6f6d5 0%, #e6fffa 100%);
}

.algorithm-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.algorithm-header i {
    font-size: 1.5rem;
    color: #667eea;
}

.algorithm-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #2d3748;
    font-weight: 600;
}

.security-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: auto;
}

.security-badge.low {
    background: #fed7d7;
    color: #c53030;
}

.security-badge.medium {
    background: #feebc8;
    color: #dd6b20;
}

.security-badge.high {
    background: #c6f6d5;
    color: #25855a;
}

.security-badge.highest {
    background: #bee3f8;
    color: #2c5282;
}

.algorithm-specs {
    margin-bottom: 1rem;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.spec-label {
    font-weight: 500;
    color: #4a5568;
}

.spec-value {
    color: #2d3748;
    font-weight: 600;
}

.algorithm-note {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

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

.sample-btn {
    background: #f8fafc;
    color: #2d3748;
    border: 2px solid #e2e8f0;
    padding: 1.5rem;
    text-align: center;
    flex-direction: column;
    min-width: auto;
    transition: all 0.3s ease;
}

.sample-btn:hover {
    border-color: #667eea;
    background: #f0f8ff;
    color: #667eea;
}

.sample-btn span {
    font-weight: 600;
    margin: 0.5rem 0;
}

.sample-btn small {
    opacity: 0.7;
    font-size: 0.8rem;
}

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

.feature-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
}

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

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

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

.usage-examples {
    background: #edf2f7;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.usage-examples h4 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.usage-examples li {
    margin-bottom: 0.8rem;
    padding-left: 1rem;
    color: #4a5568;
    line-height: 1.6;
    position: relative;
}

.usage-examples li::before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.security-guide {
    background: #fff5f5;
    border: 2px solid #feb2b2;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.security-guide h4 {
    font-size: 1.2rem;
    color: #c53030;
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.guide-item {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #e53e3e;
}

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

.guide-item small {
    color: #718096;
    line-height: 1.4;
}

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

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

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

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

/* メッセージ */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.message.success {
    background: linear-gradient(45deg, #48bb78, #38a169);
}

.message.error {
    background: linear-gradient(45deg, #e53e3e, #c53030);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header {
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .input-section,
    .settings-section,
    .output-section,
    .comparison-section,
    .algorithms-detail-section,
    .samples-section,
    .info-section {
        padding: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .input-options,
    .output-options {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .action-section {
        flex-direction: column;
        align-items: center;
    }
    
    .file-label,
    .clear-btn,
    .paste-btn,
    .generate-btn,
    .select-all-btn,
    .clear-all-btn,
    .copy-all-btn,
    .download-btn,
    .compare-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .algorithm-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .comparison-input input {
        min-width: auto;
    }
    
    .hash-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .privacy-note {
        flex-direction: column;
        text-align: center;
    }
    
    #inputText {
        min-height: 150px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .feature-item {
        padding: 1rem;
    }
    
    .usage-examples {
        padding: 1rem;
    }
    
    .samples-grid {
        grid-template-columns: 1fr;
    }
}