/* パスワード生成ツール専用スタイル */

: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;
}

/* セクション共通スタイル */
.settings-section,
.action-section,
.output-section,
.batch-section,
.presets-section,
.tools-section,
.security-guide-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;
}

.settings-section h3,
.presets-section h3,
.tools-section h3,
.security-guide-section h3,
.info-section h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 長さ制御 */
.length-control {
    margin-bottom: 2rem;
}

.length-control label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.length-input {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.length-input input[type="range"] {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.length-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-grad);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.length-display {
    font-weight: 700;
    color: #4299e1;
    min-width: 40px;
    text-align: center;
    font-size: 1.1rem;
}

.length-unit {
    color: #718096;
    font-size: 0.9rem;
}

/* 文字オプション */
.character-options {
    margin-bottom: 2rem;
}

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

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

.character-item {
    cursor: pointer;
}

.character-item input[type="checkbox"] {
    display: none;
}

.character-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.character-item input[type="checkbox"]:checked + .character-card {
    background: var(--primary-grad);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-primary);
}

.character-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.character-info {
    flex: 1;
}

.character-type {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.character-example {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.2rem;
}

/* 詳細設定 */
.advanced-options {
    margin-bottom: 2rem;
}

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

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

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

.option-group label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.option-group input[type="text"] {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.option-group input[type="text"]:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.checkbox-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4299e1;
}

.checkbox-item span {
    font-size: 0.9rem;
    color: #2d3748;
}

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

.generate-btn,
.batch-btn,
.preset-btn,
.copy-btn,
.regenerate-btn,
.toggle-btn,
.batch-generate-btn {
    background: var(--primary-grad);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.generate-btn:hover,
.batch-btn:hover,
.preset-btn:hover,
.copy-btn:hover,
.regenerate-btn:hover,
.toggle-btn:hover,
.batch-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.generate-btn {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* 出力セクション */
.output-options {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.password-display {
    margin-bottom: 2rem;
}

.password-field {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

#generatedPassword {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1.1rem;
    background: #f7fafc;
    color: #2d3748;
    transition: border-color 0.3s ease;
}

#generatedPassword:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* 強度メーター */
.strength-analysis {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
}

.strength-meter {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.strength-label {
    font-weight: 600;
    color: #2d3748;
    min-width: 60px;
    font-size: 0.9rem;
}

.strength-bar {
    flex: 1;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: all 0.5s ease;
    width: 0%;
    background: #e53e3e;
}

.strength-text {
    font-weight: 600;
    min-width: 80px;
    text-align: right;
    font-size: 0.9rem;
}

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

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.stat-label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

/* 一括生成セクション */
.batch-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

.batch-input label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.batch-input input[type="number"] {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 80px;
    text-align: center;
}

.batch-results {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #2d3748;
    line-height: 1.6;
}

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

.presets-grid .preset-btn {
    background: #f7fafc;
    color: #2d3748;
    border: 2px solid #e2e8f0;
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    min-height: 120px;
    justify-content: center;
}

.presets-grid .preset-btn:hover {
    background: var(--primary-grad);
    color: white;
    border-color: transparent;
}

.presets-grid .preset-btn span {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.presets-grid .preset-btn small {
    font-size: 0.8rem;
    opacity: 0.8;
}

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

.tool-item {
    background: #f7fafc;
    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: 1rem;
}

.tool-content input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.tool-content button {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

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

.passphrase-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.passphrase-controls label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.passphrase-controls input[type="number"] {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 80px;
    text-align: center;
}

.check-result,
.passphrase-result {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    color: #2d3748;
    white-space: pre-wrap;
    line-height: 1.5;
    min-height: 60px;
}

/* セキュリティガイド */
.guide-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.strength-levels h4,
.security-tips h4 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.level-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.level-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.level-item.weak .level-indicator {
    background: #e53e3e;
}

.level-item.fair .level-indicator {
    background: #d69e2e;
}

.level-item.good .level-indicator {
    background: #38a169;
}

.level-item.strong .level-indicator {
    background: #3182ce;
}

.level-info h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.2rem;
}

.level-info small {
    font-size: 0.8rem;
    color: #718096;
}

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

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

.tip-icon {
    font-size: 1.5rem;
    color: #4299e1;
    margin-bottom: 1rem;
}

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

.tip-item p {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
}

/* 情報セクション */
.info-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

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

.feature-icon {
    font-size: 2rem;
    color: #4299e1;
    margin-bottom: 1rem;
}

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

.feature-item p {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
}

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

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

.usage-examples li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
    font-size: 0.9rem;
}

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

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

.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #e6fffa;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid #b2f5ea;
}

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

.privacy-text strong {
    color: #2d3748;
    font-weight: 600;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.privacy-text p {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* エラー・成功メッセージ */
.error-message {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 1rem;
    color: #c53030;
    font-size: 0.9rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-message {
    background: #c6f6d5;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    padding: 1rem;
    color: #2f855a;
    font-size: 0.9rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }
    
    .character-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .advanced-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header {
        padding: 1.5rem 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .settings-section,
    .action-section,
    .output-section,
    .batch-section,
    .presets-section,
    .tools-section,
    .security-guide-section,
    .info-section {
        padding: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .character-grid {
        grid-template-columns: 1fr;
    }
    
    .password-field {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .action-section {
        flex-direction: column;
    }
    
    .generate-btn,
    .batch-btn,
    .preset-btn {
        width: 100%;
        justify-content: center;
    }
    
    .presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .levels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .presets-grid {
        grid-template-columns: 1fr;
    }
    
    .levels-grid {
        grid-template-columns: 1fr;
    }
    
    .batch-controls,
    .passphrase-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .length-input {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .password-stats {
        grid-template-columns: 1fr;
    }
}