/* 文字数カウンター専用スタイル */

: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,
.stats-section,
.analysis-section,
.presets-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 {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.clear-btn,
.paste-btn,
.sample-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);
}

.sample-btn {
    background: #48bb78;
    color: white;
}

.sample-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

#inputText {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 300px;
    transition: all 0.2s ease;
    outline: none;
}

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

.text-info {
    text-align: right;
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* 統計グリッド */
.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-card.primary {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4f4dd 100%);
    border: 2px solid #48bb78;
}

.stat-card.primary .stat-value {
    color: #2f855a;
}

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

.stat-card.primary .stat-icon {
    color: #2f855a;
}

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

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

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

/* 詳細分析セクション */
.analysis-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.character-breakdown h4,
.additional-stats h4 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.character-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.char-stat-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.char-type {
    font-weight: 600;
    color: #2d3748;
}

.char-count {
    font-weight: 600;
    color: #667eea;
}

.char-percent {
    font-size: 0.9rem;
    color: #718096;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-fill.hiragana {
    background: linear-gradient(90deg, #48bb78, #38a169);
}

.progress-fill.katakana {
    background: linear-gradient(90deg, #4299e1, #3182ce);
}

.progress-fill.kanji {
    background: linear-gradient(90deg, #ed8936, #dd6b20);
}

.progress-fill.alphabet {
    background: linear-gradient(90deg, #9f7aea, #805ad5);
}

.additional-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.additional-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
}

.stat-name {
    font-weight: 500;
    color: #4a5568;
}

.stat-value {
    font-weight: 600;
    color: #667eea;
}

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

.preset-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;
    flex-direction: column;
    gap: 0.5rem;
}

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

.preset-btn i {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.preset-btn span {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

.preset-btn small {
    color: #718096;
    font-size: 0.9rem;
}

/* 情報セクション */
.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;
}

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

/* レスポンシブデザイン */
@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,
    .stats-section,
    .analysis-section,
    .presets-section,
    .info-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .input-options {
        width: 100%;
        justify-content: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .presets-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-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,
    .stats-section,
    .analysis-section,
    .presets-section,
    .info-section {
        padding: 1rem;
    }
    
    #inputText {
        min-height: 200px;
    }
    
    .input-options {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .clear-btn,
    .paste-btn,
    .sample-btn {
        width: 100%;
        justify-content: center;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .stat-content {
        text-align: center;
    }
    
    .feature-item {
        padding: 1rem;
    }
    
    .feature-icon {
        font-size: 2rem;
    }
}