/* Text Diff Checker Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.subtitle {
    text-align: center;
    margin-bottom: 40px;
    color: #666;
    font-size: 1.2em;
}

/* セクション共通スタイル */
.control-section,
.input-section,
.result-section,
.usage-section,
.ad-section {
    background: white;
    margin-bottom: 30px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

/* ===== Control Section ===== */

.control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
}

.comparison-settings h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #374151;
}

.setting-group {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.setting-group:last-child {
    margin-bottom: 0;
}

/* ===== Radio Buttons ===== */
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: color 0.2s ease;
}

.radio-label:hover {
    color: #667eea;
}

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

.radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #667eea;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: #667eea;
    border-radius: 50%;
}

/* ===== Checkbox ===== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #667eea;
}

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

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #667eea;
    background-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    font-size: 1rem;
}

/* ===== Input Section ===== */

.text-input-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.input-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

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

.text-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.6;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.2s ease;
    background: #fafafa;
}

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

.text-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.input-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6b7280;
}

/* ===== Result Section ===== */

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

.result-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

.legend {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.added {
    background-color: #34d399;
}

.legend-color.deleted {
    background-color: #f87171;
}

.legend-color.modified {
    background-color: #fbbf24;
}

/* ===== Stats Panel ===== */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
}

/* ===== Diff Container ===== */
.diff-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.diff-panel {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.diff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.diff-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.diff-content {
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
    background: #fafafa;
}

/* ===== Diff Highlighting ===== */
.diff-added {
    background-color: #d1fae5;
    color: #065f46;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #34d399;
}

.diff-deleted {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #f87171;
    text-decoration: line-through;
}

.diff-modified {
    background-color: #fef3c7;
    color: #92400e;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #fbbf24;
}

.diff-unchanged {
    color: #6b7280;
}

/* ===== Usage Section ===== */

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.usage-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.usage-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.usage-step {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.usage-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.usage-content p {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
}


/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .subtitle {
        font-size: 1rem;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .text-input-container {
        grid-template-columns: 1fr;
    }
    
    .diff-container {
        grid-template-columns: 1fr;
    }
    
    .result-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .legend {
        justify-content: center;
    }
    
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .setting-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .usage-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .control-section,
    .input-section,
    .result-section,
    .usage-section,
    .ad-section {
        padding: 20px;
    }
    
    .usage-card {
        padding: 1rem;
    }
    
    .stats-panel {
        grid-template-columns: 1fr;
    }
}